A particular game of chance is played by throwing a pair of 6-sided dice and observing the total
number of spots showing on their top faces.
• If the total T1 for the first throw is 7 or 11, the player wins immediately.
• If T1= 2,3 or 12, the player loses immediately.
• If the total is any other number x, then the player keeps throwing the dice, yielding totals
T2, T3,…
each time until either
i) she throws a total of x again, in which case she wins, or
ii) she throws a total of 7, in which case she loses.
Write a MATLAB procedure or code that simulates the game, as described above. Your
procedure should indicate when the player
I) wins
II) wins on the 4th throw, and
III) wins and also threw a 5 on her 1st throw.
Write a program that calls your MATLAB procedure from (g) n=10 times,
and gives the fraction of times that the player
I) wins
II) wins on the 4th throw, and
III) wins given that she threw a 5 on her first throw.
number of spots showing on their top faces.
• If the total T1 for the first throw is 7 or 11, the player wins immediately.
• If T1= 2,3 or 12, the player loses immediately.
• If the total is any other number x, then the player keeps throwing the dice, yielding totals
T2, T3,…
each time until either
i) she throws a total of x again, in which case she wins, or
ii) she throws a total of 7, in which case she loses.
Write a MATLAB procedure or code that simulates the game, as described above. Your
procedure should indicate when the player
I) wins
II) wins on the 4th throw, and
III) wins and also threw a 5 on her 1st throw.
Write a program that calls your MATLAB procedure from (g) n=10 times,
and gives the fraction of times that the player
I) wins
II) wins on the 4th throw, and
III) wins given that she threw a 5 on her first throw.