Investigating Dice Games

Dice

Normal dice have 6 sides showing numbers 1 to 6.
It's also possible to make other dice, with 4 or 8 sides (or other numbers).


Dice are used in various games to produce random numbers.
There are a number of gambling games based on dice.
We will investigate some games that we have made up.

Odds and Payoffs

Gambling games only work if the payoff matches the odds sensibly.

One Die
This game only has one die.  The player rolls the die.
If they roll a 6, they win 60 Euros.  How much should
you be willing to pay when you play this game?

-- Theoretical Answer --
The changes are 1/6 that the number 6 will appear.
That means yhou will win approximately 1 out of every 6 games.
So if you pay 10 Euros to play each game, then you are likely
to pay 60 Euros for 6 games, and win once - so you come out "even".
So if you pay more than 10 Euros to play, then you will lose money
in the long run.  If you pay less than 10 Euros, you will win money
in the long run.

Program
Here is a program that "simulates" rolling the die and winning or losing money.

int die = 0;
int money = 100;

void setup()
{
   for(int c = 0; c < 10; c = c+1)
   {
      money = money - 10;   // make a bet
     
die = (int)(1 + random(6));   
      println(die);
      if(die == 6)
      {
         println("WINNER");
         money = money + 60;  // win money
      }
      else
      {
         println("You lose...");
      }  
   }
 
   println("You ended with Euros " + money); 
}


(a) Run the program several times.  You may notice something
     surprising about the results.

(b) Change the program so it plays 99 games.  Run it several times.

(c) Change the game so that you win 10 Euros for a 1 roll,
     20 Euros for a 2 roll, 30 Euros for a 3 roll, 40 Euros for a 4 roll,
     50 Euros for a 5 roll, and 60 Euros for a 6 roll.  That means you
     always win something, but different amounts.  Figu re out the
     "right" amount to pay for playing the game, so that the player
     generally comes out even - neither winning nor losing money in the long run.

Other Games

For each game, write a program to "simulate" the game
and investigate the odds.

-- Two Dice - Pairs --
The player rolls 2 dice (each with 6 sides). 
If the dice match - e.g. two 6's or two 5's or two 4' ... -
then the player wins 60 Euros.  What amount of money
should the player pay so that they come out even in the long run?

-- Three Dice - Total --
The player rolls 3 dice, and the TOTAL of the dice is counted.
If the total is 9 or higher, the player wins 60 Euros.
Figure out the amount of money the player should pay if they
want to come out roughly even in the long run.

-- Three Dice - Pairs --
The player rolls 3 dice (each with 4 sides numbered 1,2,3,4).
If any two dice match (a pair) then the player wins 60 Euros.
For example:
-  1 - 3 - 2    Lose
-  1 - 3 - 3    Win
-  4 - 2 - 4    Win
-  3 - 3 - 3    Win
Figure out the amount of money the player should pay if they
want to come out roughly even in the long run.