The other day I was scrolling on my phone and came across the following meme:
For example, if 8 billion people had a Rock Paper Scissors tournament, apparently only 33 rounds would be needed to find the winner. I wrote a quick R script to verify this:
players <- 8e9
rounds <- 0
keep dividing by 2 until we reach 1
while(players > 1) {
players <- ceiling(players/2)
rounds <- rounds + 1
cat(sprintf("Round %d: %s players\n", rounds, format(players, scientific = FALSE, big.mark = ",")))
}
Round 1: 4,000,000,000 players
Round 2: 2,000,000,000 players
Round 3: 1,000,000,000 players
Round 4: 500,000,000 players
Round 5: 250,000,000 players
Round 6: 125,000,000 players
Round 7: 62,500,000 players
Round 8: 31,250,000 players
Round 9: 15,625,000 players
Round 10: 7,812,500 players
Round 11: 3,906,250 players
Round 12: 1,953,125 players
Round 13: 976,563 players
Round 14: 488,282 players
Round 15: 244,141 players
Round 16: 122,071 players
Round 17: 61,036 players
Round 18: 30,518 players
Round 19: 15,259 players
Round 20: 7,630 players
Round 21: 3,815 players
Round 22: 1,908 players
Round 23: 954 players
Round 24: 477 players
Round 25: 239 players
Round 26: 120 players
Round 27: 60 players
Round 28: 30 players
Round 29: 15 players
Round 30: 8 players
Round 31: 4 players
Round 32: 2 players
Round 33: 1 players
The answer seems correct! I got curious and wanted to see if the following questions could also be answered:
- Q1: On average, how many games are required (i.e. including ties)?
- Q2: On average, what is the variance of this of this number?
- Q3: What is the probability that more than $x$ games are required?
I tried to answer each one.
Q1
- Each player randomly chooses rock, paper, or scissors (1/3 probability each)
- For a tie, both players must choose the same option
- Therefore probability of a tie is $ \frac{1}{3} $
- So probability of a non-tie is $ \frac{2}{3} $
The expected number of attempts needed until we get a non-tie result follows a geometric distribution. The expected value is:
$$ E(\text{attempts per game}) = \frac{1}{p} = \frac{1}{\frac{2}{3}} = \frac{3}{2} $$
Now, for the total number of games needed:
- In a single elimination tournament with $N$ players
- We need $N-1$ wins to determine a champion (each win eliminates one player)
- Each "win" actually takes an expected 1.5 attempts due to ties
Therefore:
$$ E(\text{total games}) = (N-1) \cdot \frac{3}{2} $$
With $N = 8$ billion $ = 8 \times 10^9 $:
$$ E(\text{total games}) = (8 \times 10^9 - 1) \cdot \frac{3}{2} \approx 12 \times 10^9 $$
Q2:
For each required win:
- Each attempt has probability $p = \frac{2}{3}$ of being decisive (non-tie)
- This follows a geometric distribution
- For a geometric distribution: Mean = $\frac{1}{p}$ and Variance = $\frac{1-p}{p^2}$
$$ \text{Variance of single game} = \frac{1-\frac{2}{3}}{(\frac{2}{3})^2} = \frac{\frac{1}{3}}{\frac{4}{9}} = \frac{3}{4} $$
Since we need $(N-1)$ wins, and each win's number of attempts is independent:
- Total variance is the sum of individual variances
- For independent variables, variances add
$$ \text{Total Variance} = (N-1) \cdot \frac{3}{4} $$
With $N = 8 \times 10^9$:
$$ \text{Total Variance} = (8 \times 10^9 - 1) \cdot \frac{3}{4} \approx 6 \times 10^9 $$
I.e. Standard deviation: $\sqrt{6 \times 10^9} \approx 77,460$ games
Q3:
This is where I struggled.
Idea 1: My first guess was to use CLT (Central Limit Theorem) approximation since we're summing many independent random variables (each game sequence), the CLT tells us the total number of games will be approximately normally distributed.
Given:
- Assume $X = 13 \times 10^9$
- Mean ($\mu$) = $12 \times 10^9$ games
- Variance ($\sigma^2$) = $6 \times 10^9$
- Standard deviation ($\sigma$) = $\sqrt{6 \times 10^9} \approx 77,460$
We want $P(X > 13 \times 10^9)$ where $X$ is the total number of games.
To use the standard normal distribution: $$ Z = \frac{X - \mu}{\sigma} $$
$$ Z = \frac{13 \times 10^9 - 12 \times 10^9}{77,460} = \frac{10^9}{77,460} \approx 12,910 $$
$$ P(X > 13 \times 10^9) = P(Z > 12,910) $$
$$ P(Z > 12,910) \approx \frac{\phi(12,910)}{12,910} $$
$$ P(Z > 12,910) \approx \frac{1}{12,910\sqrt{2\pi}} e^{-12,910^2/2} $$
Idea 2: The other way was to try and use a more exact solution.
Doing some research (Why is negative binomial distribution a sum of independent geometric distributions?), I think that the total number of games follows a negative binomial distribution (sum of geometric distributions), as we need $(N-1)$ successes, where $N = 8 \times 10^9$.
For a negative binomial distribution with parameters $r$ (number of successes needed) and $p$ (probability of success):
$$ P(X > x) = P(\text{Gamma}(r, p) > x) $$
Where $\text{Gamma}(r,p)$ is the gamma distribution.
In our case:
- $r = N-1 \approx 8 \times 10^9$ (successes needed)
- $p = \frac{2}{3}$ (probability of non-tie)
- Want $P(X > 13 \times 10^9)$
The probability mass function is:
$$ P(X = k) = \binom{k-1}{r-1}p^r(1-p)^{k-r} $$
Therefore:
$$ P(X > 13 \times 10^9) = \sum_{k=13 \times 10^9 + 1}^{\infty} \binom{k-1}{8 \times 10^9-1}(\frac{2}{3})^{8 \times 10^9}(\frac{1}{3})^{k-8 \times 10^9} $$
However, this sum looks quite complicated and now I think the CLT approximation is better.
For these 3 problems, is my math correct?
