๐ŸŽฏ Grade 5 ยท 3. Algebra

Debugging โ€“ Grade 5 Math Lesson

  1. 1. ๐Ÿ“– Lesson
  2. 2. ๐Ÿง  Practice
Free lessons used: 2 of 5 ๐Ÿ”“ Unlock everything

About This Grade 5 Lesson

Topic
Debugging โ€” 3. Algebra unit
Grade & ages
Grade 5 ยท ages 10โ€“11
Curriculum
Ontario Mathematics Curriculum, Grades 1โ€“8 (2020)
In this lesson
Kashef ยท ๐Ÿž Buggy Code vs Fixed Code ยท ๐ŸŽฏ Debug These Patterns!
Created by
The InukMath team
Last updated
October 19, 2026 ยท How we make our lessons

Debugging โ€“ Grade 5 Lesson Notes

A quick written summary of this Grade 5 math lesson from the 3. Algebra unit. Read it with your child, then open the interactive lesson above and try the practice questions.

Kashef

Your super kind Grade 5 math teacher โค๏ธ

Find and Fix the Mistakes

Grade 5 Ontario Math ๐Ÿ“š โ€ข Algebra & Computational Thinking

I'm Kashef and today we're learning Debugging! Debugging means finding mistakes (bugs) in code, sequences, or patterns and fixing them. Even the best programmers debug every day! Ready to become a Bug Hunter? Letโ€™s go! ๐Ÿš€

1. Look for the mistake 2. Understand what went wrong 3. Fix it and test again

๐Ÿž Buggy Code vs Fixed Code

Buggy Code:

Start with 5 REPEAT 3 times: Add 2 Print number โ† Missing step!

Start with 5 REPEAT 3 times: Add 2 Print number

๐ŸŽฏ Debug These Patterns!

1. Buggy sequence: 3, 6, 9, 13, 15

Should be 12 instead of 13 (add 3 each time)

2. Buggy code for pattern โค๏ธ๐Ÿ’›โค๏ธ๐Ÿ’›

REPEAT 4 times: Print โค๏ธ Print ๐Ÿ’› โ† Wrong place!

REPEAT 4 times: Print โค๏ธ then Print ๐Ÿ’›

Problem 1: Your friend wrote steps to make a sandwich but forgot something. Debug it: 1. Get bread 2. Add peanut butter 3. Eat it

Missing: Add jam before eating!

Question: This code should print 10, 15, 20. What is wrong? Start with 5 REPEAT 3 times: Add 5

Kashef is super proud of you! You can now find mistakes and fix them.

Debugging is a super important skill in math, coding, and life โ€” every expert makes mistakes and learns to fix them!

Debugging โ€“ Sample Practice Questions

  1. Sara's pattern is 5, 8, 11, 14, 17 but she wrote 18 next. What is the mistake?

    • A) She should add 3, not 4
    • B) She should subtract
    • C) She should multiply
    • D) She should divide
    Show answer

    Answer: A) She should add 3, not 4 โ€” Wonderful! Each number increases by 3. Next is 17. You found the bug! Great job!

  2. In 28 + 47, Tim added 8+7=15 but wrote 5. What is wrong?

    • A) He forgot to carry 1
    • B) He added wrong
    • C) He subtracted
    • D) He multiplied
    Show answer

    Answer: A) He forgot to carry 1 โ€” Excellent! 8+7=15, carry 1 to tens. You debugged it!

  3. The order of operations 8 + 2 ร— 3 was done as 30. What is the bug?

    • A) He added first instead of multiplying
    • B) He multiplied first
    • C) He subtracted
    • D) He divided
    Show answer

    Answer: A) He added first instead of multiplying โ€” Wonderful! Multiply first: 2ร—3=6, then 8+6=14. Super!

  4. Pattern 20, 18, 16, 14 but next is 13. What is the error?

    • A) Should subtract 2, not 1
    • B) Should add 2
    • C) Should multiply
    • D) Should divide
    Show answer

    Answer: A) Should subtract 2, not 1 โ€” Each number decreases by 2. Next is 12. Champion!

  5. The code n + 3 for 5,8,11,14 but next written 18. Bug?

    • A) Should be 17, added 4 instead of 3
    • B) Should subtract
    • C) Should multiply
    • D) Should divide
    Show answer

    Answer: A) Should be 17, added 4 instead of 3 โ€” Add 3 only. You're shining!

Practise all 48 Debugging questions โ†’

More Grade 5 Lessons: 3. Algebra

All Grade 5 lessons โ†’