Brain fart: I really don't know why I'm getting the wrong answer when doing the algebra. Can somebody please show the work for this equivalency? http://upload.wikimedia.org/math/3/0/e/30eb0964923e7b3594319b939dae9afa.png You can skip steps. I am probably just making a silly mistake (aware that mu = sigma(x_i)/n).
what are we doing exactly?
oh
you want to show that equality is true?
ya. i'm getting the wrong answer when expanding the left side
\[\frac{1}{N}\sum_{i=1}^{N}(x_i-\mu)^2 \\ \frac{1}{N} \sum_{i=1}^N(x_i^2-2x_i \mu+\mu^2)\] are you cool with this so far?
I expanded the square thingy
(A-B)^2=A^2-2AB+B^2
you know since (A-B)^2=(A-B)(A-B)
yes. so far so good
\[\frac{1}{N} \sum_{i=1}^N x_i^2 -\frac{1}{N} \sum_{i=1}^{N}(2 x_i \mu +\mu^2) \] so it looks like we need to somehow show the following: \[\frac{-1}{N} \sum_{i=1}^N(2x_i \mu +\mu^2) \text{ is equal to } -\mu^2 \]
this is what i keep getting: \[\frac{ \sum_{i = 1}^{N} (X_i^2 - \mu^2)}{ N }-2\mu ^2\]
my bad. should be x_i^2 + mu^2 in bracket
recall the following: \[\mu=\frac{1}{N} \sum_{i=1}^{N}x_i\]
yes
mistake in: \[\frac{1}{N} \sum_{i=1}^N x_i^2 -\frac{1}{N} \sum_{i=1}^{N}(2 x_i \mu +\mu^2)\] oops I made a mistake earlier in this distribution so we should have: \[\frac{1}{N}\sum_{i=1}^{N}(x_i-\mu)^2 \\ \frac{1}{N} \sum_{i=1}^N(x_i^2-2x_i \mu+\mu^2) \\ \frac{1}{N} \sum_{i=1}^{N}x_i^2 -\frac{1}{N} \sum_{i=1}^N 2 x_i \mu + \frac{1}{N} \sum_{i=1}^N \mu^2 \\ \frac{1}{N} \sum_{i=1}^N x_i^2 -2 \mu \frac{1}{N} \sum_{i=1}^N \mu +\frac{1}{N} \sum_{i=1}^N \mu^2 \] guess what we can rewrite that middle term
\[\frac{1}{N}\sum_{i=1}^{N}(x_i-\mu)^2 \\ \frac{1}{N} \sum_{i=1}^N(x_i^2-2x_i \mu+\mu^2) \\ \frac{1}{N} \sum_{i=1}^{N}x_i^2 -\frac{1}{N} \sum_{i=1}^N 2 x_i \mu + \frac{1}{N} \sum_{i=1}^N \mu^2 \\ \frac{1}{N} \sum_{i=1}^N x_i^2 -2 \mu \frac{1}{N} \sum_{i=1}^N \mu +\frac{1}{N} \sum_{i=1}^N \mu^2 \\ \frac{1}{N} \sum_{i=1}^N x_i^2-2 \mu \cdot \mu +\frac{1}{N} \cdot N \mu^2 \] I went ahead and rewrote the last term as well
can you simplify it from there
oops that one thing in the sum is x_i type-o
but yeah the last line is correct the line before it i accidentally put mu in the sum instead of x_i
thank you! my mistake was that that sigma mu = N*mu . i left it as mu
\[\frac{1}{N}\sum_{i=1}^{N}(x_i-\mu)^2 \\ \frac{1}{N} \sum_{i=1}^N(x_i^2-2x_i \mu+\mu^2) \\ \frac{1}{N} \sum_{i=1}^{N}x_i^2 -\frac{1}{N} \sum_{i=1}^N 2 x_i \mu + \frac{1}{N} \sum_{i=1}^N \mu^2 \\ \frac{1}{N} \sum_{i=1}^N x_i^2 -2 \mu \frac{1}{N} \sum_{i=1}^N x_i +\frac{1}{N} \sum_{i=1}^N \mu^2 \\ \frac{1}{N} \sum_{i=1}^N x_i^2-2 \mu \cdot \mu +\frac{1}{N} \cdot N \mu^2 \]
yeah pretend c is a constant (and mu is in this situation so mu^2 is also) \[\sum_{i=1}^{n}c=nc\]
but anyways np :)
I can show you why that is if you like :) pretend f(i)=c \[\sum_{i=1}^{n}c=\sum_{i=1}^{n}f(i)=f(1)+f(2)+f(3)+f(4)+\cdots + f(n) \\ =c+c+c+c + \cdots +c =nc \\ \text{ since there are a } n \text{ amount of } c \text{ 's }\]
anyways peace
Join our real-time social learning platform and learn together with your friends!