# Thread: Mathematical expectation of r. v.

1. ## Mathematical expectation of r. v.

Hi members,
A coin is tossed until head appears. What are the expected number of tosses ?

2. ## Re: Mathematical expectation of r. v.

$Pr[k]=\left(\dfrac 1 2 \right)^k$

$E[K]=\displaystyle{\sum_{k=1}^\infty}k \left(\dfrac 1 2 \right)^k= 2$

3. ## Re: Mathematical expectation of r. v.

Essentially the same as romsek. The probability a head occurs on the first toss is 1/2. In order that the first head occur on the second toss, there must be a tail on the first toss and a head on the second. The probability of each of those is 1/2 so the probability the first head occurs on the second toss is 1/4. Generally the probability the first head occurs on the kth toss is the probability of a head times the probability the first k-1 tosses are tails: $\left(\frac{1}{2}\right)\left(\frac{1}{2}\right)^{ k-1}= \left(\frac{1}{2}\right)^k$ as romsek said. The "Mathematical expectation" is the value of a given outcome times its probability, summed over all outcomes: $\sum_{k= 1}^\infty k\left(\frac{1}{2}\right)^k$, again what romsek gave.

One way to see that the sum is, in fact, 2 is to notice that the derivative of $x^k$ is $kx^{k- 1}= x^{-1}(kx^k)$. If we were to differentiate $\sum_{k= 0}^\infty x^k$ term by term, we would get $\sum_{k=1}^\infty kx^{k- 1}= x^{-1}\sum_{k= 1}^\infty kx^k$. That first sum is, of course, a geometric series which has sum $\frac{1}{1- x}$. The derivative of that is $\frac{1}{(1- x)^2}$. Now, if x= 1/2, that is $\frac{1}{(1- 1/2)^2}$= 4. So we are saying that $(1/2)^{-1}\sum_{k=1}^\infty k(1/2)^k= 2\sum_{k=1}^\infty k(1/2)^k= 4$ so that $\sum_{k= 1}^\infty k(1/2)^k= 2$.

4. ## Re: Mathematical expectation of r. v.

Essentially the same as romsek. The probability a head occurs on the first toss is 1/2. In order that the first head occur on the second toss, there must be a tail on the first toss and a head on the second. The probability of each of those is 1/2 so the probability the first head occurs on the second toss is 1/4. Generally the probability the first head occurs on the kth toss is the probability of a head times the probability the first k-1 tosses are tails: $\left(\frac{1}{2}\right)\left(\frac{1}{2}\right)^{ k-1}= \left(\frac{1}{2}\right)^k$ as romsek said. The "Mathematical expectation" is the value of a given outcome times its probability, summed over all outcomes: $\sum_{k= 1}^\infty k\left(\frac{1}{2}\right)^k$, again what romsek gave.

One way to see that the sum is, in fact, 2 is to notice that the derivative of $x^k$ is $kx^{k- 1}= x^{-1}(kx^k)$. If we were to differentiate $\sum_{k= 0}^\infty x^k$ term by term, we would get $\sum_{k=1}^\infty kx^{k- 1}= x^{-1}\sum_{k= 1}^\infty kx^k$. That first sum is, of course, a geometric series which has sum $\frac{1}{1- x}$. The derivative of that is $\frac{1}{(1- x)^2}$. Now, if x= 1/2, that is $\frac{1}{(1- 1/2)^2}$= 4. So we are saying that $(1/2)^{-1}\sum_{k=1}^\infty k(1/2)^k= 2\sum_{k=1}^\infty k(1/2)^k= 4$ so that $\sum_{k= 1}^\infty k(1/2)^k= 2$.