[Probability] There's a game where you are given two fair six-sided dice and asked to roll. If the sum of the values on the dice equals seven, then you win $21. However, you must pay $5 to play each time you roll both dice. Do you play this game? And in follow-up: What is the probability of making money from this game?

Data Science Interview QuestionsCategory: Data Science[Probability] There's a game where you are given two fair six-sided dice and asked to roll. If the sum of the values on the dice equals seven, then you win $21. However, you must pay $5 to play each time you roll both dice. Do you play this game? And in follow-up: What is the probability of making money from this game?
4 Answers
MockInterview Staff answered 4 years ago

In terms of the follow-up question, it’s unclear what interval we’re considering. If we’re interested in a single trial, then the probability of making money is 1/6. Let’s say that we’re willing to play the game 4 times. If we win at least once within 4 trials we’ll win money (losing 3 times results in a loss of $15 and winning 1 time results in a gain of $16). So, let’s reframe this as the probability of getting at least 1 success in 4 trials. We can treat this as binomial problem. If N is the number of trials, X is the number of successes, and P is the probability of success, then (N choose X) * P ^ X * (1 – P) ^ (N – X) will give us the probability of getting exactly 1 success in 4 trials. However, we want the probability of at least 1 success. The probability of at least 1 success in 4 trials = 1 – the probability of no successes in 4 trials. So, we can use 1 – ( (4 choose 0) * (1/6)^0 * (5/6)^4), which equals ~ .52.
Source


[Content Sponsor #1] Start learning through a free trial on Datacamp!
[Content Sponsor #2] $750 discount on any springboard courses including Data Science Career Track which comes with a Job Guarantee!

Michael Grant answered 3 years ago

The answer I came up with for the first part is finding the expected number of trials for the first success. This is a geometric distribution (or first success depending on the textbook you are reading). Then E[X] is 1/p and since p = 1/6, the E[X] until the first success (or win) would be 6. Therefore you should not play this game. 


[Content Sponsor #1] Start learning through a free trial on Datacamp!
[Content Sponsor #2] $750 discount on any springboard courses including Data Science Career Track which comes with a Job Guarantee!

Gaurav Dharra answered 2 years ago

Probability of getting a sum of 7 = p = 1/6
Expected no. of failures before 1st success = 1 – p / p = 5
Therefore, he is expected to fail 5 times and win the 6th time. Total investment in 6 trials = 6 x $5 = $30. Total earning = 21$
Considering the above computation, you should not play the game.


[Content Sponsor #1] Start learning through a free trial on Datacamp!
[Content Sponsor #2] $750 discount on any springboard courses including Data Science Career Track which comes with a Job Guarantee!

Amol Kelkar answered 2 years ago

First part:
In each trial, we lose $5 and gain expected amount $21 * 1/6 = $3.5, i.e. a net expected loss of $1.5 per trial. So I would not play this game.
 
Second part:
At what probability of favorable outcomes would we stop losing money?
-5 + 21p >=0
solving for p, we get p >= 0.238.
Consider actual binomial distribution B(n, 1/6) with expected value n/6 and variance n(1/6)(5/6). For a large n, this can be approximated as a normal distribution N(n/6, n(1/6)(5/6)), e.g. N(16.66, 13.88) for n=100. We want to know the probability that this distribution has value > 0.238. This is same as value > (0.238 – n/6)/(n(1/6)(5/6)) = 0.51 in N(0,1), i.e. a standard normal distribution. Looking up value 0.51 in a CDF table for N(0,1), we get 0.695. i.e. probability 0.695 that value < 0.51. We want probability for value > 0.51, which would be 1-0.695=0.305.
Thus, the chance of winning in this game is 30.5%


[Content Sponsor #1] Start learning through a free trial on Datacamp!
[Content Sponsor #2] $750 discount on any springboard courses including Data Science Career Track which comes with a Job Guarantee!

Your Answer

17 + 18 =

Data Science Career Bootcamp