O'Reilly logo

Digital Dice by Paul J. Nahin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

image

APPENDIX 1

One Way to Guess on a Test

The code test.m simulates, a million times, the following method for guessing on the matching test described in the introduction: the student assigns to each president a term, selected at random each time, from the entire term list. The code test.m is similar to guess.m (the first four and the last nine lines are, in fact, identical), with only the details of an individual test differing. Line 05 defines the vector term with M elements (all initialized to zero). Lines 06 through 08 then randomly set the M elements of term, each, to one of the integers 1 to 24 (the MATLAB command ceil is a “round up” command). ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required