|
First Summer 2008 |
Late submissions will be accepted for full credit if:
Also, please make sure you
with the Computer Science Department's Statement on Academic Integrity before turning in your assignment.
Example:
coin = Coin()
for exp in range(20):
for i in range(1000):
coin.flip()
print coin.report()
coin.reset()
Running the code above produces this:
Above, we flip the coin 1000 times and report the result, then reset the coin.>>> Heads: 497, tails: 503 Heads: 502, tails: 498 Heads: 516, tails: 484 Heads: 484, tails: 516 Heads: 503, tails: 497 Heads: 489, tails: 511 Heads: 490, tails: 510 Heads: 500, tails: 500 Heads: 501, tails: 499 Heads: 501, tails: 499 Heads: 495, tails: 505 Heads: 487, tails: 513 Heads: 522, tails: 478 Heads: 493, tails: 507 Heads: 506, tails: 494 Heads: 505, tails: 495 Heads: 519, tails: 481 Heads: 510, tails: 490 Heads: 493, tails: 507 Heads: 500, tails: 500 >>>
We then do the same 19 times for a total of 20 experiments.