Envisioning a Computationally Enhanced Mathematics Curriculum in Hong Kong’s Primary & Secondary Schools
Dart Game
Lesson Overview
In this lesson, students will learn to solve problems related to probability using Scratch. They will design a game in which the program will throw darts automatically and record all the results. During the design of the game, students have to find a way to simulate throwing darts and be able to record all the results. The game aims to help students know CT concepts and practices (e.g., variables, conditionals, loops, simulation, automation, sequences) and acquire the mathematical concept of probability by observing the outcome of trials in the dart game.
Prior Knowledge

Mathematics: Coordinate System

Scratch: Know how to use blocks such as ‘ask’, ‘forever’, ‘repeat until’, ‘if… then…else…’, set variables, and change size and costume.
Learning Objective

To understand the role of each Sprite. In particular,

Cat: Control the flow of the game and ‘throw’ the Dart

Dart: To be ‘thrown’ and to check which region it hits

C1 to C5: background (C1 is the smallest circle and C5 is the largest circle)


To know how to make a dartboard using the 5 circles and simulate ‘throwing’ the Dart.

To use nested conditionals blocks to check the hit event.

To solve problems related to probability and acquire the concept of the experimental probability of throwing the dart onto each region.
Mathematics & CT Outcomes

Mathematics: concepts of experimental probability

CT Skills: simulation, automation, sequences, conditionals (if…then…else…), loops (repeat), variable (set XX to XX; change XX by XX), operators (and; or; pick random XX to XX).
Teaching Resources
The Desmos Activity used in this Task.
Lesson Details
PreActivity
Create a simple game together with the whole class. Requirements for the game are as follows:

There are 3 sprites in the scratch, a button, a circle, and a ghost.

Only the button will be shown when we start the game. (Code of this part is done already.)

When we click the button, the circle and the ghost appear.

The ghost must be placed inside and in front of the circle.
Main Activity
Design a dart game to automatically throw a ball (onto the dartboard). Requirements for the game are as follows:

Size of the ball has to be small, with a preset of 20%

Keep the costume of the circles remains unchanged.
Click Remix: https://scratch.mit.edu/projects/555415212.
Guiding Questions

Use table to record the results (5 trials, no restriction on the number of throws)

Calculate the experimental probabilities according to the results.

Why do we need to set the size of the dart to be small?

We are now going to introduce a scoring system to the game. Below are two suggestions:

Compare the two systems above, which is fairer? Why?

Design a scoring system and explain whether it is fairer than the above two.
Students' Work
There are many ways to check which region a dart hits, and the students’ work shows two of them.
Method 1: Setting Variables
In this work, students used multiple nested [if...then...else...] blocks to determine the order of the region tests. The five circles are overlapped; if the Dart hits C1, it touches all the five circles/layers. We are counting down the layers to check where does the Darttouch/hit:

We first check if Dart touches C1; if yes, change Region 1 by 1.

Else, if the Dart does NOT touch C1, it may touch C2/3/4/5, so we go to the next layer (C2) and repeat the steps.

if the Dart does not touch any region, it hits out of the dartboard, so we change Failed throw by 1.
Method 2: Sample Code
Another way of recording and accumulating the frequency of each sum event is to set up a list with 12 rows to represent all events from sum 1 to 12. Besides, we need to use the [replace item XX of XX with XX] block to accumulate the frequency of the different sum events. As the sums are represented here by the No. of rows, the frequency of the first row (i.e., the sum of two dice is 1) is always kept at 0. This also provides an opportunity for students to gain a deeper understanding of the concept of probability.
Method 3:
Whereas the first two methods both test the touch location (i.e., touching XX sprites) to determine the region the dart hits, the third method does so by examining the colour of the touch area. In this work, students set a different color for different regions (see figure below) and then use the [touching color XX] block to check for hitting events.
Possible Challenges and Misconceptions
The learning difficulty in this lesson is how to check which region a dart has hit. Three methods of detecting dart events were introduced in the previous section. This section will introduce misconceptions that students may have when they detect dart events.
Sample 1: Ignored the priority of dart hit event detection
In this work, the student did not take into account the overlap of several regions and did not set the priority of the conditions but used the [if...then...] blocks in parallel to detect regions C1, C2, ..., C5 at the same time, which would result in double counting. For example, since C5 is the layer enlarged by C1, C1 would be in the C5 region, so when the dart hits the C1 region, both C5 and C1 would be incremented by 1 hit event.
Sample 2: Considered the priority of detecting dart hit events but with the incorrect order
The student used multiple nested conditional blocks (if...then...else...] to determine the priority of the dart hit events in this work. However, the order in which the regions were checked was not correct. Given that all regions (C1C5) would be included in C5, checking whether the dart hits C5 first would have prevented all events except the failed throws event from being detected and all would be attributed to C5.
Acknowledgement
The author would like to thank Ka Ying LIU for designing this lesson and appreciate all the anonymous teachers and students who participated in this research.