Khan academy simulations

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

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

1

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

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

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

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.

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.

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

It abstracts away some details of the real world

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.

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

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

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

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

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.

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

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)

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


Kaugnay na mga set ng pag-aaral

chapter 9 bushong - Interaction of X-Radiation with Matter, Physics / X-Ray Production / Bushong Chapter 7, Physics PSC Radiography/ Bushong Chapter 8 / X-Ray Emission

View Set

Halter ch 18: feeding, eating and elimination disorders QUESTIONS

View Set

Macbeth Act 4 Guided Reading Questions

View Set

CARF Preparation - Life Safety Set

View Set

Chapter 1: What is Plant Biology?

View Set