The first rule of programming is, never write a program from scratch!
Start with an existing program that does something close to what you
want to do,
and modify it until it does what you want.
In order for this to work, you have to have access to some model
programs.
With that in mind, here are Matlab programs
akin to the BASIC programs Grinstead and Snell discuss.
ch1/prob.m
ch1/cointosses.m
ch1/demere1.m
ch1/demere2.m
ch1/htsim.m
ch1/htahead.m
Here are programs relating to some of the exercises
in section 1.1.
These exercises
were formulated with an eye toward
the BASIC programs that accompany the book.
We'll ignore the specific instructions,
which aren't always appropriate for Matlab,
and heed what the problems
are trying to get at.
ch1/1.1/prob1.m
ch1/1.1/prob2.m
ch1/1.1/prob3.m
ch1/1.1/prob4.m
ch1/1.1/prob5.m
ch1/1.1/prob10.m
ch2/montecarlo.m
ch2/normaldensitybargraph.m
ch2/normalcdf.m
ch2/cantor.m
ch2/dart.m
ch2/dartluck.m
ch2/dartsqrt.m
Peter G. Doyle
2012-03-27