- This program simulates the following experiment n times: A die is rolled. If an odd number turns up, an amount equal to that number is won; if an even number turns up, an amount equal to that number is lost. The program displays the frequency and the relative frequency with which each outcome occurs, as well as displaying the average gain over the n trials.


The source.