Computational Modeling Fall 2005 For today, you should have: 1) copied down a whiteboard from last time, and added comments 2) done HomeworkTwo 3) got a Python book Today's outline: 1) Python 2) the Pirate Problem 3) discussion of modeling -- What makes a good model? 4) trade books For next time you should: 1) do HomeworkThree Python crash course ------------------- See notes01.txt Pirates on a Plank ------------------ Analysis of k_pirates.py by Katie Rivard # quick pirate "simulation" by Allen Downey import random n = 10 len = 100 runs = 10000 maxima = [] for j in range(runs): positions = [random.uniform(0, len) for i in range(n)] maxima.append(max(positions)) print sum(maxima)/runs print 1.0 * n / (n+1) * len