Fair coin flips #
Cslib.BitString.coinFlips is the probability measure on infinite bit tapes ℕ → Bool under
which the bits are independent fair coins: the product MeasureTheory.Measure.infinitePi of
uniform distributions on Bool. An event determined by the first N bits of the tape has
probability equal to the fraction of the 2 ^ N words of length N that it contains
(coinFlips_setOf_eq_card_mul); a word y : Fin N → Bool is read as a tape by padding it with
false, as Function.extend Fin.val y fun _ => false. This reduces probabilistic statements about
algorithms reading a bounded prefix of a random tape to counting words.
Main definitions #
Cslib.BitString.coinFlips: independent fair coin flips.Cslib.BitString.prefixCylinder: the tapes beginning with a given word.
Main results #
Cslib.BitString.coinFlips_prefixCylinder: a given word of lengthNbegins the tape with probability2⁻ᴺ.Cslib.BitString.measurableSet_setOf_of_prefix,Cslib.BitString.coinFlips_setOf_eq_card_mul: events determined by a prefix of the tape are measurable, with probability the fraction of the words in them.
Independent fair coin flips: the product of uniform distributions on Bool.
Instances For
A given word of length N begins the tape with probability 2⁻ᴺ.
An event determined by the first N bits of the tape is the union of the cylinders of the words
of length N in it.
The probability of an event determined by the first N bits of the tape is the fraction of the
words of length N in it.