Summer Klerance turned in her term assignment for this challenge. Her professor was miffed (but also amused) when he overheard a disgruntled classmate of Summer's saying she got her answers by simulation rather than by the probabilistic methods covered in the course. Summer received a note to see the prof during his next office hours.
"OK, Miss Smarty-Pants*, I'll admit your problem was harder than any of the others I assigned. However, I'm not ready to give you full credit...Have a seat! If we order the goals by increasing difficulty of achievement, which you already, um, "found," we have:
The Prof's New Order:
1 (Any) one complete suit [7.7 hands]
3 (Any) two complete suits [10.0 hands]
2 One given complete suit [11.6 hands]
5 (Any) three complete suits [12.4 hands]
4 Two given complete suits [14.0 hands]
6 Three given complete suits [15.4 hands]
7 The complete deck (all four suits) [16.4 hands]
"I'd like you to modify your program. Keep track of the number of hands needed to see each of the seven goals as you deal, just as before. Let's define one trial as being completed on the hand when you've achieved all seven goals, i.e. a complete deck. The order in which you achieved each of the seven goals during a trial may or may not match the New Order I've shown you. To receive full credit for you term problem, I'd like you to tack a single number onto your output: the percentage of total trials in which the order of goal achievement exactly matches the New Order. And let's change our sample from 1 million deals to 20,000 trials to ensure there is no partial trial at the end."
Output: Same format as the original challenge with two changes: (a) the addition of the new percentage at the end of the output, and (b) a program run of exactly 20,000 trials, instead of the 1 million deals in the previous challenge.
(1) The results for the seven goals should be output in the Old Order (1-7) and not the New Order above. However, the percentage of interest is based on the New Order above, that of strictly increasing difficulty of achievement.
(2) Runs are no longer based on 1 million deals, but rather 20,000 completed trials (roughly 330,000 deals).
(3) A tie resulting from achieving two or more goals on the same deal counts as a Yes, since it (also) fulfills the New Order requirement.
(4) The new number should come at the end of the output and needn't have a % sign.
(5) Show the result of three program runs, as in the original challenge. The data requested for each of the seven goals remains analogous to the original challenge: goal number; average number of hands needed in the 20,000 trials (rounded to one decimal place); minimum number of hands needed; and the maximum number of hands needed. The newly requested percentage should be at the end of the output.
(6) Code golf, so shortest
club code in bytes wins.
*He didn't actually say that, but it was what he was thinking.