Close
Close full mode
logoMakeCode AP CSP

Random Part 2

Summary

Materials

Instructional Activities and Classroom Assessments

  1. Roll the Dice Activity (10 minutes)
  2. What is Randomness? (15 minutes)
  3. Randomness in Games (25 minutes)

Learning Objectives

  • AAP-3.E For generating random values:
    • a. Write expressions to generate possible values. 2.B
    • b. Evaluate expressions to determine the possible results 4.B
  • AAP-3.F For simulations:
    • a. Explain how computers can be used to represent real-world phenomena or outcomes 1.A.
    • b. Compare simulations with real-world contexts. 1.D

Essential Knowledge

  • AAP-3.E.1 The exam reference sheet provides Text: RANDOM(a, b) Block: RANDOM a, b which generates and returns a random integer from a to b, inclusive. Each result is equally likely to occur. For example, RANDOM(1, 3) could return 1, 2, or 3.
  • AAP-3.E.2 Using random number generation in a program means each execution may produce a different result.
  • AAP-3.F.3 Simulations often mimic real-world events with the purpose of drawing inferences, allowing investigation of a phenomenon without the constraints of the real world.
  • AAP-3.F.4 The process of developing an abstract simulation involves removing specific details or simplifying functionality.
  • AAP-3.F.5 Simulations can contain bias derived from the choices of real world elements that were included or excluded.
  • AAP-3.F.6 Simulations are most useful when real-world events are impractical for experiments (e.g., too big, too small, too fast, too slow, too expensive, or too dangerous).
  • AAP-3.F.7 Simulations facilitate the formulation and refinement of hypotheses related to the objects or phenomena under consideration.
  • AAP-3.F.8 Random number generators can be used to simulate the variability that exists in the real world.

Details

1. Roll the dice activity (10 minutes)

  • Organize students into pairs.
  • You can use the Group Generator program to randomly sort students.
  • Distribute die or share random die roll generator with students.
  • Have students work in pairs to roll a die 30 times and record the results of each roll.
  • Collect data from each group.
  • Compare data of the entire class to the data of each small group.
  • Discuss the pattern that should eventually present itself with enough rolls (that a die roll has a 1/6 chance of landing on any given side).

2. What is Randomness (15 minutes)

  • Define randomness.
  • Discuss when things happen by chance in real life.
  • Play video Is Anything Truly Random?
  • Ask students to read the How Computers Generate Random Numbers article.
  • Discuss why we use random numbers.
  • Discuss the difference between true random vs. Pseudorandom.
  • Define simulations.
  • Explain how simulations are used.
  • Discuss Randomness in games.

3. Randomness tutorials (25 minutes)

  • Explain where you can find the random block in MakeCode Arcade.
  • Explain how it works.
  • Discuss the instruction and explanation of Random on the Exam Reference Sheet.
  • Direct students to Activity: Random Sprite Location.
  • Distribute the Tutorials on Randomness handout or direct students to find it in their OneNote notebook.
  • Instruct students to complete Tasks 1-3.
  • Remind students to publish their programs and add the link to their code on the handout.
  • Direct students to respond to the reflection questions on the page when they finish the tasks.
πŸ“˜ Unit 3 - AAP Part 1 β€” Previous
Day 14
Next β€” πŸ“˜ Unit 3 - AAP Part 1
Random Generator Programs