Wikipedia:Reference desk/Archives/Mathematics/2023 June 12

= June 12 =

Expected value as integral
For a non-professional, why exactly is the expected value defined as $$\operatorname{E}[X] = \int_{-\infty}^\infty x \cdot f(x) dx$$, as is stated here? Ideally, explain step by step please.--Hildeoc (talk) 22:09, 12 June 2023 (UTC)
 * If the probability density function of a random variable $$X$$ is given as function on the reals, we can approximate its expected value by partitioning the real number line $$(-\infty,+\infty)$$ into an infinite collection of small intervals $$[x_i,x_{i{+}1}), i=-\infty...\infty.$$ The probability that an outcome of $$X$$ falls in the interval $$[x_i,x_{i{+}1})$$ is $$P\left(X\in[x_i,x_{i{+}1})\right).$$ Abbreviating this as $$p_i,$$ the approximation is then given by the sum $$\sum_{i=-\infty}^\infty x_ip_i.$$
 * Now recall that $$P\left(X\in[x_i,x_{i{+}1})\right)=\int_{x_i}^{x_{i{+}1}}f(x)\,dx.$$
 * You may see where this is going. The value of $$\sum_ix_ip_i$$ lies between the lower and upper Darboux sums for $$\int_{-\infty}^\infty xf(x)\,dx$$ for that same partitioning, so as the partitioning gets arbitrarily fine, the approximation tends to the value of that integral. --Lambiam 05:14, 13 June 2023 (UTC)