PDA

View Full Version : Chapter 3, Problem 2


dstefan
06-10-2008, 02:42 AM
Chapter 3, Problem 2:

A coin lands heads with probability p and tails with probability 1-p. Let X be the number of times you must flip the coin until it lands heads. What are E[X] and var(X)?


Solution:

If the first coin toss is heads (which happens with probability 1/2), then X=1.

If the first coin toss is tails (which also happens with probability 1/2), then the coin tossing process resets and the number of steps before the coin lands heads will be 1 plus the expected number of coin tosses until the coin lands heads.

In other words, E[X] ~=~ \frac{1}{2} ~+~ \frac{1}{2} ~(1+E[X]). We conclude that E[X] = 2.

Another way of computing E[X] is as follows:
The coin will first land heads in the k-th toss, which corresponds to X = k, for a coin toss sequence of T T \dots T H, which occurs with probability 1/2^k. Then,
E[X] = \sum_{k=1}^{\infty} \frac{k}{2^k}
Recall that
T(n,1,x) ~=~ \sum_{k=1}^n k x^k ~=~ \frac{x - (n+1)x^{n+1} + n x^{n+2}}{(1-x)^2}
We conclude that
E[X] = \sum_{k=1}^{\infty} \frac{k}{2^k} = \lim_{n \to \infty} \sum_{k=1}^n \frac{k}{2^k} = \lim_{n \to \infty} \sum_{k=1}^n 4 \left( \frac{1}{2} - \frac{n+1}{2^{n+1}} + \frac{n}{2^{n+2}} \right) = 2.

Similarly,
E[X^2] = \sum_{k=1}^{\infty} \frac{k^2}{2^k} = \lim_{n \to \infty} \sum_{k=1}^n \frac{k^2}{2^k}.
Since
T(n,2,x) = \sum_{k=1}^{n} k^2 ~x^k = \frac{x+x^2 - (n+1)^2 x^{n+1} + (2n^2+2n-1) x^{n+2} - n^2 x^{n+3}}{(1-x)^3}
we find that
E[X^2] = \lim_{n \to \infty} \sum_{k=1}^n \frac{k^2}{2^k} = \lim_{n \to \infty} T(n,2,\frac{1}{2}) = 6
Therefore,
var(X) = E[X^2] - \left( E[X] \right)^2 = 2

ChuanYuan
07-15-2008, 11:09 AM
I just found interesting solution for this question from my own reference. This question is about Geometric Distribution: the probability distribution of the number X of Bernoulli trials needed to get one success. Each trial is independent with probability p of success, and 1-p (or q) of failure.

I tried to type some mathematical symbols here but I failed. If somebody could tell me how to do so I would really appreciate. So I just typed in word file with Mathtype. Hopefully it is correct and easy to understand.

Yuan