Khan academy simulations

studied byStudied by 0 people
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 15

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

16 Terms

1

A hair care products company decides to use computer simulation to develop a new anti-dandruff conditioner. The simulation helps them choose the best ingredients, the ratio to combine them at, and the optimal amount of time to leave the conditioner in the hair.
When they do user testing to find out how well the conditioner works on real hair, they see mixed results. Most of the testers reported less dandruff after, but the testers with curly hair absolutely hated what it did to their curls.

It did not include a representative range of hair types.

New cards
2

Kassidy develops a simulation of campfire smoke for a short film.
The following code segment is responsible for fading particles away:

1: particles ← [100, 100, 100, 1100]
2:
3: FOR EACH particle IN particles {
4: particle ← particle - 1
5: }

A particle with a value of 100 displays at full opacity and a particle with a value of 0 is invisible.
She can use the following mathematical procedures:

particle ← particle - RANDOM(1, 5)

New cards
3

A programmer is creating a simulation of a city where natural disasters can randomly occur.
This incomplete code segment simulates a Godzilla disaster:

IF (<MISSING CONDITION>)
{
cityHealth ← cityHealth - 30
disasterMode ← "godzilla"
}

The code should only give Godzilla a 2% chance of storming the city.
Which of these can replace <MISSING CONDITION> so that the code works as intended?

RANDOM(1, 100) <= 2

New cards
4

The following code simulates changing the temperature of water.

temperatureC ← -15
waterStage ← "solid"
meltingPoint ← 0
boilingPoint ← 100

REPEAT UNTIL (waterStage = "gas") {
temperatureC ← temperatureC + 1
IF (temperatureC > boilingPoint) {
waterStage ← "gas"
} ELSE {
IF (temperatureC > meltingPoint) {
waterStage ← "liquid"
}
}
}

Which details are excluded from this simulation?
👁️Note that there are 2 answers to this question.

1) The boiling point of water varies based on the atmospheric pressure
2) Water can exist as both a solid (ice) and as a liquid at 0 degrees celsius

New cards
5

What is always true of a simulation of a natural phenomenon?

It abstracts away some details of the real world

New cards
6

An indie game developer is making a grid-based game and using code to randomly spawn dogs on the game grid.
The following code spawns a dog:

row ← RANDOM(3, 5)
col ← RANDOM(2, 4)
DOG(row, col)

The procedure DOG draws the dog in a 5x5 grid, where the first parameter represents which horizontal row to draw it in, and the second parameter represents which vertical column to draw it in. The rows and columns are both numbered 1 through 5.

dogs in rows 3-5 and columns 2-4

New cards
7

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
}
}

Why is this simulation considered an abstraction?

It simplifies a real-world scenario into something that can be modeled in code and executed by a computer

New cards
8

A digital artist is writing a program to draw a face.
This is the part of the code that draws the eyes and pupils:

eyeSize ← RANDOM(5, 20)
CIRCLE("white", 20, 20, eyeSize)
CIRCLE("white", 40, 20, eyeSize)
pupilSize ← RANDOM(2, 5)
CIRCLE("black", 20, 20, pupilSize)
CIRCLE("black", 40, 20, pupilSize)

The code relies on the CIRCLE() procedure from a drawing library, which accepts four parameters for the circle's fill color, x position, y position, and diameter.

Two equally-sized eyes ranging in size, with a minimum size of 5 pixels and a maximum size of 20 pixels. Each eye has a black pupil that ranges in size from a minimum of 2 pixels to a max of 5 pixels.

New cards
9

Ashlynn is an industrial engineer who is trying to design a safer parachute. She creates a computer simulation of the parachute opening at different heights and in different environmental conditions.
What are advantages of running the simulation versus an actual experiment?
👁️Note that there are 2 answers to this question.

1)The simulation can be run more safely than an actual experiment.
2)The simulation can test the parachute design in a wide range of environmental conditions that may be difficult to reliably reproduce in an experiment.

New cards
10

An indie game developer is making a grid-based game and using code to randomly spawn monsters on the grid.
The following code spawns a monster:

row ← RANDOM(1, 3)
col ← RANDOM(3, 4)
MONSTER(row, col)

The procedure MONSTER draws the monster in a 5x5 grid, where the first parameter represents which horizontal row to draw it in, and the second parameter represents which vertical column to draw it in. The rows and columns are both numbered 1 through 5.

rows 1-3, columns 3-4

New cards
11

The following code simulates a hurricane moving hour-by-hour based on predicted wind directions:

hourlyWindDirections ← ["N", "N", "E", "E", "S"];
windSpeed ← 5
hurricaneLat ← 33
hurricaneLng ← 47
FOR EACH (direction IN hourlyWindDirections) {
IF (direction = "N") {
hurricaneLat ← hurricaneLat - 0.1 * windSpeed
} IF (direction = "S") {
hurricaneLat ← hurricaneLat + 0.1 * windSpeed
} IF (direction = "E") {
hurricaneLng ← hurricaneLng - 0.1 * windSpeed }
IF (direction = "W") {
hurricaneLng ← hurricaneLng + 0.1 * windSpeed } }
Which variables hold values that vary during the course of this simulation?

1) hurricaneLat
2) hurricaneLng

New cards
12

A company is developing a driving simulator to help emergency responders understand how to drive a wide range of trucks, just in case the responders find themselves in a situation where it's necessary.
What detail would be least important to include in the simulation?

Roadside landscape that's textured based on recent satellite imagery

New cards
13

A digital artist is writing a program to draw a landscape with a randomly generated mountain range.
This code draws a single mountain:

xPos ← RANDOM(4, 240)
height ← RANDOM(70, 120)
drawMountain(xPos, 80, height)

The code relies on the drawMountain() procedure, which accepts three parameters for the mountain's x position, y position, and height.

1) A mountain at an x position of 4 and a height of 120
2) A mountain at an x position of 180 and a height of 110

New cards
14

A researcher gathers data about the effect of Advanced Placement®︎ classes on students' success in college and career, and develops a simulation to show how a sequence of AP classes affect a hypothetical student's pathway.
Several school administrators are concerned that the simulation contains bias favoring high-income students, however.
Which of the following statements is true?

The simulation may accidentally contain bias due to the exclusion of details

New cards
15

The following code segment simulates a race between two horses:

raceLength ← 200
horse1 ← 0
horse2 ← 0
REPEAT UNTIL (horse1 ≥ raceLength OR horse2 ≥ raceLength) {
horse1 ← horse1 + (RANDOM(1, 2) * 2)
horse2 ← horse2 + (RANDOM(1, 1) * 2)
} IF (horse1 = horse2) {
DISPLAY("tie")
} ELSE {
IF (horse1 > horse2) {
DISPLAY("Horse 1 won")
} ELSE {
DISPLAY("Horse 2 won") } }

Which statement best describes the variability in this simulation?

Horse 1 races at a variable speed while horse 2 races at the same speed throughout the race.

New cards
16

A game developer is working on a basketball playing game.
This incomplete code segment simulates a player attempting a 3-pointer shot:

1

New cards

Explore top notes

note Note
studied byStudied by 14 people
1005 days ago
4.0(1)
note Note
studied byStudied by 162 people
624 days ago
5.0(1)
note Note
studied byStudied by 16 people
122 days ago
5.0(1)
note Note
studied byStudied by 22 people
743 days ago
5.0(1)
note Note
studied byStudied by 61 people
882 days ago
4.0(1)
note Note
studied byStudied by 8 people
176 days ago
5.0(1)
note Note
studied byStudied by 10 people
898 days ago
5.0(1)
note Note
studied byStudied by 255 people
686 days ago
4.8(9)

Explore top flashcards

flashcards Flashcard (127)
studied byStudied by 31 people
911 days ago
5.0(1)
flashcards Flashcard (20)
studied byStudied by 19 people
266 days ago
5.0(1)
flashcards Flashcard (20)
studied byStudied by 8 people
784 days ago
5.0(1)
flashcards Flashcard (28)
studied byStudied by 29 people
737 days ago
5.0(2)
flashcards Flashcard (67)
studied byStudied by 9 people
837 days ago
5.0(1)
flashcards Flashcard (315)
studied byStudied by 51 people
763 days ago
5.0(4)
flashcards Flashcard (29)
studied byStudied by 15 people
379 days ago
5.0(1)
flashcards Flashcard (26)
studied byStudied by 84 people
17 days ago
5.0(1)
robot