In a certain state’s lottery, \(64\) balls numbered 1 through \(64\) are placed in a machine and six of them are drawn at random. If the six numbers drawn match the numbers that a player had chosen, the player wins jackpot $1,000,000. If numbers drawn match any 5 of the numbers that a player had chosen, the player wins $1,000. It costs $1 to buy a ticket. Find the expected value.
Over time the jackpot will increase if no one wins. How large would the jackpot have to be for the expected value of playing the lottery to be positive? (In this case, would you still buy a lottery ticket?)
Expected value formula:
We got the expected value from the definition given, which is the sum of the probabilities multiplied by their respective values.
To compute this:
For the Jackpot, the total number of possibilities for the balls is choose(64,6). We only care about the 6 numbers, not the order in them. Thus, we need to use a combination to pick 6 balls out of the total 64. To win the jackpot, there is only one combination out of all of the possibilities. This means that the probability to win the jackpot is 1/choose(64,6).
In other words, the probability of the jackpot is one way that you can chose 6 numbers from 64 numbers. (We figured out that we should use choose function from the definition that we need ANY six numbers.)
The value of the lottery is 1000000 - the 1 dollar you paid for the ticket
To get the $1000 award, we know that 5 out of the 6 numbers must match. We don’t care about the order, so there are choose(6,5) ways to do this. The last number must be a losing number, and we know that there are 64-6=58 losing numbers. Thus, we have choose(58,1). The total number of ways to get the $1000 prize must therefore be choose(6,5)*choose(58,1), and we divide this by the total ways choose(64,6) to get the probability of winning the $1000 prize. The value of the $1000 prize is 1000- the 1 dollar that you paid for the ticket.
The probability of losing is the complement of the probabilities of winning, making it p_lose=1-p_jackpot-p_1000.
p_jackpot = 1/choose(64,6)
v_jackpot = 1000000-1
p_1000 = choose(6,5) * choose(58,1)/choose(64,6)
v_1000 = 1000-1
p_lose = 1-p_jackpot-p_1000
v_lose = -1
p_jackpot*v_jackpot + p_1000*v_1000 + p_lose*v_lose
## [1] -0.9820205
Because the expected value is negative (-$0.98), it means that the lottery is not in your favor most of the time, meaning that it is not wise to buy a ticket
To find the value of the jackpot where the expected value becomes positive, we must have a variable x for the jackpot value and an inequality. Using the expected value formula, we have \((x-1)*p_{jackpot}+v_{1000}*p_{1000}+v_{lose}*p_{lose} > 0\).
Solving this gives \(x>74626368\). Thus, the value at which the expected value is 0 is 74626368.
Another way you can find the value of the jackpot where the expected value becomes positive, we can use the code in r
p_jackpot = 1/choose(64,6)
v_jackpot = 74626368-1
p_1000 = choose(6,5) * choose(58,1)/choose(64,6)
v_1000 = 1000-1
p_lose = 1-p_jackpot-p_1000
v_lose = -1
p_jackpot*v_jackpot+p_1000*v_1000+p_lose*v_lose
## [1] 0
74626368
f = function(x) {
(x-1)*p_jackpot + v_1000*p_1000 + v_lose* p_lose
}
f(10^6)
## [1] -0.9820205
# solve f(x)=0
result <- uniroot(f, interval = c(10^6, 10^9))
result
## $root
## [1] 74626368
##
## $f.root
## [1] 0
##
## $iter
## [1] 1
##
## $init.it
## [1] NA
##
## $estim.prec
## [1] 925373632
Doing the computations, tells us that the jackpot value must be greater than $74,626,368 in order for the expected value to be positive. Only then is when buying a ticket is worth it to the buyer.