Probability of a structure of consecutive head tosses

117 Views Asked by At

The exercise: A group of N friends sits around a table shaped as a regular polygon with N sides, one person on each side. Everyone tosses a fair coin once and a person is called positive if she and the people sitting on adjacent sides obtain heads. What are the expectation and variance of the number of positive people?

My attempt: I managed to find the expectation proceeding as follows. Introduce random variables $X_1, X_2,\ldots, X_N$ such that: $X_i = 1$ if persons $i-1, \ i, \ i+1$ all obtain heads for $i \in \{2,\ldots, N-1\}$; $X_1 = 1$ if people $N, 1, 2$ all obtain heads; and $X_N = 1$ if people $N-1, N, 1$ all obtain heads; otherwise $X_i = 0$.

Then $Y=X_1 + \ldots + X_N$ is the number of positive people and it remains to find $\mathbb{E}(Y)$ and $\mathbb{Var}(Y)$. By linearity of expectation (the following is reworked as discussed in the comments):

\begin{align} { \mathbb{E}(Y) = \mathbb{E}(X_1 + \ldots + X_N) = \mathbb{E}(X_1) +\ldots+ \mathbb{E}(X_{N}) } \end{align}

Now each of the terms above is equal to $\frac{1}{8}$, which yields $\mathbb{E}(Y) = \frac{N}{8}$.

Using $\mathbb{Var}(Y) = \mathbb{E}(Y^2)-\mathbb{E}(Y)^2$, it suffices to find $\mathbb{E}(Y^2)$: \begin{align} \mathbb{E}(Y^2) = \mathbb{E}\left((X_1 + \ldots X_N)^2\right) = \sum\limits_{i=1}^{N}\mathbb{E}(X_i^2) + \sum\limits_{i\neq j}\mathbb{E}(X_i X_j) = \sum\limits_{i=1}^N\mathbb{E}(X_i) + \sum\limits_{i \neq j}\mathbb{P}(X_i=X_j=1) \end{align}

As pointed out in the comments, we break the second term into three scenarios: $⋅∙∙ \ ⋅, \ ⋅∙⋅∙ \ ⋅$, and $⋅∙⋅⋅∙ \ ⋅$; the last represents the case when $X_i$ and $X_j$ are independent.

  1. Scenario $⋅∙∙⋅$
    For fixed $i$ and $j$:
    \begin{align} \mathbb{P}(X_i=X_j=1) = \mathbb{P}(X_j = 1 \vert X_i = 1)\mathbb{P}(X_i = 1) = \begin{cases} \frac{1}{2^4} \ \ \ \text{for} \ \ N \geq 4 \\ \frac{1}{2^3} \ \ \ \text{for} \ \ N=3 \end{cases} \end{align} The summation contains $2N$ such terms.

  2. Scenario $⋅∙⋅∙⋅$
    This case only appears for $N \geq 4$. For fixed $i$ and $j$: \begin{align} \mathbb{P}(X_i=X_j=1) = \mathbb{P}(X_j = 1 \vert X_i = 1)\mathbb{P}(X_i = 1) = \begin{cases} \frac{1}{2^5} \ \ \ \text{for} \ \ N \geq 5 \\ \frac{1}{2^4} \ \ \ \text{for} \ \ N=4 \\ \end{cases} \end{align} This scenario occurs in 4 ways for $N=4$ and $2N$ ways for $N\geq 5$.

  3. Scenario $⋅∙⋅⋅∙⋅$
    Here the two fixed people $i$ and $j$ are independent. This case occurs only for $N \geq 6$. \begin{align} \mathbb{P}(X_i=X_j=1) = \mathbb{P}(X_j = 1)\mathbb{P}(X_i = 1) = \frac{1}{2^6} \ \ \ \text{for} \ \ N \geq 6 \end{align} There are $N(N-5)$ ways to choose this option. This is because there are $N$ choices for the first number and $N-5$ for the second (we need to ignore the chosen number and two numbers on each of its sides).

Summarising, \begin{align} \sum\limits_{i \neq j}\mathbb{P}(X_i=X_j=1) = \begin{cases} \frac{6}{2^3} = \frac{3}{4} \ \ \ \text{for} \ \ N =3 \\ \frac{4}{2^4}+\frac{8}{2^4} = \frac{3}{4} \ \ \ \text{for} \ \ N = 4 \\ \frac{10}{2^5}+\frac{10}{2^4} = \frac{15}{16} \ \ \ \text{for} \ \ N = 5 \\ \frac{N(N-5)}{2^6}+\frac{2N}{2^5} + \frac{2N}{2^4} = \frac{N(N+7)}{64} \ \ \ \text{for} \ \ N \geq 6 \end{cases} \end{align} which gives \begin{align} \mathbb{E}(Y^2) = \begin{cases} \frac{9}{8}\ \ \ \text{for} \ \ N =3 \\ \frac{5}{4} \ \ \ \text{for} \ \ N = 4 \\ \frac{25}{16} \ \ \ \text{for} \ \ N = 5 \\ \frac{N(N+15)}{64} \ \ \ \text{for} \ \ N \geq 6 \end{cases} \end{align} resulting in \begin{align} \mathbb{Var}(Y) = \begin{cases} \frac{63}{64}\ \ \ \text{for} \ \ N =3 \\ \frac{64}{64} \ \ \ \text{for} \ \ N = 4 \\ \frac{75}{64} \ \ \ \text{for} \ \ N = 5 \\ \frac{15N}{64} \ \ \ \text{for} \ \ N \geq 6 \end{cases} \end{align}

A simulation confirms both results, the theoretical values are marked with the blue lines (and almost invisible points in the case of variance): Mean vs N Variance vs N

My questions:
1. Is there a better way to tackle this problem? For example, I tried using a Markov chain approach, but it seemed too complicated. A dream would be to obtain a PGF for the random variable Y.
2. Are there similar, let's call them "dragon eating its tail", famous problems?