Disc Game Prize Fund
A bag contains one red disc and one blue disc. In a game of chance, the player pays $1 to play and the following procedure is repeated each turn: A red disc is added to the bag. A disc is randomly...
Problem Statement
This archive keeps the full statement, math, and original media on the page.
A bag contains one red disc and one blue disc. In a game of chance a player takes a disc at random and its colour is noted. After each turn the disc is returned to the bag, an extra red disc is added, and another disc is taken at random.
The player pays £1 to play and wins if they have taken more blue discs than red discs at the end of the game.
If the game is played for four turns, the probability of a player winning is exactly \(11/120\), and so the maximum prize fund the banker should allocate for winning in this game would be \(\pounds 10\) before they would expect to incur a loss. Note that any payout will be a whole number of pounds and also includes the original \(\pounds 1\) paid to play the game, so in the example given the player actually wins \(\pounds 9\).
Problem 121: Disc Game Prize Fund
Mathematical Development
Definition 1. Let denote the number of turns. At turn (), the bag contains one blue disc and red discs (the original red disc, plus the previously added red discs, plus the one added at the start of turn ), for a total of discs.
Theorem 1 (Turn probabilities and independence). At turn , and . The outcomes across distinct turns are mutually independent.
Proof. Consider the equivalent probabilistic model. Before turn , one red disc is added to the bag and then one disc is drawn uniformly at random from the discs present. Since the drawn disc is set aside and one new red disc replaces it before the next turn, the bag at each turn is deterministically composed of 1 blue and red discs, regardless of prior history. Consequently, the conditional probability of drawing blue at turn given any history equals , and by the definition of conditional independence, the turn outcomes are mutually independent.
Theorem 2 (Winning probability). The probability that the player wins (draws at least blue discs in turns) is
where
and indexes the set of turns on which red is drawn.
Proof. Let be the set of turns on which blue is drawn, and set . By Theorem 1 and the multiplication rule for independent events,
The common denominator is . The player wins when , equivalently . Summing the numerators over all qualifying yields , and therefore .
Lemma 1 (Elementary symmetric polynomial recurrence). Define to be the -th elementary symmetric polynomial of , i.e., the sum of products of all -element subsets. Then
with boundary conditions and for or . Moreover,
Proof. Partition the -element subsets of by membership of :
- Subsets not containing : these are -element subsets of , contributing .
- Subsets containing : formed by selecting a -element subset of and multiplying by , contributing .
Since each subset of with contributes to , summing for yields .
Theorem 3 (Maximum prize fund). The maximum prize fund is .
Proof. The banker charges MM \cdot P(\text{win}) = MN/(n+1)!MN/(n+1)! \le 1M \le (n+1)!/N\lfloor (n+1)!/N \rfloor\square$
Editorial
At turn k, P(blue) = 1/(k+1), P(red) = k/(k+1). Player wins with >= 8 blue out of 15 turns. Prize = floor((n+1)! / N) where N sums elementary symmetric polynomials.
Pseudocode
dp[0..floor(n/2)] initialized to 0
dp[0] = 1
For i from 1 to n:
For j from min(i, floor(n/2)) down to 1:
dp[j] = dp[j] + i * dp[j-1]
N = sum(dp[0..floor(n/2)])
D = (n+1)!
Return floor(D / N)
Complexity Analysis
- Time: The double loop performs iterations, which is .
- Space: for the one-dimensional DP array, updated in-place by processing the inner index in decreasing order.
Answer
Code
Each problem page includes the exact C++ and Python source files from the local archive.
#include <bits/stdc++.h>
using namespace std;
int main() {
const int n = 15;
const int half = n / 2; // 7
// dp[j] = j-th elementary symmetric polynomial of {1,...,i}
vector<long long> dp(half + 1, 0);
dp[0] = 1;
for (int i = 1; i <= n; i++)
for (int j = min(i, half); j >= 1; j--)
dp[j] += (long long)i * dp[j - 1];
long long N = 0;
for (int j = 0; j <= half; j++)
N += dp[j];
// Compute (n+1)! = 16!
long long fact = 1;
for (int i = 1; i <= n + 1; i++)
fact *= i;
cout << fact / N << endl;
return 0;
}
"""
Problem 121: Disc Game Prize Fund
At turn k, P(blue) = 1/(k+1), P(red) = k/(k+1).
Player wins with >= 8 blue out of 15 turns.
Prize = floor((n+1)! / N) where N sums elementary symmetric polynomials.
"""
from math import factorial
def solve():
n = 15
half = n // 2 # 7
# dp[j] = e(i, j) = j-th elementary symmetric polynomial of {1,...,i}
dp = [0] * (half + 1)
dp[0] = 1
for i in range(1, n + 1):
for j in range(min(i, half), 0, -1):
dp[j] += i * dp[j - 1]
N = sum(dp)
D = factorial(n + 1)
print(D // N)
solve()