Sum of Dice Throws

For an exercise, I have done a notebook about sums of dice throws.

sum

By the central limit theorem, the normalized sums of a large number of dice throws are almost normal distributed. We can see this effect in the image above with only 6 throws.

The notebook first simulates m throws. Then it generates all possible throws and counts the number of times a specific sum occurs. This is an interesting algorithm, which can be used to count other events. It does also use the new feature with global variables (though this could have been avoided).

Finally, we demonstrate a quick way to get the correct frequencies for any number of dice throws.

 

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.