1
$\begingroup$

Here's a homework question:

A coin's probability to land on H is $p$. We toss it until we get the same result as we did the first time. Let $X$ be the number of times we tossed the coin.

What is the expected value of $X$?

Okay so first I have to define the probability mass function (PMF) of $X$, right? My problem is - how do I take into account the result of the first toss?

Also - I read a little and found out about the Pascal PMF of order $k$, which seems suitable for my case. Should I use it?

  • 0
    Hint: Consider the hypotheses of the first result and apply the formula of total probability. To calculate pmf of $X$ you may better calculate the pmf of the event that $X$ has not occur in $n$ steps.2011-12-01

1 Answers 1

1

We give two fairly full solutions. The first involves finding the probability distribution of $X$. The second bypasses that, and works directly with expectations. With either approach, it is a good idea to separate out the trivial cases $p=0$ and $p=1$.

Analysis via the distribution function: If you really want the distribution function of $X$, break things up into cases. It is clear that if $n<2$, then $P(X=n)=0$.

Given that at first you get a head (probability $p$) then the probability that $X=n$ is computed as follows. You need your initial head to be followed by $n-2$ tails, and then a head. This has probability $(1-p)^{n-2}p$.

Given that at first you get a tail (probability $1-p$) then the probability that $X=n$ is computed as follows. You need your initial tail to be followed by $n-2$ heads, and then a tail. This has probability $p^{n-2}(1-p)$.

Put things together. We get $P(X=n)=p(1-p)^{n-2}p +(1-p)p^{n-2}(1-p).$ This can be simplified a bit. Not much.

To compute $E(X)$ from the probability distribution of $X$, note that $E(X)=\sum_{n=2}^\infty n\left[p(1-p)^{n-2}p +(1-p)p^{n-2}(1-p)\right].$ You can now find simplify by handling separately $\sum_{n=2}^\infty n p(1-p)^{n-2}p$ and the other half. These two sums are closely related to the sums you need to evaluate when you find the mean of a random variable that has geometric distribution. It is likely that the mean of the geometric distribution has already been done in your course.

Direct calculation of expectation: Either you first get a head (probability $p$) or a tail (probability $1-p$). Either way, it has cost you $1$ toss.

Given that you got a head, we now are waiting for another head. The mean waiting time for a success where the probability of success is $p$ is $\dfrac{1}{p}$. (This comes from information about the geometric distribution, which likely has been dealt with in your course.)

Given that you got a tail, we now are waiting for another tail. The mean waiting time for a success where the probability of success is $1-p$ is $\dfrac{1}{1-p}$. It follows that $E(X)=1+p\frac{1}{p}+(1-p)\frac{1}{1-p}=3.$ Please note that the above analysis does not work if $p=0$ or $p=1$. In those two cases (with probability $1$), the game last for $2$ tosses only, and therefore $E(X)=2$.

  • 1
    A third way, which one could call intermediary, is first to compute $P(X\geqslant n)$ for every $n\geqslant1$ and then to use the fact that these sum to $E(X)$.2012-01-31