Here are the answers to Question Set 2 on the Rockets page:

- Since there are 15 candies and each candy can be one of 6 colours, the total number of arrangements of candies in a roll is 6
^{15}. The total number of arrangements of candies that do not contain white is 5^{15}. So, the probability that there are no white candies is 5^{15}⁄6^{15}≅ 0.0649 or around 6.5%. - From the previous question, the probability that a roll doesn't contain a white candy is (5⁄6)
^{15}. So, the probability that a roll doesn't contain a pink candy is also 5⁄6^{15}, the probability that a roll doesn't contain an orange candy is also (5⁄6)^{15}, and so on. So, that suggests multiplying (5⁄6)^{15}by 6.6((5⁄6)

^{15}) isn't the final answer though. When we add the number of possibilities that don't contain white to the number of possibilities that don't contain pink, the possibilities that contain neither white nor pink have been double-counted. How many of them are there?The probability that a roll will not contain any two specific colours (say, white and pink) is (4⁄6)

^{15}= (2⁄3)^{15}. There are 6 C 2 = 15 combinations of two different colours. However, just as 6((5⁄6)^{15}) isn't the answer for one missing colour, (6 C 2)(2⁄3)^{15}is not the answer for two colours, because possibilities missing three colours are double-counted.Similarly, once we find the number of possibilities where three colours are missing, we'll have to subtract the number of possibilities where four colours are missing, and to find the number of possibilities where four colours are missing, we'll have to find the number of possibilities where five colours are missing. Once we get to the bottom of this and reconstruct the answer, we get (and be sure to be very careful with the signs, there is a quadruple negative here):

(6 C 1)(5⁄6)^{15}− (6 C 2)(4⁄6)^{15}+ (6 C 3)(3⁄6)^{15}− (6 C 4)(2⁄6)^{15}+ (6 C 5)(1⁄6)^{15}

≅ 0.35558Thinking recursively can help in solving this problem. It can also help to try a smaller case, say with four candies in a roll and four colours, and apply your answer to the larger case.

- Here's a short program written in Perl that accomplishes this. Note that writing the program quickly, not speed, was the main consideration here:
#!/usr/bin/perl -wl $trials = 10000000; $success = 0; for ($i = 0; $i < $trials; $i++) { @colours = (0, 0, 0, 0, 0, 0); # Nothing in roll yet. for ($j = 0; $j < 15; $j++) { $colours[int(rand(6))] = 1 # Note that we've found specified colour. } # If one of the colours is 0, multiplying all of them together will # result in 0, If that's the case, increment number of successes. $success++ unless $colours[0] * $colours[1] * $colours[2] * $colours[3] * $colours[4] * $colours[5]; } print $success/$trials;

- Your results may vary. I found 10 rolls missing at least one colour (including one missing two colours) out of 26, or 38.5%. This isn't too far off from the answer to question 2. The small sample size may explain the difference. If you try this with a very large number of rolls and your number is still off, it may mean that our assumptions (i.e. that the candy is packaged randomly and each piece is independent of any other) may be wrong.