Week 2 • Friday

Block 19: Random Numbers & Simulation

Generate reproducible random data for simulations and ML.

Concepts

Code Examples

See exercise below.

Exercise

Simulate 10,000 dice rolls; count and print frequency of each face. Generate 1000 samples from N(0,1); verify mean ≈ 0 and std ≈ 1.

Homework

Write a Monte Carlo estimate of π using random points in a unit square.