Lecture 12, CS 302-6, September 30
i. Columns, rows of chairs
i. Imagine flipping 1,000,000 coins. Chances are about half of them will be heads.
i. Unit circle
ii.
Area –
pi*r^2
iii. X, y random between 0 and 1
iv.
X^2+y^2<=1
v. Probability of landing in circle: pi/4
vi. Example – MonteCarlo.java
1. (we didn’t actually code this in class)
i. Imagine game show, three doors. 2 have goats behind them, one has a new car. Pick a door. Host opens another to show goat. Should you switch to the other unopened door?
ii. Best strategy: Switch. Why? Higher probability
iii. Don’t believe me? See http://en.wikipedia.org/wiki/Monty_Hall_problem
iv. We’ll code this up next class