## Interview Question

Product Manager Interview

-

# What's the probability of pulling four of a kind from a deck of cards in five tries.

11

It has been a long time since I last studied this, so I would welcome any corrections. I think Shrenik's last paragraph isn't totally accurate. I think the answer is: 1 - (1 - 3/51 * 2/50 * 1/49)^5 While Shrenik is right that the odds at each attempt are independent of the previous attempt, the overall odds do improve if you know in advance there will be many attempts. An easier example to explain is: what are the odds that you will get a '6' at least once when tossing a die 5 times. The answer is NOT 1/6. The answer is also not 5/6. It's one minus the chance that in 5 consecutive attempts you will NOT get a '6': 1 - ( 1 - 1/6 )^5. The more attempts you know you'll have, the closer you get to 1, but you're never 100% guaranteed.

jjzzjj on

4

Here's how Im thinking about it- Since you are given 5 tries, any of the following possibilities counts as success: 1) 1,2,3,4 are the same, 5 is different. Probability = 1*(3/51)*(2/50)*(1*49) 2) 1,3,4,5 are the same, 2 is different Probability = 1*(48/51)*(3/50)*(2/49)*(1/48) 3) 1,2, 4,5 are the same, 3 is different Probability = 1*(3/51)*(48/50)*(2/49)*(3/48) 4) 1,2,3,5 are the same, 4 is different Probability = 1*(3/51)*(2/50)*(48/49)*(1/48) 5.) 2,3,4,5 are the same, 1 is different Probability = 1*1*(3/50)*(2/49)*(1/48) The final probability is the same of all these individual probabilites.

acg on

3

The answer is 0.0240%, which is the probability of drawing "4 of a kind" in 5-card poker. See: http://en.wikipedia.org/wiki/Poker_probability

CL Khoo on

0

we need to pick 5 cards out of 52 cards (52 choose 5). out of this there are 48 options that are good for us (4 the same + 1 different). This should be multiplied by 13, since we don't care which card we pull 4 times: (48/(52 choose 5))*13

Limor on

0

First, to simplify it, one needs to find the probability to get the same type of 4 cards (e.g. 4 kings) in one attempt: There are (52 choose 4) options to draw 4 cards, and there are 13 options in which one can draw the same 4 cards (e.g. four jacks). Therefore, the prob to choose the same 4 cards in one attempt is: 13/(52 choose 4). Now, let's set x = 13/(52 choose 4). To get 4 cards from the same kind in 5 attempts , we can calculate what's the probability to fail to do that in 5 attempts(p(1-x)^5 and then subtract it from 1. That's the probability to get at least four cards from the same kind in 5 attempts.

Shai on

0

I agree with the 1+ 3/51 + 2/50 + 1/49 number for the probability for 1 attempt. I think the answer to the question "What's the probability of pulling four of a kind from a deck of cards in five tries" is this. =================================== There are 5 ways to pull one 4 of a kind in 5 tries. Assuming that the 1 time probability is x, then the answer is to add the probability of all the 5 ways. 1) Pull it in 1st attempt = x 2) Pull it in 2nd attempt = (1-x) * x ...5) Pull it in the 5th attempt = (1-x)^4 * x What do you think about this solution?

Prashanth on

0

Folks, the answer is a lot simpler than you're making it out to be. In five cards there are at least two that are different. Without loss of generality assume these are an ace and a king. Therefore, there are two ways to make four of a kind: the other three cards are aces, or the other three cards are kings. Because there are 50 cards remaining in the deck, the probability of drawing 3 aces is the same as the probability of NOT drawing any other cards three times, which is 1-(47/50)*(47/49)*(47/48), or approximately 0.117. The probability of drawing either 3 aces or 3 kings is approximately twice that. (The reason it's not EXACTLY twice that is that the "3 aces" good outcome is actually listed as a "bad outcome" when you're looking for 3 kings, and vice versa. This is why 2 x 0.117 is a little less than the 0.0240% posted by CL Khoo.)

Chris on

0

First card: 1 - can be any card Second card: 3/51 Third card: 2/50 Fourth card: 1/49 You only have to use the 5th try if by 4th you don't have 4 of a kind. So 5th try means there is still 1 left in 48 card so 1/48

Kym on

0

I made it part way through (odds of pulling 4 of a kind is 1/(52*51*50*49) in four tries), but that's as far as I got on the spot. In any case, I felt that it was well beyond what's in scope for a Product Manager to be able to derive.

Anonymous on

1

The odds for a single try are as follows: * Pull any random card and its odds are 1 * For the 2nd card to be same as the first, the odds are 3/51 * Similarly 3rd card has odds 2/50 * 4th card - 1/49 So the total odds of pulling 4 of a kind in one try is: 1 * 3/51 * 2/50 * 1/49. As for the number of tries, it doesn't matter - the odds remain the same. For example, the odds of pulling an Ace of Spades is 1/52. Whether you attempt it 52 times or 1 million times, at every attempt the odds will remain the same. If the question would ask, how many times would you pull an Ace of Spades if you tried 52 times, the speculative answer is at least once - but its not definitive since in practice you might not be able to pull it even after 100 attempts. The answer only becomes definitive if you have infinitely large number of attempts.

Shrenik on