Source : https://www.hackerrank.com/challenges/s10-mcq-5
Objective
In this challenge, we're getting started with combinations and permutations. Check out the Tutorial tab for learning materials!
Task
You draw cards from a standard -card deck without replacing them. What is the probability that both cards are of the same suit?
Source : https://www.hackerrank.com/challenges/s10-mcq-5
Solution
github.com/RodneyShag | |
Answer: 12/51 | |
There are 13 of each suit in a deck. | |
We can view this as 2 separate events. First we draw 1 card and see what suit it is. | |
Whatever suit it is, there are 12 of the same matching suit remaining in the 51-card deck. | |
Therefore, when we draw the 2nd card, there is a 12/51 chance that it is the same suit. |
No comments:
Post a Comment