KO: Algorithms and Sequences
Subject: Computing | Year: 5
Name: _________________________ Class/Set: ____________ Date: ____________
1. Key Knowledge / Core Facts
- Algorithm: A precise, step-by-step set of instructions to solve a problem or complete a task.
- Computer Programme: An algorithm that has been coded into a language a computer can understand.
- Human vs Computer: Humans can follow vague instructions; computers need every tiny step explained perfectly.
- Input: Information or commands sent into a computer (e.g., clicking a mouse or pressing a key).
- Output: Information or actions produced by a computer (e.g., a sound or an image on a screen).
- Precise Instructions: Every instruction must be clear and 'unambiguous' (it can only mean one thing).
- Order Matters: Changing the order of steps in a sequence will change the final outcome.
- Logic: Using what we know to predict what will happen next in a sequence or programme.
2. Key Vocabulary
- Sequence: Putting instructions in a specific, logical order.
- Selection: A decision point in an algorithm (usually using 'If', 'Then', 'Else').
- Iteration: Repeating a set of instructions (often called a 'loop').
- Decomposition: Breaking a complex problem down into smaller, manageable parts.
- Abstraction: Removing unnecessary details to focus on the important parts of a problem.
- Bug: An error in an algorithm or programme that stops it from working correctly.
- Debugging: The process of finding and fixing errors in code.
- Variables: A piece of information that can change while a programme is running (like a score).
3. Computational Thinking
- Decomposition: Start by breaking the big task (e.g., 'Make Breakfast') into smaller tasks.
- Pattern Recognition: Looking for similarities between different parts of a problem.
- Abstraction: Ignoring the colour of a car when the algorithm only needs to know the speed.
- Algorithmic Thinking: Creating a logical series of steps to achieve the desired goal.
- Evaluation: Checking the finished algorithm to see if it is efficient and successful.
- Logic Reasoning: Explaining why an algorithm produced a specific result.
- Generalisation: Using a solution for one problem to help solve a similar, different problem.
- Systems: Understanding how different algorithms work together to run a whole device.
4. Sequence: The Power of Order
- Step-by-Step: Instructions must follow a clear path from start to finish.
- Initialisation: Setting the starting point for a programme (e.g., 'When Green Flag Clicked').
- Linear Path: A simple sequence where one instruction follows another in a straight line.
- Left-to-Right: In many block-based languages, we read code from top to bottom.
- Outcome: The result of following the sequence exactly as written.
- Instruction Density: Ensuring no steps are skipped (e.g., 'Open door' before 'Walk through').
- Efficiency: Trying to complete the task in the fewest number of steps possible.
- Testing: Running the sequence to see if it reaches the correct end-point.
5. Selection: Making Decisions
- Conditions: A rule that must be met for something to happen (e.g., 'Is the button pressed?').
- If... Then: If a condition is true, then the computer carries out a specific action.
- Else: What the computer does if the 'If' condition is NOT met.
- Branching: When an algorithm splits into two or more different paths based on a decision.
- Boolean: A value that is either True or False (often used in selection).
- Comparison: Using symbols like > (greater than) or = (equal to) to make a choice.
- Sensors: Physical devices that provide data for selection (e.g., light sensors or timers).
- Triggers: An event that causes a selection block to activate.
6. Iteration: Loops and Repeats
- Repeat: Running a set of instructions more than once.
- Count-Controlled Loop: Repeating a sequence a specific number of times (e.g., 'Repeat 10').
- Condition-Controlled Loop: Repeating until something specific happens (e.g., 'Repeat until touching wall').
- Infinite Loop: A loop that never ends (e.g., 'Forever' blocks).
- Efficiency: Using loops to make code shorter and easier to read.
- Nested Loops: Putting a loop inside another loop (e.g., drawing a square 4 times).
- Termination: The point at which a loop stops running.
- Automation: Using loops to allow a computer to do repetitive tasks very quickly.
7. Everyday Algorithms
- Recipe: A kitchen algorithm where the sequence of ingredients is vital.
- Morning Routine: Brushing teeth, getting dressed, and eating (Decomposition).
- Lego Instructions: Visual algorithms used to build complex structures.
- Fire Drill: A safety algorithm followed by the whole school in an emergency.
- Board Games: The rules of a game are the algorithm players must follow.
- Traffic Lights: A sequence of 'Red, Red/Amber, Green, Amber' (Iteration).
- Vending Machine: Uses selection (If credit > price, then dispense snack).
- Sat-Nav: Calculates a sequence of turns to reach a destination.
8. Debugging: Fixing the Code
- Predicting: Looking at code and guessing what will happen before pressing 'Start'.
- Tracing: Following the code step-by-step with your finger to find the error.
- Isolation: Checking one small part of the algorithm at a time.
- Syntax Error: When the 'grammar' of the code is wrong (e.g., a missing block).
- Logic Error: The code runs, but it doesn't do what you wanted it to do.
- Trial and Error: Making small changes and testing the result each time.
- Collaboration: Working with a partner to spot mistakes (Peer-Review).
- Remixing: Changing an existing algorithm to fix it or make it better.
9. Flowchart Symbols
| Symbol Name |
Visual Shape |
Purpose in Algorithm |
| Start/End |
Oval / Capsule |
Marks the beginning or finish of the sequence. |
| Process |
Rectangle |
An action or instruction (e.g., 'Move forward'). |
| Decision |
Diamond |
A question or 'If' statement (Yes/No path). |
| Input/Output |
Parallelogram |
Data entering or leaving the system. |
| Arrow |
Line |
Shows the direction of the 'flow'. |
| Connector |
Small Circle |
Links different parts of a complex chart. |
| Loop |
Return Arrow |
Shows where a sequence repeats. |
| Storage |
Cylinder |
Represents data being saved (Variables). |
10. Logical Reasoning & Predictions
- Dry Run: Testing an algorithm on paper before using a computer.
- Input Change: Predicting how the output changes if we change the input data.
- Step-Skip: Predicting what happens if a specific line of code is deleted.
- Loop-Count: Calculating how many times an action will happen based on the loop number.
- Decision-Path: Mapping out every possible route a 'Diamond' decision could take.
- Variable-Tracking: Keeping track of how a score or timer changes as code runs.
- End-State: Describing exactly what the screen will look like when the code stops.
- Simplification: Identifying parts of an algorithm that are not needed.
⚠ TEACHER’S GUIDANCE
💡 Pedagogical Opportunities
- Model: Use 'Human Robot' activities to demonstrate unambiguous instructions. Have students give you precise directions to make a jam sandwich; if they say "put the jam on the bread," use your hand instead of a knife to show the need for precision.
- Scaffold: For Decomposition, provide a complex image (e.g., a playground) and ask Year 5 students to list the individual algorithms needed for each piece of equipment (swing, slide, roundabout).
- Misconception Alert: Students often confuse Selection (If/Then) with Iteration (Repeat). Use physical games like 'Simon Says' to distinguish: "If I say Simon Says, jump" (Selection) vs "Jump 10 times" (Iteration).
⚠ Safety & Nuance Check
- Online Safety: When discussing algorithms, briefly touch upon how social media algorithms choose what we see. Remind students of the 'Think Before You Click' rule and the importance of balanced screen time.
- Physical Safety: Ensure 'Human Robot' or playground algorithm activities are conducted in a clear space to avoid trips and collisions.
🔑 Answer Key (Mirror Labeling)
- Task 1: Definition Check: Algorithms are step-by-step instructions.
- Task 2: The Three Pillars: Sequence (Order), Selection (Choice), Iteration (Loop).
- Task 3: Bug Hunting: Debugging is the process of finding and fixing errors.
- Task 4: Logic Gates: The Diamond symbol represents a Decision in a flowchart.