Dice toss simulator

I got a question on Facebook about probability when rolling dice. It was my friend son who had this in his home task.


The case was as follow:
To test if the calculation was correct, I made a simulation in JavaScript. To get statistically significant data I found that I had to run 2000 tosses. To be able to follow the progress I am using the 'setInterval()' set to run every 20 milliseconds.
It confirmed the theory.

Equal Equal and 1

# dice tosses:

equal:

equal AND one:




Back to homepage!