☰ خطة العام · تكنولوجيا المعلومات والاتصالات (بالإنجليزية)

Algorithms: steps in order

الأسبوع 26 · المحور الرابع، الدرس ٥ «الخوارزميات» · 3 دروس
2

Recipes, directions and chores

ICT P4 Term 2, Theme 4: pp. 62–65
GoalSee that recipes, directions and daily routines are algorithms, and write my own.
New words
recipe · steps for making fooddirections · steps that tell you how to get to a placeroutine · something you do the same way every dayinstruction · a sentence that tells you what to do
Explanation

Many things you do every day are algorithms. A recipe is an algorithm: it tells you what to do first, next and last. Directions are an algorithm too: “go straight, turn right, go straight again”. Tidying your room is an algorithm: pick up the toys, put the books on the shelf, make the bed. Even a maths problem has steps: if a box holds 12 pencils and 4 are taken and then 3 more, first 12 − 4 = 8, then 8 − 3 = 5. Computers and apps follow algorithms too, so a clear list of steps is a clever way to solve many problems.

Worked examples
pick up toysbooks on the shelfmake the bed
An algorithm for tidying a room: pick up the toys, put the books on the shelf, make the bed.
Youssef gives directions to the library on a grid: go forward 1 square, turn left, then go forward 2 squares.
StepCalculation
112 − 4 = 8
28 − 3 = 5
Answer5 pencils are left
A maths algorithm: a box has 12 pencils; 4 are taken and then 3. How many are left?
Class activity

My routine algorithm. Choose something you do every day, such as getting ready for school, feeding a pet or packing your bag. Write the steps, numbered, on paper. Swap with a partner: can they follow your steps exactly? Did you miss a step?

Practice
1
Name three things in daily life that are algorithms.
2
The robot starts at the bottom square facing up. It follows: forward 2, turn right, forward 1. Where does it stop? Say the letter.
ABCD
3
A box has 15 pencils; 5 are taken and then 4. Write the steps and the answer.
4
Write an algorithm of three steps for filling a water bottle.