The R section of Blitzstein and Hwang’s second chapter, rebuilt in Python in the style of CS61A: predicates as values, a frequency that estimates P(A|B), and a Monty Hall game split into pure logic and input.
The R section of Blitzstein and Hwang’s first chapter, rebuilt in Python in the style of CS61A: small named functions, doctests, and simulations passed around as values.
Reading paths
UC Berkeley · Discrete Mathematics and Probability Theory