Coupon collector is a classic statisticsproblem with many practical applications. The problem is to repeatedly pickobjects from a set of objects and find out how many picks are needed for all theobjects to be picked at least once. A variation of the problem is to pick cards froma shuffled deck of 52 cards repeatedly, and find out how many picks are neededbefore you see one of each suit. Assume a picked card is placed back in the deck before picking another. Write a program to simulate the number of picks neededto get four cards from each suit and display the four cards picked (it is possible acard may be picked twice). Here is a sample run of the program: Queen of Spades5 of ClubsQueen of Hearts4 of DiamondsNumber of picks: 12
Coupon collector is a classic statistics
problem with many practical applications. The problem is to repeatedly pick
objects from a set of objects and find out how many picks are needed for all the
objects to be picked at least once. A variation of the problem is to pick cards from
a shuffled deck of 52 cards repeatedly, and find out how many picks are needed
before you see one of each suit. Assume a picked card is placed back in the deck before picking another. Write a
to get four cards from each suit and display the four cards picked (it is possible a
card may be picked twice). Here is a sample run of the program:
Queen of Spades
5 of Clubs
Queen of Hearts
4 of Diamonds
Number of picks: 12
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images