0

This problem appears in Girls in Math at Yale, a high school competition which I am prepping for:

"Marie repeatedly flips a fair coin and stops after she gets tails for the second time. What is the expected number of times Marie flips the coin?"

I deduced that for there to be n flips, we have to add $\dfrac{n(n-1)}{2^n}$ to get the

I have also encountered a few similar problems like dice problems, where I have to calculate things like $\dfrac{1\cdot1}{6} + \dfrac{2\cdot1}{36} + \dfrac{3\cdot1}{216} \cdots$

So how should I approach this?

Brian Tung
  • 34,160
  • Hi, welcome on MSE. Please try to format your question using https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference, so it's easier for everyone to read. Please also include your previous efforts to solve the question – watertrainer Feb 20 '24 at 21:18
  • I gave an answer for your literal question. However, for the motivating problem, you can take advantage of linearity of expectation and just double the time it takes to get one tail. – Brian Tung Feb 20 '24 at 21:44

4 Answers4

1

Basic approach. Summations of this kind can often be evaluated by differentiating a geometric sum, for which you may already know a formula. For example, let

$$ S(x) = \sum_{k=0}^\infty x^k = \frac{1}{1-x} $$

If we differentiate this with respect to $x$, we get

$$ S'(x) = \sum_{k=0}^\infty kx^{k-1} = \frac{d}{dx} \frac{1}{1-x} = \frac{1}{(1-x)^2} $$

which might be challenging to obtain otherwise. We can then multiply both sides by $x$ to get

$$ xS'(x) = \sum_{k=0}^\infty kx^k = \frac{x}{(1-x)^2} $$

Differentiating $S'(x)$ to get $S''(x)$, multiplying by whatever factor of $x$ you need, and then evaluating at $x = 1/2$ or $1/6$ or whatever should get you to where you need to go.

Brian Tung
  • 34,160
  • I'm sure this method has been written up here before, but I can't seem to find it. If some kind soul can find it, we can link this question to the dupe. – Brian Tung Feb 20 '24 at 21:36
1

The problem you mention can be easily solved using probability distributions. In fact, if you take 'success' as getting tails, the probability of success is $\dfrac{1}{2}$.

As the game is set to stop when there are two tails (successes), the number of failures (heads) before the game ends is modeled by a Negative Binomial distribution with parameters $p=\dfrac{1}{2}$ and $r=2$. Its mean is $$\dfrac{r(1-p)}{p}=2$$

We expect $2$ failures before getting two successes, and so $4$ flips in total. No infinite sums needed.

Julio Puerta
  • 3,454
  • 5
  • 20
1

It’s overkill for this particular problem, but I give a fully general (finite) formula for evaluating such sums with a worked example in my answer here.

In the case at hand, $$2\sum_{\text{n}\ =\ 0,\ 1,\ \dots}\binom{\text{n}}{\textbf{2}}\left(\tfrac{1}{2}\right)^{\text{n}}\ =\ 2\cdot\frac{\left(\tfrac{1}{2}\right)^{\textbf{2}}}{\left(1-\tfrac{1}{2}\right)^{\textbf{2}+1}}\ =\ 4\text{.}$$

Rafi
  • 1,531
  • 6
  • 11
1

$$\begin{aligned} S=\sum_{n=0}^\infty(n^2-n)2^{-n}&=\left[\sum_{n=0}^\infty(n^2-n)x^{-n}\right]_{x=2}\\ &=\left[\sum_{n=0}^\infty n^2x^{-n}-\sum_{n=0}^\infty nx^{-n}\right]_{x=2}\\ &=\left[x\frac{\text d}{\text dx}\left(x\frac{\text d}{\text dx}\sum_{n=0}^\infty x^{-n}\right)+x\frac{\text d}{\text dx}\sum_{n=0}^\infty x^{-n}\right]_{x=2}=[S_1(x)+S_2(x)]_{x=2} \end{aligned} $$ First we calculate the $2^{\text{nd}}$ term and then the $1^{\text{st}}$ one with the previous: $$ \begin{aligned} &S_2(x)=x\frac{\text d}{\text dx}\sum_{n=0}^\infty x^{-n}=x\frac{\text d}{\text dx}\left(\frac{x}{x-1}\right)=-\frac{x}{(x-1)^2}\\ &S_1(x)=x\frac{\text d}{\text dx}\left(-\frac{x}{(x-1)^2}\right)=\frac{x(x+1)}{(x-1)^3} \end{aligned} $$ Finally, we have $$S=\left[\frac{x(x+1)}{(x-1)^3}-\frac{x}{(x-1)^2}\right]_{x=2}=4$$ The cool thing about this is that now you can compute the general series for $\forall x$ as long as the summation converges ($|x|>1$).