Secret Santa

santa

The rules of a secret santa are that each person’s name is put in a hat and the names are mixed. Then each person must choose 1 name from the hat. If you choose your own name, you must put it back in the hat.

If 2 people do a secret santa there is only one solution: Person A gives to person B and person B gives to person A.

Stage 1: With 3 people, there are 2 possible ways. Can you think why?

Stage 2: Now how many different ways are there with 4 people?

The final challenge is to find the number of different scenarios with 5 people.

Solutions can be found here.

Galton’s Board

galton board

This week we looked at an online simulation of the Galton board (or Bean Machine), which is a device where beads are dropped from a funnel at the top through ranks of nails.
Each time a bead strikes a nail it has a 50% chance to veer left and a 50% chance to veer right.

Each bead eventually drops in one of the column A, B, C, D or E.

1. Do you think the probabilities for a bead to land in A,B,C,D or E are equal ?
2. If not which column has the highest probability ?
3. Can you do a computer simulation of 10,000 beads dropping in a Galton
board using scratch or Python ?

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.