## Pregunta de entrevista

Entrevista de Data Scientist

-Menlo Park, CA

Meta## Consider a game with 2 players, A and B. Player A has 8 stones, player B has 6. Game proceeds as follows. First, A rolls a fair 6-sided die, and the number on the die determines how many stones A takes over from B. Next, B rolls the same die, and the exact same thing happens in reverse. This concludes the round. Whoever has more stones at the end of the round wins and the game is over. If players end up with equal # of stones at the end of the round, it is a tie and another round ensues. What is the probability that B wins in 1, 2, ..., n rounds?

## Respuestas de entrevistas

16 respuestas

Because at the beginning time, A has 8 and B has 6, so let A:x and B:y, then A:8+x-y and B:6-x+y; so there are 10/36 prob of B wins. And A wins prob is 21/36 and the equal prob for next round is 5/36. So for B wins at round prob is 10/36. And if they are equal and to have another round, the number has changed to 7 and 7. So A:7+x-y and B:7-x+y, so this time B wins has prob 15/36 and A wins has prob 15/36. And the equal to have another round is 6/36=1/6. So overall B wins in 2 rounds has prob 5/36*15/36. And for round 3,4,...etc, since after each equal round, the number will go back to 7 and 7 so the prob will not change. So B wins in round 3,4,...n has prob 5/36*(6/36)^(r-2)*15/36. r means the number of the total rounds.

I think this depends after the equal roll the number becomes 7 and 7 en

So many answers...Here's my version: For round1, B win only if it gets 3 or more stones than A, which is (A,B) = (1,4) (1,5) (1, 6) (2, 5) (2,6) (3,6) which is 6 cases out of all 36 probabilities. So B has 1/6 chance to win. To draw, B needs to get exactly 2 stones more than A, which is (A, B) = (1,3) (2,4) (3,5) (4,6) or 1/9. Entering the second round, all stones should be equal, so the chance to draw become 1/6, and the chance for either to win is 5/12. So the final answer is (1/6, 1/9*5/12, (1/9)^2*5/12, .....(1/9)^(n-1)*5/12) )

Anónimo en

I don't get it. Shouldn't prob of B winning given it's tie at 1st round be 15/36? given it's tie at 1st round, at the 2nd round Nb > Na can happen if (B,A) is (2,1), (3,1/2),(4,1/2/3), (5,1/2/3/4),(6,1/2/3/4/5), which totals 15 out of 36.

jane en

On the first round, B can win if (A,B) rolls: (1,4) , (1,5) , (1,6) , (2,5) , (2,6) , (3,6) - so there are 6 out of 36 possibilities where B wins. P(B1) [read, probability that B wins in round 1] = 1/6 On the first round, B can tie if (A,B) rolls: (1,3) , (2,4) , (3,5) , (4,6) - so there are 4 out of 36 possibilites where B ties. If B ties with A, there is a second round, where B wins with probability 15/36, A wins with probability 15/36 = 5/12, and they tie with probability 6/36. So P(B2) = 1/9 * (5/12) After the second round, the game only continues if both players have equal number of points, and the probability of a tie in each game is 1/6, so P(B3) = (1/9)*(1/6)*(5/12) Generally, P(Bn) = (1/9)*(1/6)^(n-2)*(5/12)

anonymous en

Build a 6x6 table of possible rolls and outcomes. For round 1: 5 result in a tie -> P(tie) = 5/36 21 result in A winning -> P(Awins) = 21/36 10 result in B winning -> P(Bwins) = 10/36 For round 2: (which can only start if they are tied with 7 stones each) 6 result in a tie -> P(tie) = 6/36 15 result in A winning -> P(Awins) = 15/36 15 result in B winning -> P(Bwins) = 15/36 To generalize the formula for B wins in n rounds: P(BinfirstRound) = (5/36) P(BinNrounds; N>1) = (5/36)*(1/6)^(n-2)*15/36

SAR662 en

B wins only: if A throws 4 and B throws 6. if A throws 3 and B throws 5 or 6. if A throws 2 and B throws 4, 5 or 6. if A throws 1 and B throws 3,4, 5 or 6. Hence, B wins 10/36. Also the chance of tie is 5/36 ( all events there is one possibility of tie except when A throws 6). B has to throw one greater than A. After the first throw there are only 14 (hence 7 each). Now the chances of tie are when A and B throw the same. Which means 6/36. But probability of A and B winning are the same hence that would be 15/36.

cryptic en

For B to Win 6 - Na + Nb > 8 +Na - Nb or, Nb - Na > 1 which can happen if (B,A) is (3,1),(4,1),(4,2),(5,1),(5,2),(5,3),(6,1),(6,2),(6,3),(6,4) Hence prob of B winning is = 10/36 = 5/18 For any round to ensue, the prior round has to end in a draw, or 6 - Na + Nb = 8 +Na - Nb or, Nb - Na = 1, for which prob = 5/36 Once equal, B's prob of winning is if total stones with B > total stones with A or 13/36 possibility of another draw = 1/6 For B to win in nth round, prob = 5/36x1/6^(n-2)x13/36

Ronie en

I am getting a bit different result. In first round A player (8 stones) has 6 certain ways to win where the sum of both dices is (5,4 or -4,-5 when B draws). Since there is 36 ways in total, i took that 50% of those can be a tie. So, P of winning for A player in first round is: (6+15)/36=21/36. What am I missing?

Anónimo en

Let x be what A rolls and y be what b rolls B wins in first round if: 6+y-x > 8+x-y 2y > 2 + 2x Or y > 1 + x Possible scenarios: (1,3) (1 ,4) (1,5) (1,6) (2,4) (2,5) (2,6) (3, 5) (3,6) (4,6) Probability(B wins in 1st round) = 10/36 The game draws in first round if : y = 1+x (1,2) (2,3) (3,4) (4,5) (5,6) Probability (draws in 1st round) = 5/36 Probabilty (draw in 2nd round ) = 6/36 Now with equal stones, probability of B winning all events where y > x 5+4+3+2+1 = 15 P(b wins in R2) = 15/36 Total probability that B wins the game = 10/36 + (5/36) * (6/36)*n-3 * 15/36

Anónimo en

Bi - player B wins the ith round Ti - round i is a Tie = player A got m, player B got n We want to find the probability: P(T1, T2, ..., Ti-1, Bi) # ( , ) means AND = P(Bi | T1, ..., Ti-1)*P(T1)*...*P(Ti-1)= (P()+,,, +P())*(4/6*1/6)*(1/6)*...*(1/6) #(...) = i-2 times # P()+,,, +P() here we sum all the probabilities where player B wins #(4/6*1/6) getting Tie at the first round # (1/6)*...*(1/6) here we multiply i-2 cases were we got tie after a tie

hussam ismael en

This is a poorly worded question. Probability of the game being over in Round 1 is 10/36. Do they continue playing after round 1 ? However, if the game has to go one, the probability is 15/36 (difference between A and B is equal and greater than 1). The game will keep going only if it is 7-7, the probability of 7-7 after round 1 is 6/36. How can B win in so many rounds ? Should it not be over the moment B wins a round and has more stones ? What am I missing ?

Aspirer en

Depending on what A rolls (1-6), and then what B rolls (1-6), you are given 36 different possibilites: and then you can make a web out of that to see in what scenarios B will win in round 1. B has a 10/36 chances to win in round 1: (A rolls 1 and B rolls above 4) + (A rolls 2 and B rolls above 3) + ... A has a 21/36 chance to win in round 2 using the same idea and they will tie with 5/36 chances. If they tie, then the game goes to round 2 with A and B having the same number of chips, and so after that it'll be 1/2 chances.

Anónimo en

Mistake, P for A player to win in first round might be: (6+10)/36 based on 6 ways to win for sure, 10 to tie, 10 to lose and 10 to win from the 36-6 ways left.

Anónimo en

For B to Win 6 - Na + Nb > 8 +Na - Nb or, Nb - Na > 1 which can happen if (B,A) is (3,1),(4,1),(4,2),(5,1),(5,2),(5,3),(6,1),(6,2),(6,3),(6,4) Hence prob of B winning is = 10/36 = 5/18 For any round to ensue, the prior round has to end in a draw, or 6 - Na + Nb = 8 +Na - Nb or, Nb - Na = 1, for which prob = 4/36 = 1/9 Once equal, B's prob of winning is if total stones with B > total stones with A or 13/36 possibility of another draw = 1/6 For B to win in nth round, prob = 1/9x1/6^(n-2)x13/36

Ronie en

I got [1/6, 15/36, 15/36, 15/36, ...]

Rob en

Key is to define the problem correctly. Let Na be the # player A rolls, and Nb be the number player B rolls. Then at the end of the first round A will have (8 + Na - Nb) and B will have (6 - Na + Nb) stones. So all you need is to compute Pr{6 - Na + Nb > 8 + Na - Nb} for round 1 victory. Subsequent rounds are even easier since all subsequent rounds can only start when the stone count is equal.

Anónimo en