3
$\begingroup$

Let us assume that we have a random number generator given by its probability density function. Now, we need to use this distribution to generate a number that has the following property. It minimises the root mean square deviation between itself and random numbers generated by the considered distribution.

My question is this number has a special name. May be it is just a mean or median?

$\endgroup$
1

1 Answer 1

2
$\begingroup$

I think that the mean has the described property. I want to find x that minimises the following expression: (x - x1)^2 + (x - x2)^2 + ... + (x - xn)^2.

To minimise the above expression over x, we take the derivative over x and say that it must be equal to zero:

2*(x - x1) + 2*(x - x2) + ... + 2*(x - xn) = 0

From the above expression we get:

x = (x1 + x2 + ... + xn)/n.

$\endgroup$
3
  • $\begingroup$ You are correct. $\endgroup$ Commented Jan 28, 2013 at 22:17
  • 1
    $\begingroup$ This answer is correct. You may also be interested in this answer to a previous question, which shows the same result. $\endgroup$
    – Macro
    Commented Jan 28, 2013 at 23:50
  • 2
    $\begingroup$ You don't need Calculus to obtain this result: $X=(x_1, \ldots, x_n)$ is a vector in $\mathbb{R}^n$ and so is $Y=(1, \ldots, 1)$. We work in the plane (or line) generated by these vectors. The Pythagorean Theorem asserts that $(x-x_1)^2 + \cdots + (x-x_n)^2$ is the squared distance between $X$ and $xY$. This is minimized when $X-xY$ is perpendicular to $Y$; that is, their dot product $(X-xY)\cdot Y$ is zero. This implies $X\cdot Y=x(Y\cdot Y)=x(n)$. Since $X\cdot Y = x_1+\cdots+x_n$, we conclude $Y = (x_1+\cdots+x_n)/n$ is the solution: that's the arithmetic mean. $\endgroup$
    – whuber
    Commented Jan 29, 2013 at 4:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.