Plans for Project

Plans

  • These are the main things we need to keep in mind and follow as a group to meet the expectations for the project and be successful.

Roles for Project

Roles

Possible Future Site

Roles

What are simulations by College Board definition?

  • Simulations are abstractions that mimic more complex objects or phenomena from the real world
    • Purposes include drawing inferences without the contraints of the real world
  • Simulations use varying sets of values to reflect the changing state of a real phenomenon
  • Often, when developing a simulation, it is necessary to remove specific details or simplify aspects
    • Simulations can often contain bias based on which details or real-world elements were included/excluded
  • Simulations allow the formulation of hypotheses under consideration
  • Variability and randomness of the world is considered using random number generators
  • Examples: rolling dice, spinners, molecular models, analyze chemicals/reactions...

Functions that are often needed

import random # a module that defines a series of functions for generating or manipulating random integers
random.choice() #returns a randomly selected element from the specified sequence
random.choice(mylist) # returns random value from list
random.randint(0,10) #randomly selects an integer from given range; range in this case is from 0 to 10
random.random() #will generate a random float between 0.0 to 1.

Examples of College Board MC Simulation Questions

Question: The following code simulates the feeding of 4 fish in an aquarium while the owner is on a 5-day trip:

numFish ← 4

foodPerDay ← 20

foodLeft ← 160

daysStarving ← 0

REPEAT 5 TIMES {

foodConsumed ← numFish * foodPerDay

foodLeft ← foodLeft - foodConsumed

IF (foodLeft < 0) {

daysStarving ← daysStarving + 1

}

}

  • This simulation simplifies a real-world scenario into something that can be modeled in code and executed on a computer.

Simulation Code Starters

Pull random card from a deck

  • Additions we would make to this include:
    • Visual of the card chosen
    • User can choose how many cards should be chosen
import random

cards = ["Ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King"] 
suits = ["Diamonds", "Hearts", "Spades", "Clubs"]

print(random.choice(cards) + " of " + random.choice(suits))
2 of Clubs

Frog jumping

  • Additions
    • Again, add visuals of the frog
    • Add more variables to make this more realistic
      • Weather: If the weather is worse---> frog should jump less
      • Time: If it is day time ---> frog should jump less
      • ^ These could be user inputs
import random
length = [0, 1, 2, 3, 4, 5]
direction = ["left", "right"]

print("The frog jumped" , random.choice(length) , "hops to the" , random.choice(direction))
The frog jumped 5 hops to the left

Population after natural disaster

  • When natural disasters occur, certain times random traits are wiped from a population
    • Take for example the Galapagos finches
      • When a drought hit, smaller seeds became more rare so finches with larger beaks had greater chance of survival
      • this can be modeled (with lots of simplification)
  • Additions we would add
    • specific data on beak size/wing length/height
      • so for certain disaster, wing legnths > 5.5 survived
import random

beak =  ["small-beak", "long-beak", "medium-beak"],
wing = ["small-wings", "large-wings", "medium-wings"],
height = ["short", "tall","medium"]


naturaldisaster = ["flood", "drought", "fire", "hurricane", "dustbowl"]


print("When a" , random.choice(naturaldisaster) , "hit",  random.choice(height), "birds died") 
When a drought hit short birds died