Calculating expectation, infinite fair coins tosses

83 Views Asked by At

Let's say I am tossing an infinite amount of fair coins independently (one side is $H$, and one side is $T$).

What's the expectation of the number of tosses until I see two following coins such that the first is $H$ and the second is $T$?

3

There are 3 best solutions below

0
On BEST ANSWER

Use the law of total expectation to solve this question.

$$\mathbb E[\text{#number of tosses}] = P(\text{H throws first})*\mathbb E[\text{T is thrown}+1] + P(\text{T throws first})*\mathbb E[\text{#number of tosses} +1]$$.

Note that the "$+1$" is because of the "turn wasted". The probabiliies we get $H$ or $T$ at the first turn is $0.5$ for each, and the expectation of $T$ is thrown is geometric with $p=0.5$. If we get $T$ at the first turn we need to "start all over again" (but remember we already "wasted" one turn).

Therefore:

(Let us write $\mathbb E[\text{#number of tosses}] = X$)

$$X = 0.5 * (2+1) + 0.5(X + 1)$$ $$ X = 1.5 + 0.5X + 0.5$$ $$0.5X = 2$$ $$ X=4$$

0
On

Let $X$ be the number of flips required to observe two consecutive coins $HT$. For any non-negative integer $k$, $X>k$ iff the first $k$ tosses are: $j$ $T$s and then $k-j$ $H$s with $j=0,1,2,\dots,k$. Hence $$P(X>k)=\frac{k+1}{2^k}$$ which implies that $$E(X)=\sum_{k\geq 0}P(X>k)=\sum_{k\geq 0}\frac{k+1}{2^k}=\frac{1}{(1-\frac{1}{2})^2}=4.$$

0
On

In general, for an unfair coin with $P(H)=p$ and $P(T)=q=1-p$ The expected time for getting the sequence "HT" is $$ \mathbb{E}\{\tau(HT)\} = \frac1{pq} $$

But, this is the trivial result. Try the same for "HH" (or "TT") sequences and you'll get surprised.