How can I find the expected value of this random variable?

68 Views Asked by At

How can I find closed form of the following $E[X]=\sum^n_{i=1}iP(X=i)$

This is a problem of calculating the number of front-facing coins. $P_m$ is front-facing probability of a coin $m$. Each coin has different $P_m$.

Let $X$ the amount of front-facing coins. $n$ is the total number of coins.

\begin{align*} P(X=1) &=P_1(1−P_2)\ldots(1−P_n) + (1−P_1)P_2(1−P_3)\ldots(1−P_n)+\cdots \\ &\quad+(1−P_1)\ldots(1−P_{n−1})P_n, \\ P(X=2)&=P_1P_2\ldots(1−P_n)+(1−P_1)P_2P_3\ldots(1−P_n)+\cdots\\ &\quad+(1−P_1)\ldots P_{n−1}P_n, \\ &\qquad\vdots\\ P(X=n−1)&=(1−P_1)P_2\ldots P_n+P_1(1−P_2)P_3\ldots P_n+\cdots \\ &\quad +P_1\ldots(1−P_{n−1})P_n+P_1\ldots P_{n−1}(1−P_n), \\ P(X=n)&=P_1P_2\ldots P_n. \end{align*}

2

There are 2 best solutions below

5
On BEST ANSWER

You are over-complicating the question. For each $m \in \{1,\cdots,n\}$, let $X_m$ denote the RV given by

$$ X_m = \begin{cases} 1, & \text{if the $m$-th coin lands on head} \\ 0, & \text{if the $m$-th coin lands on tail} \end{cases} $$

Then $(X_m)_{m=1}^{n}$ are independent Bernoulli RVs with $X_m \sim \operatorname{Ber}(P_m)$. Moreover, $X = \sum_{m=1}^{n} X_m$. So

$$ E[X] = \sum_{m=1}^{n} E[X_m] = \sum_{m=1}^{n} P_m. $$

Although not asked by OP, it also allows to compute the variance easily, showing the usefulness of this representation:

$$ Var(X) = \sum_{m=1}^{n} Var(X_m) = \sum_{m=1}^{n} P_m(1-P_m). $$

1
On

I'm not sure about the exact meaning of $P(X=k)$ because it seems that the sum of probabilities is not equaled to 1 ($\Sigma_{i=1}^nP(X=i)<1$).

I think the first two terms of $P(X=2)$ should be $P_1P_2(1-P_3)...(1-P_n)+P_1(1-P_2)P_3...(1-P_n)$ and there is $n(n-1)$ terms.

Here is the answer if I understand your question correctly.

  • Let n-degree polynomial $f(x):=\Pi_{i=1}^n[P_i+x(1-P_i)]=\Sigma_{i=0}^{n}a_i\cdot x^i$.

  • Calculate the polynomial coefficient:

$a_0=P_1P_2…P_n$

$a_0 =P(X=n)$

$a_1=(1−P_1)P_2…P_n+P_1(1−P_2)P_3…P_n+⋯+P_1…(1−P_{n−1})P_n+P_1…P_{n−1}(1−P_n)$

$a_1 =P(X=n-1)$

$a_2=(1-P_1)(1-P_2)P_3...P_n+(1-P_1)P_2(1-P_3)P_4...P_n...+P_1P_2...(1-P_{n-1})(1-P_n)$

$a_2 =P(X=n-2)$

$a_{n-1}=P_1(1-P_2)...(1-P_n)+(1-P_1)P_2(1-P_3)...(1-P_n)+...+(1-P_1)...$

$a_{n-1}=P(X=1)$

Here we obtained that $a_i=P(X=n-i)\ for\ i=1,2...,n$

Hence the except value could be expressed as $\mathrm{\frac{d}{dx}}(\frac{f(x)}{x^n})|_{x=1}$.

$$\mathrm{\frac{d}{dx}}(\frac{f(x)}{x^n})|_{x=1}=-\Sigma_{i=1}^n[(n-i)\cdot a_i]=-\Sigma_{i=1}^n[i\cdot P(X=i)]=-E[X]$$

$E[X]=-\mathrm{\frac{d}{dx}}(\frac{f(x)}{x^n})|_{x=1}=-f'(1)/1^n-(-n)f(1)/1^{n-1}=-f'(1)+nf(1)=$

$f'(1)=\Sigma_{i=1}^n(1-P_i)=n-\Sigma_{i=1}^nP_i$

$f(1)=1$

$E[X]=\Sigma P_i$

Just forget it if my understanding is wrong.