Envisioning a Computationally Enhanced Mathematics Curriculum in Hong Kong’s Primary & Secondary Schools
Guess the Animal
Lesson Overview
The goal of this lesson is to help students develop the concept of decision tree and apply it to daily life examples. In this lesson, students will utilize Scratch to create an interactive game, “Guess the Animal”. In this game, the computer will attempt to guess the animal the player is thinking of by asking a series of “yes or no” questions. Through this activity, students will simulate human-computer interaction, analyze game logic, and learn how to implement decision trees for data handling. Focusing on the conditional block (“If… then…, else…”), the lesson aims to help students understand the concept of simulation and to grasp logical operations and conditional statements by observing the decision-making process within the game.
Learning Objectives
-
Learn to simulate human-computer interaction through blocks “ask… and wait” and “say” and store the answer in a block “answer” or a defined variable.
-
Experience the concept of Boolean (“0” and “1”) and build connections between numbers and expressions of true-false in programming.
-
Understand the function of decision tree and learn to utilize the conditional block (“If… then…, else…”) to determine conditions for each event in Scratch programming.
-
Strengthen problem-solving and logical reasoning skills through programming.
Mathematics & CT Outcomes
-
Mathematics: concepts of decision tree.
-
CT Skills: stimulation, variable, operator; conditionals (if…then…, else…).
Lesson Details
Pre-Activity
Play with the game “Guess the Animal” given by the teacher, and then try to create a similar game by yourself.
First, you need to find out how the program runs by using different questions to classify different animals and complete a diagram of decision tree to present your observation.
Then, you need to decompose every step in the game and find the blocks to realize them.
Finally, design your own game by revising the program.


Guiding Questions
-
What are the steps that we went through when the game was running?
-
What are the similarities between the questions asked by the computer in the task?
-
How can a human-computer interaction be created and the answer input utilized to represent the decision-making?
Extension Question
If you were asked to add one more animal to your current game, what animal would you choose, and how would you modify the program?
Students’ Work
Students begin by selecting five animals and designing a decision tree flowchart to map out the questions and answers required to identify each animal. They then implement the logic in Scratch using “if...then...else...” blocks to represent each decision point in the tree.
In the program, each “if...then..., else...” block serves as a question-and-answer node. For nested “if...then...else...” blocks, students need to understand the logical flow: the outermost block represents the initial question in the decision tree. Depending on the answer, the program follows one branch of the decision tree or the other. At each branch, the program initiates a new question-and-answer node, represented by the next level of nested “if...then...else...” blocks. This process repeats until the program reaches the end of the decision tree, identifying the chosen animal.
This approach helps students grasp the structure of decision trees, as well as logical sequencing and conditional programming in Scratch.


Possible Challenges and Misconceptions
Make connections between decision tree and programming blocks
One common challenge students face is understanding how decision tree logic translates into Scratch programming blocks. While they may grasp the concept of decision trees visually, applying this understanding to nested “if...then..., else…” blocks in Scratch can be difficult. By using visual aids, incremental coding strategies, and hands-on practice, students will develop a stronger understanding of how to map decision tree structures into Scratch programming blocks, ensuring their programs are logically sound.

Using numerals to simulate the decision-making process
In Scratch, students commonly use numerals to simulate the responses “Yes” and “No”, where ‘1’ represents “Yes”, and any other number represents “No”. This numerical approach ensures consistency in programming logic and simplifies conditional checks within the decision tree. However, some students may deviate from this method:
Method 1: Direct Use of Text-Based Responses
One student directly used the text “Yes” as the condition to determine the response instead of assigning a numeral. While this approach may still work, it introduces inconsistencies in the program since Scratch expects text inputs to match exactly, which can lead to errors if the input varies (e.g., using “YES” or “yes”).
Method 2: Using Inequalities for Logical Conditions
Another student used an inequality (answer<1) to simulate the response “True”. While this approach might function correctly in some cases, it can be misleading when designing a decision tree. The use of inequalities could introduce confusion about the logic being implemented, especially when interpreting multiple conditional branches.

