Simulations

A simulation is an simpler abstraction of an very complicated natural phenomena. It removes details that are unnecessary or are too difficult to simulate. The level of abstraction in a simulation depends on why we're creating it in the first place.

Why would you make a simulation?

  • Safer: Many safety hazards that can be encountered through experimentation can be avoided with simulations. Ex: Designing a boat to travel to an island
  • Less Expensive: Since real world equipment isn’t needed to make and run a simulation (only computer and programmer needed), this makes simulations an inexpensive way to test something. Ex: Boat example again
  • Repeatable: Once a simulation is created, it’s easy to repeat it to get different but similar results.
  • Can Make Predictions: Something that can’t be done with experiments is making predictions. Simulations are useful for this because previous data can be used to predict what will happen in the future. Ex: Global population

Hacks

Question Answer
Name Haeryn Yu
1 X
2 X
3 C
4 B
5 C
6 A
7 A
8 X
9 B

Simulation

import random

data = []

for i in range(5):
  one = random.randint(1, 6)  
  two = random.randint(1, 6)

  d = { "First Dice": one, "Second Dice": two}

  data.append(d)

print(data)
[{'First Dice': 4, 'Second Dice': 1}, {'First Dice': 3, 'Second Dice': 1}, {'First Dice': 6, 'Second Dice': 5}, {'First Dice': 5, 'Second Dice': 3}, {'First Dice': 2, 'Second Dice': 5}]