1

Let $X$ be a Random Variable with a Probability Density Function (PDF) $f(x)$. The Expected Value of $X$, denoted as $\mathbb{E}[X]$ is defined as:

\begin{equation} \mathbb{E}[X] = \int_{-\infty}^{\infty} x \cdot f(x) \, dx \end{equation}

To me, the above integral seems to represent the 'area under the curve' for some mathematical function $x \cdot f(x)$ between $-\infty$ and $+\infty$.

My Question: Why does the answer of this integral "magically" correspond to the "mean value" of $x$?

The answer to this integral will cover an entire area (i.e. sum) - therefore, why does $\mathbb{E}[X] = \int_{-\infty}^{\infty} x \cdot f(x) \, dx$ correspond to the mean value of $x$?

To me, this logic seems somewhat "arbitrary" - why is the average not equal to something like $\mathbb{E}[X] = \int_{-\infty}^{\infty} x^2 \cdot f(x) \, dx$ or $\mathbb{E}[X] = \int_{-\infty}^{\infty} x^3 \cdot f^{-1}(x) \, dx$?

Thanks!

  • Note: As a final note, my understanding of the "Average" is that of the "Expected Value". Suppose I have a 6-sided die - if I roll this die an infinite number of time, what would I "expect" the outcome of the die (i.e. "value of the die") to be? That is, on average - what would I expect to see in the die?
  • Assuming its a fair die - I can expect that each number on the die has a 1/6 probability of appearing.
  • Therefore, if I multiply each possible number the die can take by the probability of that number appearing - then, I take the average(by taking a sum) of this, I would get the Expected Value of the die
  • Since discrete sums are equivalent to continuous integrals - the Expected Value of a continuous Random Variable would correspond to $\mathbb{E}[X] = \int_{-\infty}^{\infty} x \cdot f(x) \, dx$
stats_noob
  • 4,107
  • 4
    An integral is a sum. Look at the discrete version of expected value and see how this is a natural extension. – Eric May 17 '23 at 18:19
  • If $f(x)$ is the density of an object, $\int x \cdot f(x)dx \approx \sum x_i \rho(x_i) \Delta x_i =\sum x_i \Delta m_i$ is the center of mass of the object. If the density is Uniform$([0,1])$, then the center of mass lies at $1/2$. But, if the density varies according to $f(x)$, then you must take a weighted average of the points. – Quasar May 17 '23 at 19:12

1 Answers1

2

The fault in your thinking is this Point :
My Question: Why does the answer of this integral "magically" correspond to the "mean value" of [[[[$\color{red} {f(x)}$]]]] ?

The Solution is hinted at in your own words here :
To me, this logic seems somewhat "arbitrary" - why is the average not equal to something like $\mathbb{E}[\color{red} {X}] = \int_{-\infty}^{\infty} \color{red} {x^2} \cdot f(x) \, dx$ or $\mathbb{E}[\color{red} {X}] = \int_{-\infty}^{\infty} \color{red} {x^3} \cdot f^{-1}(x) \, dx$?

This Statement is true :
To me, the above integral seems to represent the 'area under the curve' for some mathematical function $x \cdot f(x)$ between $-\infty$ and $+\infty$.

The Correct way to think about this is :
That Integral corresponds to the "mean value" of $x$ (not $f(x)$) which has been weighted by the Probability $f(x)$ :
$\mathbb{E}[\color{blue} {X}] = \int_{-\infty}^{\infty} \color{blue} {x} \cdot f(x) \, dx$
$\mathbb{E}[\color{blue} {X^2}] = \int_{-\infty}^{\infty} \color{blue} {x^2} \cdot f(x) \, dx$
$\mathbb{E}[\color{blue} {X^3}] = \int_{-\infty}^{\infty} \color{blue} {x^3} \cdot f(x) \, dx$

We can calculate "mean value" of some arbitrary function of $x$ , where each value will be weighted by the Probability @ that $x$ value.

Thus we can see that there is nothing arbitrary in that Integral :
Expectation of " $X$ or some function of $X$ " is always the Integral of " $X$ or the function of $X$ " weighted by the Probability Distribution function.

More Intuition into this :

When $X$ is always Positive , then negative values will have Probability Distribution function with $0$ value.
The Integral will multiply the negative $x$ values with $0$ to make sure there is no Contribution to the total !
The Positive $X$ values will get multiplied by non-zero to Contribute to the total.

When $X$ is always between $0$ & $100$ , then the $X$ values outside this will have Probability Distribution function with $0$ value.
The Integral will multiply the outside $x$ values with $0$ to make sure there is no Contribution to the total !
The values between $0$ & $100$ will get multiplied by non-zero to Contribute to the total.

ADDENDUM :
The Update to the Question Post indicates that OP has got the essence of the Issue here.
I want to Explicitly give Two Points which will aid OP a little more.

(1) When taking average , we have to Divide by total number of elements.
When using weighted average , we have to Divide by total weights.
Here , we have to Divide the Integral by $[total] = \int_{-\infty}^{\infty} f(x) \, dx$ , which is always $1$ , hence the Division is numerically not necessary.

(2) In your new Example of throwing Dice , we can change it like this :
To each outcome $x$ of the throw , we can associate some output number. Generally , it is $x$ itself , though we can have $x^2$ , $x-2$ , $2x$ Etc.
We then calculate that Expectation with the Same Summation or Integral , to get Expectation of $x$ , $x^2$ , $x-2$ , $2x$ Etc.
Important Case is when we associate every outcome with Constant output $1$. Then we want to know that Expectation. Intuitively , it is Constant , hence Expectation must be the Same Constant.
$\mathbb{E}[\color{blue} {1}] = \int_{-\infty}^{\infty} \color{blue} {1} \cdot f(x) \, dx$
This is always $1$ , which is consistent with the Intuition.

Prem
  • 14,696
  • @ Prem: Thank you so much for your answer! – stats_noob May 18 '23 at 03:18
  • I have included some new material [[ ADDENDUM SECTION ]] at the end , @stats_noob , which may aid a little more here ! – Prem May 18 '23 at 09:43
  • @ Prem: thank you so much! I have been working on this question here https://math.stackexchange.com/questions/4701209/different-ways-to-calculate-the-weighted-average can you please take a look at it if you have time? Thank you so much! – stats_noob May 18 '23 at 13:44