Today, we’re going to learn about a fun game called the Dice Race and how it helps us understand how computers think. Computers see things differently than we do, and this game will help us explore that idea. If you’ve played games like Yahtzee or used a magic 8-ball, you might already have an idea of how this works!
Before we start, let’s talk about algorithms. An algorithm is just a list of steps to complete a task. We’ve practiced making instructions for simple activities, but now we’re going to think about how to explain things from a computer’s point of view. Instead of just saying what we see when we play a game, we’ll describe what the computer needs to do to show us the game.
Are you ready to play? I’ll give each of you a die. You will be player one, and your friend will be player two. We’ll roll the dice three times, and whoever gets the highest total score wins!
Roll number one: Player one rolls a four. Player two rolls a five.
Roll number two: Player one rolls a three. Player two rolls a three.
Final roll: Player one rolls a two, and player two rolls a six.
In this game, player two is the winner! Now you know how to play the Dice Race.
Now, let’s think about the steps needed to play this game. Knowing how to play is one thing, but explaining it step by step is another.
If we wanted a computer to play this game, what would we need to do differently?
To decide the winner, the computer checks the scores. If player1’s score is higher, player one wins. If player2’s score is higher, player two wins. If both scores are the same, it’s a tie.
Now, it’s your turn to play the Dice Race in real life. After you play, try writing down the steps, or algorithm, for the game. This will help you understand how to explain tasks clearly, just like a computer would!
Algorithm Adventure: Create your own game! Think of a simple game you like to play, such as “Simon Says” or “Tag.” Write down the steps or rules of the game as an algorithm. Remember, an algorithm is just a list of steps to complete a task. Share your algorithm with a friend and see if they can follow your instructions to play the game.
Dice Detective: Use a die to explore probability. Roll the die 20 times and keep track of how many times each number appears. Which number appeared the most? Which appeared the least? Discuss with a friend why you think some numbers might appear more often than others. This will help you understand randomness, just like how a computer generates random numbers.
Computer Code Creator: Pretend you are a computer! Ask a friend to give you a simple task, like making a sandwich or drawing a picture. Have them write down the steps as an algorithm. Follow their steps exactly as written, even if they seem silly or don’t make sense. This will show you how important it is to give clear and precise instructions, just like when programming a computer.
Here’s a sanitized version of the provided YouTube transcript:
—
The preparation for this activity is quite extensive because we need to explain to the children how the perspective of a computer differs from their own. It’s beneficial if they understand how a dice race works, but if they don’t, we can use something familiar, like a magic 8-ball or Yahtzee, to illustrate the concept. We will discuss how it appears from their viewpoint and how a computer presents that information.
We’ve been discussing algorithms and how to create a list of steps to explain a task. Previously, we focused on making instructions for everyday activities, but now we will shift our approach. As you grow older, it’s important to think about how to describe tasks from the computer’s perspective. Instead of just explaining what we see when we play a game, we will describe what the computer needs to show us.
Are you ready? I’m going to give each of you a die, and we will have a dice race. You will be player one, and you will be player two. We will move forward based on your rolls. We will have three rolls, and whoever gets the farthest at the end wins.
Let’s begin with roll number one. The winner will earn the glory of being the farthest in the dice race game.
Roll number one: Player one rolls a four. Player two rolls a five.
Now for roll number two: Player one rolls a three. Player two rolls a three.
Final roll: Player one rolls a two, and player two rolls a six.
In the dice race game, player two is the winner! Now you know how to play the dice race game.
Next, let’s think about the list of steps needed to play this game. Understanding how to play is one thing, but explaining it step by step to someone else is another.
So, if we’re going to play the dice race game, what’s the first thing we need to do? We need to have player one and player two.
What’s the score at the beginning? Zero for both players.
Then what do we do? Each player rolls the die, and they add the result to their score.
How many times do we do this? Three times.
Does one person roll all three times? No, player one rolls, then player two rolls, and we repeat this for all three rolls.
At the end, whoever has the highest score wins.
Now, let’s consider the instructions if we wanted a computer to simulate this game. What would be different?
First, we need to initialize the two players. We would have a variable called player1 set to zero and another variable called player2 also set to zero for their scores.
When it’s a person’s turn, they roll the die, but the computer needs to be programmed to generate a random number between 1 and 6.
So, the first step for the computer is to set the scores to zero. Next, it will randomly choose a number from one to six for player one. After rolling, the computer needs to display the number and add it to player one’s score.
Once we have player one’s score, we repeat the process for player two. The computer will again choose a random number and add it to player two’s score.
We will repeat this process for the number of rounds we decide to play. After that, we will determine the winner by comparing the scores.
To find out which player has the highest score, we can subtract player1’s score from player2’s score. If the result is negative, player two wins; if positive, player one wins; and if it’s zero, it’s a tie.
Now, I’m going to give you a real-life dice race game to play. After playing, you will write down the algorithm for it.
—
This version maintains the educational content while removing informal language and ensuring clarity.