๐ฏ Grade 5 ยท 3. Algebra
Debugging โ Grade 5 Math Lesson
- 1. ๐ Lesson
- 2. ๐ง Practice
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
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!
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!
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!
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!
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!
More Grade 5 Lessons: 3. Algebra
All Grade 5 lessons โ-
G5 ยท #107
Repeating patterns
๐ง 70 questions ยท ๐ worksheet ยท ๐ฎ game
Open lesson -
G5 ยท #108
Growing patterns
๐ง 70 questions
Open lesson -
G5 ยท #109
Shrinking patterns
๐ง 70 questions
Open lesson -
G5 ยท #110
Numeric patterns
๐ง 70 questions
Open lesson -
G5 ยท #111
Pattern rules
๐ง 67 questions ยท ๐ worksheet
Open lesson -
G5 ยท #112
Predict missing terms
๐ง 70 questions
Open lesson
