Rendering of the previous page

Problem 1: Flip a Coin

a) Make a program that simulates flipping a coin \( N \) times.

Hint. Use r = random.random() and define head as r <= 0.5.

b) Compute the probability of getting heads.

Answer. 0.5.

Filenames: flip_coin.py, flip_coin.pdf.