Video 3.16 Hacks
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
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)