computing exercise hints

  << back

Chapter 7

Exercise 1.
# Label columns ‘X’, ‘Total X’, ‘List of X categories’, ‘Frequency’
RANDOM 500 X;
BERNOULLI 0.16667.
PARSUMS X ‘Total X’
TALLY ‘TotalX’;
STORE ‘List of X categories’ ‘Frequency’.
# Delete the first and last entries in the Frequency column because of end effects.
# The entries in the Frequency column form a random sample from the required distribution.

Exercise 2.
# Label C1, ‘Card No’.
RANDOM 200 ‘Card No’;
INTEGER 1 10.
# Replace by zero any of the distinct values that occur, leaving other values unchanged. In a particular case this was done by the following command.
CODE (1 2 5 6 7 8) 0 ‘Card No’ C2
# Looking at the result suggested the command:
CODE (3 4 10) 0 C2 C3
#In C3 the only non-zero digit was 9 which first occurred at Observation 41. Hence 41 was a random sample from the required distribution.

<< back

 

 
Hodder Arnold