Computer Science Grade 7 20 min

Lesson 1: What is an Algorithm? Unveiling the Secret Recipe

Define algorithm and illustrate with real-world examples like following a cooking recipe or giving directions.

Tutorial Preview

1

Introduction & Learning Objectives

Learning Objectives Define the term 'algorithm' in their own words. Identify the key characteristics of a good algorithm (clear, finite, effective). Recognize algorithms in everyday tasks like making a sandwich or following a map. Differentiate between an algorithm (the recipe) and a final product (the cake). Create a simple, step-by-step algorithm for a common school-day task. Explain why the order of steps in an algorithm is crucial for success. Ever wonder how TikTok knows EXACTLY which video to show you next? 🤔 It's not magic, it's an algorithm! In this lesson, you'll discover the secret recipes, called algorithms, that power everything from your favorite games to GPS directions. Understanding algorithms is the first step to telling computers w...
2

Key Concepts & Vocabulary

TermDefinitionExample AlgorithmA step-by-step set of instructions or rules designed to solve a problem or complete a task.A recipe for baking cookies. Each step must be followed in the correct order to get the cookies. InstructionA single, specific action or command within an algorithm.In a cookie recipe, 'Add 2 cups of flour' is one instruction. SequenceThe specific order in which instructions are performed. Order is very important!You must mix the ingredients *before* you put the cookies in the oven. Changing the sequence ruins the result. InputThe information or materials you start with before running an algorithm.For a cookie recipe, the inputs are the ingredients: flour, sugar, eggs, etc. OutputThe result you get after the algorithm is finished.For a cookie recipe, the outp...
3

Core Syntax & Patterns

Rule 1: Algorithms Must Be Unambiguous (Clear) Each step must have only one meaning and be easy to understand. A computer (or a person) can't guess what you mean. An instruction like 'add a little bit of sugar' is bad because 'a little bit' is not a clear measurement. 'Add 1 teaspoon of sugar' is unambiguous. Rule 2: Algorithms Must Be Finite (Have an End) An algorithm must eventually stop after a specific number of steps. It can't go on forever. A recipe that says 'keep stirring' without telling you when to stop is a broken algorithm. It should say 'stir for 2 minutes or until the mixture is smooth.' Rule 3: Algorithms Must Be Effective (Doable) Each step must be something that can actually be done. An inst...

4 more steps in this tutorial

Sign up free to access the complete tutorial with worked examples and practice.

Sign Up Free to Continue

Sample Practice Questions

Challenging
You write an algorithm for a robot to make a PB&J sandwich. You give it the input (bread, PB, J) and run the algorithm. The output is a sandwich with the peanut butter on the outside of the bread. What is the most likely error in your algorithm?
A.The robot ran out of jelly (bad input).
B.An instruction was ambiguous, like 'Put peanut butter on the bread'.
C.The algorithm was not finite.
D.The robot was not strong enough (ineffective step).
Challenging
You are designing an algorithm for the task 'Plan a surprise birthday party.' Which of the following would be the best high-level, first-sequence of steps?
A.1. Buy a cake. 2. Send invitations. 3. Choose a theme.
B.1. Light the candles. 2. Sing 'Happy Birthday'. 3. Eat cake.
C.1. Choose a date and time. 2. Create a guest list. 3. Send invitations.
D.1. Set a budget. 2. Create a guest list. 3. Choose a date and theme.
Challenging
A robot is programmed with the instruction: 'Step 1: Pick up the fragile glass. Step 2: Move it to the table.' The robot crushes the glass. This instruction failed because it was not 'effective' and was also missing a key detail, making it...
A.Unambiguous, by not specifying how much force to use.
B.Finite, because the robot could not stop.
C.Sequential, because the order was wrong.
D.Efficient, because it was too slow.

Want to practice and check your answers?

Sign up to access all questions with instant feedback, explanations, and progress tracking.

Start Practicing Free

More from Chapter 1: The Magic of Algorithms: From Everyday Life to Computer Code

Ready to find your learning gaps?

Take a free diagnostic test and get a personalized learning plan in minutes.