Each ticket in a lottery contain a single "hidden" number according to the following scheme: 55% of the tickets contain a 1, 35% contain a 2, and 10% contain a 3. A participant in the lottery wins a prize by obtaining all three numbers 1,2 and 3. Can you please help me to describe an experiment that could be used to determine how many tickets you would expect to buy to win a prize? Thank you!!
-
short of buying them all, you'll never be 100% guaranteed, but you can get arbitrarily close. – Oct 18 '15 at 14:16
-
This shall be closed as Duplicate of https://math.stackexchange.com/q/817605 – Apr 20 '23 at 07:24
4 Answers
You said "describe an experiment", which makes it technically not a math problem, but a programming exercise. This is a short Python program that simply simulates the experiment $n$ times:
import random as rnd
import numpy as np
n = 10000000
outcomes = np.zeros(n)
for exp in range(n):
counter = 0
numbers = [False, False, False]
while False in numbers:
choice = rnd.random()
if (choice < 0.55):
numbers[0] = True
elif (choice < 0.90):
numbers[1] = True
else:
numbers[2] = True
counter += 1
outcomes[exp] = counter
print 'mean: ',np.mean(outcomes)
For a large number of $n$ the Law of Large Numbers stipulates that the simulated value comes close to the true expected value. It's around 10.8 lottery tickets.
If you want to calculate the true value you'll have to solve an infinite sum. For every possible outcome (number of tickets $n \epsilon [3;\infty)$), calculate its probability, multiply with $n$ and sum them up: $$ E(X) = \sum_{n=3}^{\infty}n P(X=n) $$ where $P(X=n)$ is the probability that the player wins with $n$ many tickets bought (assuming the player stops when he has one of each number).
For example $n=3$ can only happen if the player buys exactly one 1-ticket, one 2-ticket and one 3-ticket and this can happen in six ways (123, 132, 213, 231, 312, 321 or $3!$). Thus $P(X=3) = 6\cdot0.55\cdot0.35\cdot0.10$.
This gets complicated very fast. For $n=4$, you have three distinct sets of possibilities: the first with two 1-tickets, the second with two 2-tickets and the third with two 3-tickets. Each of the sets has $4!/2!=6$ many possibilities, but you cannot combine them because their probabilities are not equal. So $P(X=4) = 6\cdot0.55^2\cdot0.35\cdot0.10 + 6\cdot0.55\cdot0.35^2\cdot0.10 + 6\cdot0.55\cdot0.35\cdot0.10^2$
But for $n=5$ you'd have more distinct sets with the features (leaving out the required tickets to have one of each): three 1-tickets, three 2-tickets, three 3-tickets, two 1-tickets and two 2-tickets, two 2-tickets and two 3-tickets and two 1-tickets and two 3-ticket, each of which has sub-possibilities (calculated with $5!/3!$ and $5!/(2!~2!)$) and its own probability.
I don't know how to write that as a sum, let alone how to solve it, but maybe it helps you.
- 185
The formula for the expected number of tickets to be bought is given in that wiki page itself:
\begin{align*} E(T)&=\int_0^\infty \big(1-\prod_{i=1}^3(1-e^{-p_it})\big)dt \\ p_1 &= \frac{55}{100}\\ p_2 &= \frac{35}{100}\\ p_3 &= \frac{10}{100}\\ \end{align*}
Computing that gives $E(T) = \dfrac{32443}{3003}\approx 10.80353$, which is close to stefan's simulation.
- 4,988
If we ignored luck factor, then it's a simple logical question. Assume you have 100 tickets in a box. As per the question 10 tickets with C, 35 tickets with B, 55 tickets with A. If you are lucky, you can win the lottery in first 3 tickets, else you need to buy 91 tickets.
Explanation
To be on safe side, you need to assume maximum conditions as the first 55 tickets you bought are of A, next 35 tickets you bought are of B. Then remaining 10 tickets must be of C. So pick 1 ticket in the remaining. $55+35+1=91$
- 11
Here is an isomorphic problem, called coupon collector's problem, the setting in this one and your question are almost the same.
If you want to calculate the expected number of lotteries to be bought to get all numbers then find the conditional expectations, condition on the result of first ticket being 1,2 and 3, then use law of total expectation to calculate the unconditional expectation.