This page provides various
scripts/modules that I have written over the years.
Most of them were written and tested on Mac OS X,
and some may be specific for OS X,
but most should run on any platform where Python is installed.
These were tested with Python 2.6.5.
This script takes one command-line argument which should be a string
of H's and T's (e.g. HHTH) representing a pattern of heads & tails.
The script runs a simulation of coin tosses to determine the average
number of tosses before the given pattern will occur.