When you throw two dice and add the numbers together what number are you most likely to get? What is the smallest number you can get? What is the biggest? Are all numbers equally likely?
We used python to simulate rolling a dice 100 times and plotted the results using pygal. Step by step instructions are here.
A big challenge would be to program the following game on python:
Pig Game
The game of Pig is a two player game played with two six-sided dice. The object of the game is to reach 100 points of more. Play is taken in turns. On each person’s turn that person has the option of either:
- Rolling the dice: where a roll of two to six is added to their score for that turn and the player is given the same choice again; or a roll of 1 loses the player’s total points for that turn and their turn finishes with play passing to the nexxt player.
- Holding: the player’s score for that round is added to their total and becomes safe from the effects of throwing a 1. The player’s turn finishes with play passing to the next player.