15-110 PS9 Sample Solutions - Spring 2018 1. (a) equation based: planets follow orbits based on physics/equations, etc. (b) accurate: planet sizes, colors, are realistic, planets look like planets (c) dynamic: simulation runs over time and is not frozen in one step (d) deterministic: the simulation does not depend on randomness (planets don't do random things with their orbits) 2. (a) 30 pixels wide, 20 pixels high (b) 30*col, 20*row, (col+1)*30, (row+1)*20 3. (a) True (b) False (c) True (d) False 4. The new state depends on the prior day, but if matrix is changed in place, then we can change state based on current day too. 5. randint(0,99) < 10 6. if j > 0 and contagious(matrix, i, j-1) if j < 19 and contagious(matrix, i, j+1) 7. (a) Search engines crawl the web and collect copies of all web pages they can find, so they have backups of all erased pages. (b) More pages link to a page AND those pages are also ranked higher.