computing exercise hints

  << back

Chapter 9

Exercise 1.
# Label columns R, for outcome of die; W, for Bill’s winnings.
RANDOM 500 R;
INTEGER 1 6.
CODE (2:5) –2 R W
TALLY W
MEAN W

Exercise 2.
The game may be summarised by a table:

No of throws , x 1 2 3 4 5 and H 5 and T
Probability 0.5 0.25 0.125 0.0625 0.03125 0.03125
Ann’s gain 1 2 3 2 -5 -62

For example, if x=3 then Ann’s gain is –2-4+9 = 3.
The required distribution of gain is as above with the two probabilities for ‘2’ added.
# Label columns ‘Gain’ ‘P’ ‘Win’ ‘Total win’ ‘Balance’.Enter 1, 2, 3, -5, -62, in ‘Gain’ with corresponding probabilities in P.
RANDOM 100 ‘Win’;
DISCRETE ‘Gain’ P.
PARSUMS ‘Win’ ‘Total win’
Let ‘Balance’ = ‘Total win’ + 600
TSPLOT ‘Balance’;
SYMBOL;
CONNECT.

 

<< back

 

 
Hodder Arnold