Problem 2BSC

Simulating dice Assume that you have access to a computer that can randomly generate whole numbers between any two values. Describe how this computer can be used to simulate the rolling of a pair of dice.

Solution 2BSC

When we roll a dice outcome is between 1 and 6. Using computer generate a random integer from 1 to 6 and take it as the outcome of first dice. And then generate a second random number from 1 to 6 and take it as the outcome of second dice. Now add the two numbers. Following is an example of above simulation:

Minitab code and output are:

MTB > Random 6 ‘Dice 1’ ‘Dice 2’ ;

SUBC> Integer 1 2.

MTB > Print ‘Dice 1’ - ‘Sum’

Data Display

Row Dice 1 Dice 2 Sum

1 1 1 2

2 2 2 4

3 2 2 4

4 2 1 3

5 2 1 3

6 1 2 3