Week 10: October 31 - November 4

Generating Random Numbers

Sequences of random numbers are frequently needed to simulate processes in which outcomes are uncertain. Although computers work on deterministic principles, we see that they can be used to generate “pseudo-random” numbers that satisfy various tests for randomness.

Monte Carlo Methods

Monte Carlo methods use sequences of random numbers to obtain numerical results for functions or processes that are otherwise difficult to analyze. We apply such methods to integration, to estimating probabilities, and to a simple model of stock price movements.

NumPy

  • random.rand
  • Axis-dependent operations: sum, mean, amin, amax

Matplotlib

  • hist
  • polar

Quiz 8: More NumPy

  • Indexing using boolean arrays.
  • Indexing using integer arrays.
  • meshgrid

Sample Quiz 8