KEY NOT FOUND: coverImgAlt
Logo
See All Photos
Best Places to Work 2022

Meta

Engaged Employer

Meta

Add an Interview

Interview Question

Data Scientist Interview

-Menlo Park, CA

Meta

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?

AnswerAdd Tags

Interview Answers

7 Answers

24

In order to win $21, you need to come up with (1,6), (2,5), (3,4), (4,3), (5,2), (6,1) on two dice. There are 6*6=36 possible outcomes, so the chance of wining in 6/36=1/6, in which case you actually earn 21-5=$16. The chance of loosing is of course 5/6 and you earn -$5. So, your expected earning is: 1/6*16 + 5/6*(-5) = -1.5 So, you are expected to loose money in average!

Hadi on

9

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.

John on

3

This can be treated as a binomial problem. Each time throwing 2 dices is one trial, and the chance of sum=7 is 1/6. X ~ B(n,p), where p=P(sum=7)=1/6. Suppose there were n trials and x wins, to make money 21*x>5n, i.e. x>5n/21. Let m be the smallest integer greater than 5n/21. P(making money) = sum of ( (n choose i) * p**i * (1-p)**(n-i)) over i=m to n

mary on

2

For the follow up questions, as mentioned above, in order to make money from the game you would need to win in with 4 or less rolls. So we need to calculate the probability of winning in 4 or less rolls. Or we can find probability of losing first and we can subtract it from 1. Since the sum of their probabilities must equal 1. Probability of losing in 1 rolls is 5/6, Probability of losing in 4 rolls is (5/6)^4 = 0.48 Probability of winning = 1-0.48=0.52

Medine on

1

For the second question with a series of n try say you win m times (lose n-m times). To be an overall winner you need m * 16$ - (n-m) * 5$ >0 -> 21m$> 5n$ -> m> 5/21* n for a series of 21 double dice throws you need at least 5 {6,6} double to win binomial says the probability of k wins in n tries (n,k)p^k*(1-p)^(n-k) in our case, p =1/6 and we should sum over all k's where k> 5/21n sum((n,k)(1/6)^k*(5/6)^(n-k), k , ceil(5n/21),n) for say n = 21; k starts from 5 and we will get ~0.26495. 21% chance to win for n goes inf this goes 0

Anonymous on

0

probability of winning = 1/6 probability of losing = 5/6 min sample games = 60 as np>=10 and n(1-p)>=10 is satisfied 60 trials => cost => $5 * 60 = $300 to play Expected number of wins = 10 wins => earn => $21 * 10 = $210 Expected losses = 50 losses => earn => $0 Losses = $300-$210 = $90 for playing 60 games

Anonymous on

0

For the follow up questions, it depends on how many times you play the game. If you played it for infinite times, then you need to calculate the limit of (4n choose n) * (1/6)^n * (5/6) ^ 3n when n approximates infinite

Anonymous on

Add Answers or Comments

To comment on this, Sign In or Sign Up.

Meta Careers

Cover image for Meta

Meta builds technologies that help people connect, find communities, and grow businesses. When Facebook launched in 2004, it changed the...More

  • Our Mission
  • Diversity & Inclusion
  • Meta Careers
  • Our Principles
This is the employer's chance to tell you why you should work for them. The information provided is from their perspective.