Do you need to keep all the counts in memory at the same time?

If you don't, you can repeat the experiment for each possible outcome, printing out the results for one possible outcome as soon as...