Lesson 0.3: Computational Thinking: Algorithms
Learning Objectives:
Students will use logical reasoning to us to ‘think through’ the steps in algorithms to determine their outcomes.
Students will follow an algorithm to draw pictures constructed from 2D shapes.
Students will use logical reasoning to debug and correct errors in the 2D shape algorithms.
Do Now:
Watch: Who is Grace Hopper?
Grace Hopper was the first person to "debug" a computer.
How did she do it?
Discussion:
Explore:
Activity 1: Debugging a 2D Drawing
From the first lesson (0.2) you learned that an algorithm is a sequence of instructions.
In this activity, you will use an algorithm to draw a house.
You will also learn how to "debug" (fix) an algorithm if it's not working properly.
The instructions on the left is an algorithm. This algorithm is made up of a sequence of instructions to create a picture of a house.
On the right is how you would like the house to look. There might be some mistakes in the algorithm, which means following it will not create the picture of the house you hoped for.
Your task is to use logical reasoning to work through this algorithm to detect and correct any errors; we call this debugging.
Algorithm, which may contain errors, for drawing a house using 2D shapes.
With a partner:
One person will read each step of the algorithm on this worksheet and the other person will draw it on a blank sheet of paper
Check whether what you have drawn from the algorithm matches the picture.
If it does then move on to next step; if it doesn’t then edit the algorithm (see below).
When editing the algorithm think about the use of logical reasoning to justify the changes you make:
Identify the difference.
Think what you need to change.
Change the algorithm.
Activity 2: 2D Drawing Worksheet
Using this worksheet, create a simple drawing made from 2D shapes in the right hand part of the table and write the algorithm for this drawing in the left hand box.
Purposefully include 3 mistakes in your algorithm. An example is shown below:
Once you have completed this, swap sheets with your partner.
Use logical reasoning to detect and correct the errors in your partner’s algorithm: you will debug it.
Lesson 0.3 Wrap Up:
Discussion:
What is an algorithm? (Hint: You used algorithms to create the sequences of instructions for constructing the 2D shape drawings.)
What is debugging? (Hint: You used debugging to detect and correct the errors in the 2D shape drawings.)
Differentiation
A 2D shape drawing and algorithm (with errors) can be pre prepared and students can work as a group to detect and errors and correct the errors.