s length is governed by the *other* side of the coin. If the coin is biased, a long first streak is evidence the first streak was the favored face, which pins the second streak to the *disfavored* (shorter-running) face. That information channel creates dependence -- and it shuts off only when the two faces are interchangeable, i.e. $p = 1/2$. Quick Estimate: Take $p = 0.8$. If the first streak is heads ($M$ has mean $1/q = 5$), the second is tails ($N$ has mean $1/p = 1.25$); if the first streak is tails (mean $1.25$), the second is heads (mean $5$). So a long $M$ pairs with a short $N$ and vice versa: negative correlation. At $p = 0.5$ both faces have identical geometric behavior, so $M$ tells you nothing about $N$ and th…"}},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://quantvault.org/"},{"@type":"ListItem","position":2,"name":"Problems","item":"https://quantvault.org/problems.html"},{"@type":"ListItem","position":3,"name":"Random Variables","item":"https://quantvault.org/random-variables-interview-questions.html"},{"@type":"ListItem","position":4,"name":"Correlation Between Consecutive Streak Lengths","item":"https://quantvault.org/problem-1257-correlation-between-consecutive-streak-lengths.html"}]}]}
Loading problems...
s length is governed by the *other* side of the coin. If the coin is biased, a long first streak is evidence the first streak was the favored face, which pins the second streak to the *disfavored* (shorter-running) face. That information channel creates dependence -- and it shuts off only when the two faces are interchangeable, i.e. $p = 1/2$.

Quick Estimate: Take $p = 0.8$. If the first streak is heads ($M$ has mean

/q = 5$), the second is tails ($N$ has mean
/p = 1.25$); if the first streak is tails (mean
.25$), the second is heads (mean $5$). So a long $M$ pairs with a short $N$ and vice versa: negative correlation. At $p = 0.5$ both faces have identical geometric behavior, so $M$ tells you nothing about $N$ and they are independent.

Approach: Build the joint PMF by conditioning on the first flip, read off both marginals by summing the joint, and then form the indicator covariance $P(M=m,N=n) - P(M=m)P(N=n)$. Watch the marginals carefully -- $M$ and $N$ do not have the same marginal law.

Formal Solution:

*Joint PMF.* Condition on the first flip.

  • Heads-first path (probability $p$): $M = m$ needs flips
    ,\dots,m$ to be H and flip $m+1$ to be T, contributing $p^{m-1}q$ given the first is H; then $N = n$ needs flips $m+1,\dots,m+n$ to be T and flip $m+n+1$ to be H, contributing $q^{n-1}p$. Product with the leading $p$: $p\cdot p^{m-1}q\cdot q^{n-1}p = p^{m+1}q^{n}$.
  • Tails-first path (probability $q$): symmetrically $q\cdot q^{m-1}p\cdot p^{n-1}q = q^{m+1}p^{n}$.

Adding the two disjoint cases,

$\boxed{P(M=m,\,N=n) = p^{m+1}q^{n} + q^{m+1}p^{n}.}$

*Marginal of $M$.* Sum over $n \ge 1$ using $\sum_{n\ge1} q^{n} = q/p$ and $\sum_{n\ge1} p^{n} = p/q$:

$P(M=m) = p^{m+1}\cdot\frac{q}{p} + q^{m+1}\cdot\frac{p}{q} = p^{m}q + q^{m}p.$

This matches the direct count: the first streak has length $m$ iff the first $m$ flips agree and flip $m+1$ differs ($p^{m}q$ if it started heads, $q^{m}p$ if tails).

*Marginal of $N$ (this is the step the careless version gets wrong).* Sum over $m \ge 1$ using $\sum_{m\ge1} p^{m+1} = p^{2}/q$ and $\sum_{m\ge1} q^{m+1} = q^{2}/p$:

$P(N=n) = \frac{p^{2}}{q}\,q^{n} + \frac{q^{2}}{p}\,p^{n} = p^{2}q^{\,n-1} + q^{2}p^{\,n-1}.$

Note $P(N=n) \ne P(M=m)$ in general: e.g. at $p=0.3$, $P(N=1)=p^{2}+q^{2}=0.58$ while $P(M=1)=2pq=0.42$. The second streak length is not distributed like the first. (The intuition: $N$ is the length of a run on a face whose identity is itself biased by the first streak, which reweights short vs. long second streaks.)

*Part 1 -- when are $M,N$ independent?* Independence requires $P(M=m,N=n) = P(M=m)P(N=n)$ for all $m,n$. The cleanest test is $m=n=1$: the joint is $p^{2}q + q^{2}p = pq$, while the product of marginals is $(2pq)(p^{2}+q^{2})$. Equality forces $p^{2}+q^{2} = 1/2$, i.e. $(p-q)^{2}=0$, i.e. $p = q = 1/2$. Conversely at $p=1/2$ the joint is

\cdot(1/2)^{m+n+1} = (1/2)^{m+n}$ and the marginals multiply to $(1/2)^{m}(1/2)^{n}=(1/2)^{m+n}$, so independence holds. Thus

$M \perp N \iff p = \tfrac12.$

*Part 2 -- sign of dependence when $p \ne 1/2$.* A long $M$ signals the favored face came first; the second streak is then the disfavored face, whose geometric length has the smaller mean. So large $M$ pairs with small $N$: negative correlation. Concretely, $E[M] = \frac{p}{q^{2}}\cdot q + \frac{q}{p^{2}}\cdot p$-type sums give $\mathrm{Cov}(M,N) = -\dfrac{(p-q)^{2}}{pq} < 0$ for $p\ne\frac12$ (and $0$ at $p=\frac12$). It is *not* a "limited supply of flips" effect -- the toss stream is infinite; the sign comes entirely from which face each streak occupies.

*Part 3 -- the indicator covariance.* Since these are indicators, $\mathrm{Cov}(\mathbf 1_{M=m},\mathbf 1_{N=n}) = P(M=m,N=n) - P(M=m)P(N=n)$. Substituting the joint and the two (different!) marginals,

$\mathrm{Cov}(\mathbf 1_{M=m},\,\mathbf 1_{N=n}) = \Big(p^{m+1}q^{n} + q^{m+1}p^{n}\Big) - \big(p^{m}q + q^{m}p\big)\big(p^{2}q^{\,n-1} + q^{2}p^{\,n-1}\big).$

This vanishes for all $m,n$ exactly when $p = 1/2$, consistent with Part 1, and is generally nonzero (and, summed against $mn$, yields the negative $\mathrm{Cov}(M,N)$ of Part 2) otherwise.

Answer: 1. $M$ and $N$ are independent if and only if $p = 1/2$. 2. For $p \ne 1/2$ they are negatively correlated ($\mathrm{Cov}(M,N) = -(p-q)^{2}/(pq) < 0$). 3. $\mathrm{Cov}(\mathbf 1_{M=m},\mathbf 1_{N=n}) = p^{m+1}q^{n} + q^{m+1}p^{n} - (p^{m}q + q^{m}p)(p^{2}q^{\,n-1} + q^{2}p^{\,n-1}).$

Intuition

The core lesson here is that *information leaks through transitions*. Even though individual coin flips are independent, the streak structure creates dependence between $M$ and $N$ because the end of the first streak determines the type of the second streak. A long heads streak is evidence that $p$ is large (if we think of this conditionally), which means the subsequent tails streak should be short. This is exactly the kind of negative correlation you see in regime-switching models in finance: if the market has been trending up for a long time, you might infer the trend is strong, which means the next reversal (once it comes) is likely to be brief.

The only escape is perfect symmetry at $p = 1/2$, where learning that the first streak was heads vs. tails gives you no information about how long the opposite streak will be, because both faces behave identically. This is a clean example of how symmetry creates independence and asymmetry creates correlation -- a theme that comes up repeatedly in probabilistic modeling.

Open the full interactive solver →

s length is governed by the *other* side of the coin. If the coin is biased, a long first streak is evidence the first streak was the favored face, which pins the second streak to the *disfavored* (shorter-running) face. That information channel creates dependence -- and it shuts off only when the two faces are interchangeable, i.e. $p = 1/2$. Quick Estimate: Take $p = 0.8$. If the first streak is heads ($M$ has mean $1/q = 5$), the second is tails ($N$ has mean $1/p = 1.25$); if the first streak is tails (mean $1.25$), the second is heads (mean $5$). So a long $M$ pairs with a short $N$ and vice versa: negative correlation. At $p = 0.5$ both faces have identical geometric behavior, so $M$ tells you nothing about $N$ and th…"}},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://quantvault.org/"},{"@type":"ListItem","position":2,"name":"Problems","item":"https://quantvault.org/problems.html"},{"@type":"ListItem","position":3,"name":"Random Variables","item":"https://quantvault.org/random-variables-interview-questions.html"},{"@type":"ListItem","position":4,"name":"Correlation Between Consecutive Streak Lengths","item":"https://quantvault.org/problem-1257-correlation-between-consecutive-streak-lengths.html"}]}]}
Loading problems...