Dice simulation

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:

  1. 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.
  2. 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.

 

Medal Muddle

medal

We really enjoyed working on the following puzzle from Nrich.

Thirteen nations competed in a sports tournament. Unfortunately, we do not have the final medal table, but we have the following pieces of information:

1. Turkey and Mexico both finished above Italy and New Zealand.

2. Portugal finished above Venezuela, Mexico, Spain and Romania.

3. Romania finished below Algeria, Greece, Spain and Serbia.

4. Serbia finished above Turkey and Portugal, both of whom finished below Algeria and Russia.

5. Russia finished above France and Algeria.

6. Algeria finished below France but above Serbia and Spain.

7. Italy finished below Greece and Venezuela, but above New Zealand.

8. Venezuela finished above New Zealand but below Greece.

9. Greece finished below Turkey, who came below France.

10. Portugal finished below Greece and France.

11. France finished above Serbia, who came above Mexico.

12. Venezuela finished below Mexico, and New Zealand came above Spain.

We came up with different strategies to sort out the medal table, and we were largely successful eventually, but we were all impressed by a quick way to solve it!

 

Humble-Nishiyama Randomness Game

cards

We played a two player strategy game today, using all the information from +plus magazine.

The game is played as follows. At the start of a game each player decides on their three colour sequence for the whole game. The cards are then turned over one at a time and placed in a line, until one of the chosen triples appears. The winning player takes the upturned cards, having won that “trick”. The game continues with the rest of the unused cards, with players collecting tricks as their triples come up, until all the cards in the pack have been used. The winner of the game is the player that has won the most tricks. An average game will consist of around 7 “tricks”.

e.g. Player 1 picks RRB, Player 2 picks RBB and see who wins.

The question we thought about was:

  • Is it just a game of chance, or if you are choosing second, could you improve your chance of winning?

There is a related game called Penny’s game, using Heads and Tails of a coin toss instead of playing cards. In this version, you just play until one person has won a “trick”. We worked out some of the odds given in the first table in this article.

We ended up having to sum a geometric series! Great fun!