Mean / Expected value of a continuous random variable \(X\) with PDF \(f(x)\):
\[ \mu = E[X] = \int_{-\infty}^{\infty} x\, f(x)\,dx \]
Variance measures spread around the mean:
\[ \operatorname{Var}(X) = E[(X-\mu)^2] = E[X^2] - \mu^2,\quad \text{where } E[X^2]=\int_{-\infty}^{\infty} x^2 f(x)\,dx \]
Think of \(\mu\) as the “balance point” of the PDF’s area; variance is the average squared distance from that balance point.
PDF: \[ f(x)=\begin{cases} \dfrac{1}{b-a}, & a\le x\le b\\[4pt] 0,& \text{otherwise} \end{cases} \] Known results: \[ \mu=\dfrac{a+b}{2},\quad \operatorname{Var}(X)=\dfrac{(b-a)^2}{12},\quad \sigma=\dfrac{b-a}{\sqrt{12}} \]
PDF \(f(x)=\lambda e^{-\lambda x}\) for \(x\ge0\). Known results: \[ \mu=\frac{1}{\lambda},\quad E[X^2]=\frac{2}{\lambda^2},\quad \operatorname{Var}(X)=\frac{1}{\lambda^2},\quad \sigma=\frac{1}{\lambda}. \]
\(f(x)\,dx\) is an approximate probability that \(X\) falls in the tiny interval \([x, x+dx]\).
Geometrically, it’s a tiny area under the PDF: height \(=f(x)\), width \(=dx\).
Probability over any interval equals the area under the PDF:
\[ P(a\lt X\le b)=\int_{a}^{b} f(x)\,dx. \]
Note: This is about the PDF, not the CDF. We don’t take “area under the CDF.”
\(x\,f(x)\,dx\) is not a probability. It’s a tiny contribution to the mean (expected value):
\[ E[X] \;=\; \int_{-\infty}^{\infty} x\,f(x)\,dx \;\approx\; \sum x_i\,f(x_i)\,\Delta x . \]
Think of \(f(x)\,dx\) as a small “weight” at position \(x\). Each piece creates a little torque \(x\times \text{(weight)}\). The point where left/right torques cancel is the balance point \( \mu \) (the mean).
This is exactly what your “Riemann bars \((x\,f(x)\,\Delta x)\)” chart is showing.
\[ F(k)=P(X\le k)=\int_{-\infty}^{k} f(u)\,du \]
\[ P(a\lt X\le b)=\int_{a}^{b} f(x)\,dx \;=\; F(b)-F(a) \]
Mean \(\mu\): balance point (center of mass). It satisfies \[ \int_{-\infty}^{\mu}(\mu-x)f(x)\,dx = \int_{\mu}^{\infty}(x-\mu)f(x)\,dx . \]
Median \(m\): splits the area in half, so \(F(m)=0.5\).
Example (Exponential \(\lambda=0.04\)): mean \(=1/\lambda=25\), median \(=\ln 2/\lambda\approx17.33\). At \(x=25\), left area is \(F(25)\approx0.632\) (not 0.5) — but torques balance there.
\(f(x)=\tfrac12\). A small bin width \(dx=0.1\) at \(x=1.75\):
Summing all such \(x\,f(x)\,dx\) across \([0,2]\) gives \(E[X]=1\) (the midpoint).