Chapter 37: Coding Mathematical Situations with Conditions
Learn Grade 5 mathematics from very beginner explanations through worked examples, practice, reasoning, and review.
Chapter Overview
This chapter teaches Coding Mathematical Situations with Conditions with simple language, step-by-step reasoning, and original worked examples. Technical words are explained in plain language.
Key Technical Terms
- Algorithms and ordered steps (a Grade 5 idea used in this chapter)
- Variables in code (a Grade 5 idea used in this chapter)
- Repeating instructions (a Grade 5 idea used in this chapter)
- Conditional statements (a Grade 5 idea used in this chapter)
- If-then decisions (a Grade 5 idea used in this chapter)
- Using conditions with numbers (a Grade 5 idea used in this chapter)
- Using loops with patterns (a Grade 5 idea used in this chapter)
- Code for growing patterns (a Grade 5 idea used in this chapter)
- Code for ratio patterns (a Grade 5 idea used in this chapter)
- Tracing code outputs (a Grade 5 idea used in this chapter)
How to Learn This Chapter
Read the explanation first, follow the examples one step at a time, cover the answer and retry the problem yourself, then use the practice and review questions to check understanding.
37.1 Algorithms and ordered steps
Algorithms and ordered steps uses clear step-by-step instructions to represent mathematics. Learners trace, test, and revise instructions to understand how changes affect results.
Beginner Note
Begin with meaning and a visual or concrete example. Work one step at a time and check the answer before moving on.
10 Worked Examples with Answers and Very-Beginner Explanations
Worked Example 1
Problem: In your own words, what is the main idea of Algorithms and ordered steps?
- Read the topic name carefully.
- Identify the quantity, relationship, shape, or process it describes.
- Explain the idea without using a memorized sentence.
Very beginner explanation: Algorithms and ordered steps uses clear step-by-step instructions to represent mathematics. Learners trace, test, and revise instructions to understand how changes affect results.
Answer: Algorithms and ordered steps uses clear step-by-step instructions to represent mathematics. Learners trace, test, and revise instructions to understand how changes affect results.
Worked Example 2
Problem: What should you identify first before solving a problem about Algorithms and ordered steps?
- Read the complete problem.
- Mark the information that is given.
- Identify exactly what the question asks you to find.
Very beginner explanation: Algorithms and ordered steps uses clear step-by-step instructions to represent mathematics. Learners trace, test, and revise instructions to understand how changes affect results.
Answer: Identify the known information and the unknown before choosing an operation or rule.
Worked Example 3
Problem: Choose a useful representation for Algorithms and ordered steps.
- Decide whether a model, number line, table, graph, diagram, equation, or labelled calculation best fits the idea.
- Label the representation clearly.
- Check that it matches the mathematical relationship.
Very beginner explanation: Algorithms and ordered steps uses clear step-by-step instructions to represent mathematics. Learners trace, test, and revise instructions to understand how changes affect results.
Answer: Use the representation that makes the important relationship easiest to see and check.
Worked Example 4
Problem: A learner gets an answer in a Algorithms and ordered steps problem. How can the learner check it?
- Estimate the expected size or direction of the answer.
- Check units, labels, signs, and place values.
- Use an inverse operation or a second method when possible.
Very beginner explanation: Algorithms and ordered steps uses clear step-by-step instructions to represent mathematics. Learners trace, test, and revise instructions to understand how changes affect results.
Answer: The answer should agree with an estimate, the problem conditions, and a second check.
Worked Example 5
Problem: Give a real-life use for Algorithms and ordered steps.
- Think about money, measurement, data, patterns, design, or everyday quantities.
- Choose a situation where the topic helps compare, calculate, measure, predict, or organize.
- Explain the connection in one sentence.
Very beginner explanation: Algorithms and ordered steps uses clear step-by-step instructions to represent mathematics. Learners trace, test, and revise instructions to understand how changes affect results.
Answer: Algorithms and ordered steps can be used in a real situation where mathematics helps make a clear calculation, comparison, measurement, prediction, or decision.
Worked Example 6
Problem: Tile a floor
- Write a simple rule: area = length × width.
- State any assumptions.
- Use the rule on sample values.
- Check whether the result is realistic.
Very beginner explanation: Coding and modelling organize a real situation into clear steps, variables, rules, and checks.
Answer: Estimate tile quantity and include a small waste allowance.
Worked Example 7
Problem: Plan monthly savings
- Write a simple rule: total = starting amount + monthly deposit × months.
- State any assumptions.
- Use the rule on sample values.
- Check whether the result is realistic.
Very beginner explanation: Coding and modelling organize a real situation into clear steps, variables, rules, and checks.
Answer: Predict when the savings goal is reached.
Worked Example 8
Problem: Simulate a die
- Write a simple rule: generate a random whole number from 1 to 6.
- State any assumptions.
- Use the rule on sample values.
- Check whether the result is realistic.
Very beginner explanation: Coding and modelling organize a real situation into clear steps, variables, rules, and checks.
Answer: Repeat many times and compare frequencies.
Worked Example 9
Problem: Translate a point
- Write a simple rule: new x = x + 3; new y = y - 2.
- State any assumptions.
- Use the rule on sample values.
- Check whether the result is realistic.
Very beginner explanation: Coding and modelling organize a real situation into clear steps, variables, rules, and checks.
Answer: Apply the same rule to every point.
Worked Example 10
Problem: Estimate paint needed
- Write a simple rule: paint = wall area ÷ coverage per can.
- State any assumptions.
- Use the rule on sample values.
- Check whether the result is realistic.
Very beginner explanation: Coding and modelling organize a real situation into clear steps, variables, rules, and checks.
Answer: Round up because a partial can may not be enough.
Practice Exercise
Create one new question about Algorithms and ordered steps. Solve it step by step, include units or labels when needed, and check whether your answer is reasonable.
37.2 Variables in code
Variables in code introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Beginner Note
Begin with meaning and a visual or concrete example. Work one step at a time and check the answer before moving on.
10 Worked Examples with Answers and Very-Beginner Explanations
Worked Example 1
Problem: In your own words, what is the main idea of Variables in code?
- Read the topic name carefully.
- Identify the quantity, relationship, shape, or process it describes.
- Explain the idea without using a memorized sentence.
Very beginner explanation: Variables in code introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Answer: Variables in code introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Worked Example 2
Problem: What should you identify first before solving a problem about Variables in code?
- Read the complete problem.
- Mark the information that is given.
- Identify exactly what the question asks you to find.
Very beginner explanation: Variables in code introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Answer: Identify the known information and the unknown before choosing an operation or rule.
Worked Example 3
Problem: Choose a useful representation for Variables in code.
- Decide whether a model, number line, table, graph, diagram, equation, or labelled calculation best fits the idea.
- Label the representation clearly.
- Check that it matches the mathematical relationship.
Very beginner explanation: Variables in code introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Answer: Use the representation that makes the important relationship easiest to see and check.
Worked Example 4
Problem: A learner gets an answer in a Variables in code problem. How can the learner check it?
- Estimate the expected size or direction of the answer.
- Check units, labels, signs, and place values.
- Use an inverse operation or a second method when possible.
Very beginner explanation: Variables in code introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Answer: The answer should agree with an estimate, the problem conditions, and a second check.
Worked Example 5
Problem: Give a real-life use for Variables in code.
- Think about money, measurement, data, patterns, design, or everyday quantities.
- Choose a situation where the topic helps compare, calculate, measure, predict, or organize.
- Explain the connection in one sentence.
Very beginner explanation: Variables in code introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Answer: Variables in code can be used in a real situation where mathematics helps make a clear calculation, comparison, measurement, prediction, or decision.
Worked Example 6
Problem: Simplify 3x + 4x.
- Identify like terms or distribute first if parentheses are present.
- Combine coefficients carefully.
Very beginner explanation: Like terms have the same variable part. The distributive property multiplies every term inside parentheses.
Answer: 7x
Worked Example 7
Problem: Simplify 8y - 3y + 2.
- Identify like terms or distribute first if parentheses are present.
- Combine coefficients carefully.
Very beginner explanation: Like terms have the same variable part. The distributive property multiplies every term inside parentheses.
Answer: 5y + 2
Worked Example 8
Problem: Simplify 4(a + 2).
- Identify like terms or distribute first if parentheses are present.
- Combine coefficients carefully.
Very beginner explanation: Like terms have the same variable part. The distributive property multiplies every term inside parentheses.
Answer: 4a + 8
Worked Example 9
Problem: Simplify 2(3x - 5) + x.
- Identify like terms or distribute first if parentheses are present.
- Combine coefficients carefully.
Very beginner explanation: Like terms have the same variable part. The distributive property multiplies every term inside parentheses.
Answer: 7x - 10
Worked Example 10
Problem: Simplify 6m + 7 - 2m - 3.
- Identify like terms or distribute first if parentheses are present.
- Combine coefficients carefully.
Very beginner explanation: Like terms have the same variable part. The distributive property multiplies every term inside parentheses.
Answer: 4m + 4
Practice Exercise
Create one new question about Variables in code. Solve it step by step, include units or labels when needed, and check whether your answer is reasonable.
37.3 Repeating instructions
Repeating instructions is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Beginner Note
Begin with meaning and a visual or concrete example. Work one step at a time and check the answer before moving on.
10 Worked Examples with Answers and Very-Beginner Explanations
Worked Example 1
Problem: In your own words, what is the main idea of Repeating instructions?
- Read the topic name carefully.
- Identify the quantity, relationship, shape, or process it describes.
- Explain the idea without using a memorized sentence.
Very beginner explanation: Repeating instructions is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Answer: Repeating instructions is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Worked Example 2
Problem: What should you identify first before solving a problem about Repeating instructions?
- Read the complete problem.
- Mark the information that is given.
- Identify exactly what the question asks you to find.
Very beginner explanation: Repeating instructions is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Answer: Identify the known information and the unknown before choosing an operation or rule.
Worked Example 3
Problem: Choose a useful representation for Repeating instructions.
- Decide whether a model, number line, table, graph, diagram, equation, or labelled calculation best fits the idea.
- Label the representation clearly.
- Check that it matches the mathematical relationship.
Very beginner explanation: Repeating instructions is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Answer: Use the representation that makes the important relationship easiest to see and check.
Worked Example 4
Problem: A learner gets an answer in a Repeating instructions problem. How can the learner check it?
- Estimate the expected size or direction of the answer.
- Check units, labels, signs, and place values.
- Use an inverse operation or a second method when possible.
Very beginner explanation: Repeating instructions is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Answer: The answer should agree with an estimate, the problem conditions, and a second check.
Worked Example 5
Problem: Give a real-life use for Repeating instructions.
- Think about money, measurement, data, patterns, design, or everyday quantities.
- Choose a situation where the topic helps compare, calculate, measure, predict, or organize.
- Explain the connection in one sentence.
Very beginner explanation: Repeating instructions is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Answer: Repeating instructions can be used in a real situation where mathematics helps make a clear calculation, comparison, measurement, prediction, or decision.
Worked Example 6
Problem: Show why 3/5 is a rational number.
- A rational number can be written as a fraction of integers.
- Rewrite the given number as a fraction if needed.
Very beginner explanation: If a number can be written as a/b where a and b are integers and b is not zero, it is rational.
Answer: 3/5 = 0.6
Worked Example 7
Problem: Show why -7 is a rational number.
- A rational number can be written as a fraction of integers.
- Rewrite the given number as a fraction if needed.
Very beginner explanation: If a number can be written as a/b where a and b are integers and b is not zero, it is rational.
Answer: -7 = -7/1
Worked Example 8
Problem: Show why 0.25 is a rational number.
- A rational number can be written as a fraction of integers.
- Rewrite the given number as a fraction if needed.
Very beginner explanation: If a number can be written as a/b where a and b are integers and b is not zero, it is rational.
Answer: 0.25 = 1/4
Worked Example 9
Problem: Show why 0.666… is a rational number.
- A rational number can be written as a fraction of integers.
- Rewrite the given number as a fraction if needed.
Very beginner explanation: If a number can be written as a/b where a and b are integers and b is not zero, it is rational.
Answer: 0.666… = 2/3
Worked Example 10
Problem: Show why 1.4 is a rational number.
- A rational number can be written as a fraction of integers.
- Rewrite the given number as a fraction if needed.
Very beginner explanation: If a number can be written as a/b where a and b are integers and b is not zero, it is rational.
Answer: 1.4 = 7/5
Practice Exercise
Create one new question about Repeating instructions. Solve it step by step, include units or labels when needed, and check whether your answer is reasonable.
37.4 Conditional statements
Conditional statements is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Beginner Note
Begin with meaning and a visual or concrete example. Work one step at a time and check the answer before moving on.
10 Worked Examples with Answers and Very-Beginner Explanations
Worked Example 1
Problem: In your own words, what is the main idea of Conditional statements?
- Read the topic name carefully.
- Identify the quantity, relationship, shape, or process it describes.
- Explain the idea without using a memorized sentence.
Very beginner explanation: Conditional statements is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Answer: Conditional statements is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Worked Example 2
Problem: What should you identify first before solving a problem about Conditional statements?
- Read the complete problem.
- Mark the information that is given.
- Identify exactly what the question asks you to find.
Very beginner explanation: Conditional statements is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Answer: Identify the known information and the unknown before choosing an operation or rule.
Worked Example 3
Problem: Choose a useful representation for Conditional statements.
- Decide whether a model, number line, table, graph, diagram, equation, or labelled calculation best fits the idea.
- Label the representation clearly.
- Check that it matches the mathematical relationship.
Very beginner explanation: Conditional statements is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Answer: Use the representation that makes the important relationship easiest to see and check.
Worked Example 4
Problem: A learner gets an answer in a Conditional statements problem. How can the learner check it?
- Estimate the expected size or direction of the answer.
- Check units, labels, signs, and place values.
- Use an inverse operation or a second method when possible.
Very beginner explanation: Conditional statements is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Answer: The answer should agree with an estimate, the problem conditions, and a second check.
Worked Example 5
Problem: Give a real-life use for Conditional statements.
- Think about money, measurement, data, patterns, design, or everyday quantities.
- Choose a situation where the topic helps compare, calculate, measure, predict, or organize.
- Explain the connection in one sentence.
Very beginner explanation: Conditional statements is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Answer: Conditional statements can be used in a real situation where mathematics helps make a clear calculation, comparison, measurement, prediction, or decision.
Worked Example 6
Problem: Tile a floor
- Write a simple rule: area = length × width.
- State any assumptions.
- Use the rule on sample values.
- Check whether the result is realistic.
Very beginner explanation: Coding and modelling organize a real situation into clear steps, variables, rules, and checks.
Answer: Estimate tile quantity and include a small waste allowance.
Worked Example 7
Problem: Plan monthly savings
- Write a simple rule: total = starting amount + monthly deposit × months.
- State any assumptions.
- Use the rule on sample values.
- Check whether the result is realistic.
Very beginner explanation: Coding and modelling organize a real situation into clear steps, variables, rules, and checks.
Answer: Predict when the savings goal is reached.
Worked Example 8
Problem: Simulate a die
- Write a simple rule: generate a random whole number from 1 to 6.
- State any assumptions.
- Use the rule on sample values.
- Check whether the result is realistic.
Very beginner explanation: Coding and modelling organize a real situation into clear steps, variables, rules, and checks.
Answer: Repeat many times and compare frequencies.
Worked Example 9
Problem: Translate a point
- Write a simple rule: new x = x + 3; new y = y - 2.
- State any assumptions.
- Use the rule on sample values.
- Check whether the result is realistic.
Very beginner explanation: Coding and modelling organize a real situation into clear steps, variables, rules, and checks.
Answer: Apply the same rule to every point.
Worked Example 10
Problem: Estimate paint needed
- Write a simple rule: paint = wall area ÷ coverage per can.
- State any assumptions.
- Use the rule on sample values.
- Check whether the result is realistic.
Very beginner explanation: Coding and modelling organize a real situation into clear steps, variables, rules, and checks.
Answer: Round up because a partial can may not be enough.
Practice Exercise
Create one new question about Conditional statements. Solve it step by step, include units or labels when needed, and check whether your answer is reasonable.
37.5 If-then decisions
If-then decisions is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Beginner Note
Begin with meaning and a visual or concrete example. Work one step at a time and check the answer before moving on.
10 Worked Examples with Answers and Very-Beginner Explanations
Worked Example 1
Problem: In your own words, what is the main idea of If-then decisions?
- Read the topic name carefully.
- Identify the quantity, relationship, shape, or process it describes.
- Explain the idea without using a memorized sentence.
Very beginner explanation: If-then decisions is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Answer: If-then decisions is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Worked Example 2
Problem: What should you identify first before solving a problem about If-then decisions?
- Read the complete problem.
- Mark the information that is given.
- Identify exactly what the question asks you to find.
Very beginner explanation: If-then decisions is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Answer: Identify the known information and the unknown before choosing an operation or rule.
Worked Example 3
Problem: Choose a useful representation for If-then decisions.
- Decide whether a model, number line, table, graph, diagram, equation, or labelled calculation best fits the idea.
- Label the representation clearly.
- Check that it matches the mathematical relationship.
Very beginner explanation: If-then decisions is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Answer: Use the representation that makes the important relationship easiest to see and check.
Worked Example 4
Problem: A learner gets an answer in a If-then decisions problem. How can the learner check it?
- Estimate the expected size or direction of the answer.
- Check units, labels, signs, and place values.
- Use an inverse operation or a second method when possible.
Very beginner explanation: If-then decisions is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Answer: The answer should agree with an estimate, the problem conditions, and a second check.
Worked Example 5
Problem: Give a real-life use for If-then decisions.
- Think about money, measurement, data, patterns, design, or everyday quantities.
- Choose a situation where the topic helps compare, calculate, measure, predict, or organize.
- Explain the connection in one sentence.
Very beginner explanation: If-then decisions is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Answer: If-then decisions can be used in a real situation where mathematics helps make a clear calculation, comparison, measurement, prediction, or decision.
Worked Example 6
Problem: Explain If-then decisions in one simple sentence.
- Read the definition of the topic.
- Use the definition to build the response.
- Check that the response matches every important condition.
Very beginner explanation: If-then decisions becomes easier to understand when you connect its definition to examples, non-examples, and representations.
Answer: State the meaning, then give one small example.
Worked Example 7
Problem: Give one example that does not satisfy If-then decisions and explain why.
- Read the definition of the topic.
- Use the definition to build the response.
- Check that the response matches every important condition.
Very beginner explanation: If-then decisions becomes easier to understand when you connect its definition to examples, non-examples, and representations.
Answer: Identify the rule or condition that fails.
Worked Example 8
Problem: Show If-then decisions using a table, diagram, number line, graph, or equation.
- Read the definition of the topic.
- Use the definition to build the response.
- Check that the response matches every important condition.
Very beginner explanation: If-then decisions becomes easier to understand when you connect its definition to examples, non-examples, and representations.
Answer: Choose the representation that makes the relationship easiest to see.
Worked Example 9
Problem: After solving a If-then decisions problem, how can you check the answer?
- Read the definition of the topic.
- Use the definition to build the response.
- Check that the response matches every important condition.
Very beginner explanation: If-then decisions becomes easier to understand when you connect its definition to examples, non-examples, and representations.
Answer: Use estimation, an inverse operation, substitution, or a second representation.
Worked Example 10
Problem: Give one real-life situation where If-then decisions could be useful.
- Read the definition of the topic.
- Use the definition to build the response.
- Check that the response matches every important condition.
Very beginner explanation: If-then decisions becomes easier to understand when you connect its definition to examples, non-examples, and representations.
Answer: Connect the idea to money, measurement, data, design, or technology.
Practice Exercise
Create one new question about If-then decisions. Solve it step by step, include units or labels when needed, and check whether your answer is reasonable.
37.6 Using conditions with numbers
Using conditions with numbers is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Beginner Note
Begin with meaning and a visual or concrete example. Work one step at a time and check the answer before moving on.
10 Worked Examples with Answers and Very-Beginner Explanations
Worked Example 1
Problem: In your own words, what is the main idea of Using conditions with numbers?
- Read the topic name carefully.
- Identify the quantity, relationship, shape, or process it describes.
- Explain the idea without using a memorized sentence.
Very beginner explanation: Using conditions with numbers is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Answer: Using conditions with numbers is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Worked Example 2
Problem: What should you identify first before solving a problem about Using conditions with numbers?
- Read the complete problem.
- Mark the information that is given.
- Identify exactly what the question asks you to find.
Very beginner explanation: Using conditions with numbers is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Answer: Identify the known information and the unknown before choosing an operation or rule.
Worked Example 3
Problem: Choose a useful representation for Using conditions with numbers.
- Decide whether a model, number line, table, graph, diagram, equation, or labelled calculation best fits the idea.
- Label the representation clearly.
- Check that it matches the mathematical relationship.
Very beginner explanation: Using conditions with numbers is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Answer: Use the representation that makes the important relationship easiest to see and check.
Worked Example 4
Problem: A learner gets an answer in a Using conditions with numbers problem. How can the learner check it?
- Estimate the expected size or direction of the answer.
- Check units, labels, signs, and place values.
- Use an inverse operation or a second method when possible.
Very beginner explanation: Using conditions with numbers is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Answer: The answer should agree with an estimate, the problem conditions, and a second check.
Worked Example 5
Problem: Give a real-life use for Using conditions with numbers.
- Think about money, measurement, data, patterns, design, or everyday quantities.
- Choose a situation where the topic helps compare, calculate, measure, predict, or organize.
- Explain the connection in one sentence.
Very beginner explanation: Using conditions with numbers is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Answer: Using conditions with numbers can be used in a real situation where mathematics helps make a clear calculation, comparison, measurement, prediction, or decision.
Worked Example 6
Problem: Tile a floor
- Write a simple rule: area = length × width.
- State any assumptions.
- Use the rule on sample values.
- Check whether the result is realistic.
Very beginner explanation: Coding and modelling organize a real situation into clear steps, variables, rules, and checks.
Answer: Estimate tile quantity and include a small waste allowance.
Worked Example 7
Problem: Plan monthly savings
- Write a simple rule: total = starting amount + monthly deposit × months.
- State any assumptions.
- Use the rule on sample values.
- Check whether the result is realistic.
Very beginner explanation: Coding and modelling organize a real situation into clear steps, variables, rules, and checks.
Answer: Predict when the savings goal is reached.
Worked Example 8
Problem: Simulate a die
- Write a simple rule: generate a random whole number from 1 to 6.
- State any assumptions.
- Use the rule on sample values.
- Check whether the result is realistic.
Very beginner explanation: Coding and modelling organize a real situation into clear steps, variables, rules, and checks.
Answer: Repeat many times and compare frequencies.
Worked Example 9
Problem: Translate a point
- Write a simple rule: new x = x + 3; new y = y - 2.
- State any assumptions.
- Use the rule on sample values.
- Check whether the result is realistic.
Very beginner explanation: Coding and modelling organize a real situation into clear steps, variables, rules, and checks.
Answer: Apply the same rule to every point.
Worked Example 10
Problem: Estimate paint needed
- Write a simple rule: paint = wall area ÷ coverage per can.
- State any assumptions.
- Use the rule on sample values.
- Check whether the result is realistic.
Very beginner explanation: Coding and modelling organize a real situation into clear steps, variables, rules, and checks.
Answer: Round up because a partial can may not be enough.
Practice Exercise
Create one new question about Using conditions with numbers. Solve it step by step, include units or labels when needed, and check whether your answer is reasonable.
37.7 Using loops with patterns
Using loops with patterns introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Beginner Note
Begin with meaning and a visual or concrete example. Work one step at a time and check the answer before moving on.
10 Worked Examples with Answers and Very-Beginner Explanations
Worked Example 1
Problem: In your own words, what is the main idea of Using loops with patterns?
- Read the topic name carefully.
- Identify the quantity, relationship, shape, or process it describes.
- Explain the idea without using a memorized sentence.
Very beginner explanation: Using loops with patterns introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Answer: Using loops with patterns introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Worked Example 2
Problem: What should you identify first before solving a problem about Using loops with patterns?
- Read the complete problem.
- Mark the information that is given.
- Identify exactly what the question asks you to find.
Very beginner explanation: Using loops with patterns introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Answer: Identify the known information and the unknown before choosing an operation or rule.
Worked Example 3
Problem: Choose a useful representation for Using loops with patterns.
- Decide whether a model, number line, table, graph, diagram, equation, or labelled calculation best fits the idea.
- Label the representation clearly.
- Check that it matches the mathematical relationship.
Very beginner explanation: Using loops with patterns introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Answer: Use the representation that makes the important relationship easiest to see and check.
Worked Example 4
Problem: A learner gets an answer in a Using loops with patterns problem. How can the learner check it?
- Estimate the expected size or direction of the answer.
- Check units, labels, signs, and place values.
- Use an inverse operation or a second method when possible.
Very beginner explanation: Using loops with patterns introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Answer: The answer should agree with an estimate, the problem conditions, and a second check.
Worked Example 5
Problem: Give a real-life use for Using loops with patterns.
- Think about money, measurement, data, patterns, design, or everyday quantities.
- Choose a situation where the topic helps compare, calculate, measure, predict, or organize.
- Explain the connection in one sentence.
Very beginner explanation: Using loops with patterns introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Answer: Using loops with patterns can be used in a real situation where mathematics helps make a clear calculation, comparison, measurement, prediction, or decision.
Worked Example 6
Problem: Continue the pattern 2, 5, 8, ... for two more terms.
- The common difference is 3.
- Add the same difference each time.
Very beginner explanation: A constant-difference pattern changes by the same amount from one term to the next.
Answer: 11, 14
Worked Example 7
Problem: Continue the pattern 5, 9, 13, ... for two more terms.
- The common difference is 4.
- Add the same difference each time.
Very beginner explanation: A constant-difference pattern changes by the same amount from one term to the next.
Answer: 17, 21
Worked Example 8
Problem: Continue the pattern 10, 8, 6, ... for two more terms.
- The common difference is -2.
- Add the same difference each time.
Very beginner explanation: A constant-difference pattern changes by the same amount from one term to the next.
Answer: 4, 2
Worked Example 9
Problem: Continue the pattern 1.5, 2, 2.5, ... for two more terms.
- The common difference is 0.5.
- Add the same difference each time.
Very beginner explanation: A constant-difference pattern changes by the same amount from one term to the next.
Answer: 3, 3.5
Worked Example 10
Problem: Continue the pattern 20, 17.5, 15, ... for two more terms.
- The common difference is -2.5.
- Add the same difference each time.
Very beginner explanation: A constant-difference pattern changes by the same amount from one term to the next.
Answer: 12.5, 10
Practice Exercise
Create one new question about Using loops with patterns. Solve it step by step, include units or labels when needed, and check whether your answer is reasonable.
37.8 Code for growing patterns
Code for growing patterns introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Beginner Note
Begin with meaning and a visual or concrete example. Work one step at a time and check the answer before moving on.
10 Worked Examples with Answers and Very-Beginner Explanations
Worked Example 1
Problem: In your own words, what is the main idea of Code for growing patterns?
- Read the topic name carefully.
- Identify the quantity, relationship, shape, or process it describes.
- Explain the idea without using a memorized sentence.
Very beginner explanation: Code for growing patterns introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Answer: Code for growing patterns introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Worked Example 2
Problem: What should you identify first before solving a problem about Code for growing patterns?
- Read the complete problem.
- Mark the information that is given.
- Identify exactly what the question asks you to find.
Very beginner explanation: Code for growing patterns introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Answer: Identify the known information and the unknown before choosing an operation or rule.
Worked Example 3
Problem: Choose a useful representation for Code for growing patterns.
- Decide whether a model, number line, table, graph, diagram, equation, or labelled calculation best fits the idea.
- Label the representation clearly.
- Check that it matches the mathematical relationship.
Very beginner explanation: Code for growing patterns introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Answer: Use the representation that makes the important relationship easiest to see and check.
Worked Example 4
Problem: A learner gets an answer in a Code for growing patterns problem. How can the learner check it?
- Estimate the expected size or direction of the answer.
- Check units, labels, signs, and place values.
- Use an inverse operation or a second method when possible.
Very beginner explanation: Code for growing patterns introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Answer: The answer should agree with an estimate, the problem conditions, and a second check.
Worked Example 5
Problem: Give a real-life use for Code for growing patterns.
- Think about money, measurement, data, patterns, design, or everyday quantities.
- Choose a situation where the topic helps compare, calculate, measure, predict, or organize.
- Explain the connection in one sentence.
Very beginner explanation: Code for growing patterns introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Answer: Code for growing patterns can be used in a real situation where mathematics helps make a clear calculation, comparison, measurement, prediction, or decision.
Worked Example 6
Problem: Continue the pattern 2, 5, 8, ... for two more terms.
- The common difference is 3.
- Add the same difference each time.
Very beginner explanation: A constant-difference pattern changes by the same amount from one term to the next.
Answer: 11, 14
Worked Example 7
Problem: Continue the pattern 5, 9, 13, ... for two more terms.
- The common difference is 4.
- Add the same difference each time.
Very beginner explanation: A constant-difference pattern changes by the same amount from one term to the next.
Answer: 17, 21
Worked Example 8
Problem: Continue the pattern 10, 8, 6, ... for two more terms.
- The common difference is -2.
- Add the same difference each time.
Very beginner explanation: A constant-difference pattern changes by the same amount from one term to the next.
Answer: 4, 2
Worked Example 9
Problem: Continue the pattern 1.5, 2, 2.5, ... for two more terms.
- The common difference is 0.5.
- Add the same difference each time.
Very beginner explanation: A constant-difference pattern changes by the same amount from one term to the next.
Answer: 3, 3.5
Worked Example 10
Problem: Continue the pattern 20, 17.5, 15, ... for two more terms.
- The common difference is -2.5.
- Add the same difference each time.
Very beginner explanation: A constant-difference pattern changes by the same amount from one term to the next.
Answer: 12.5, 10
Practice Exercise
Create one new question about Code for growing patterns. Solve it step by step, include units or labels when needed, and check whether your answer is reasonable.
37.9 Code for ratio patterns
Code for ratio patterns compares quantities. Equivalent ratios and unit rates help learners scale situations and compare choices fairly.
Beginner Note
Begin with meaning and a visual or concrete example. Work one step at a time and check the answer before moving on.
10 Worked Examples with Answers and Very-Beginner Explanations
Worked Example 1
Problem: In your own words, what is the main idea of Code for ratio patterns?
- Read the topic name carefully.
- Identify the quantity, relationship, shape, or process it describes.
- Explain the idea without using a memorized sentence.
Very beginner explanation: Code for ratio patterns compares quantities. Equivalent ratios and unit rates help learners scale situations and compare choices fairly.
Answer: Code for ratio patterns compares quantities. Equivalent ratios and unit rates help learners scale situations and compare choices fairly.
Worked Example 2
Problem: What should you identify first before solving a problem about Code for ratio patterns?
- Read the complete problem.
- Mark the information that is given.
- Identify exactly what the question asks you to find.
Very beginner explanation: Code for ratio patterns compares quantities. Equivalent ratios and unit rates help learners scale situations and compare choices fairly.
Answer: Identify the known information and the unknown before choosing an operation or rule.
Worked Example 3
Problem: Choose a useful representation for Code for ratio patterns.
- Decide whether a model, number line, table, graph, diagram, equation, or labelled calculation best fits the idea.
- Label the representation clearly.
- Check that it matches the mathematical relationship.
Very beginner explanation: Code for ratio patterns compares quantities. Equivalent ratios and unit rates help learners scale situations and compare choices fairly.
Answer: Use the representation that makes the important relationship easiest to see and check.
Worked Example 4
Problem: A learner gets an answer in a Code for ratio patterns problem. How can the learner check it?
- Estimate the expected size or direction of the answer.
- Check units, labels, signs, and place values.
- Use an inverse operation or a second method when possible.
Very beginner explanation: Code for ratio patterns compares quantities. Equivalent ratios and unit rates help learners scale situations and compare choices fairly.
Answer: The answer should agree with an estimate, the problem conditions, and a second check.
Worked Example 5
Problem: Give a real-life use for Code for ratio patterns.
- Think about money, measurement, data, patterns, design, or everyday quantities.
- Choose a situation where the topic helps compare, calculate, measure, predict, or organize.
- Explain the connection in one sentence.
Very beginner explanation: Code for ratio patterns compares quantities. Equivalent ratios and unit rates help learners scale situations and compare choices fairly.
Answer: Code for ratio patterns can be used in a real situation where mathematics helps make a clear calculation, comparison, measurement, prediction, or decision.
Worked Example 6
Problem: Simplify the ratio 4:6.
- Find the greatest common factor, 2.
- Divide both terms by 2.
Very beginner explanation: Simplifying a ratio is like simplifying a fraction: divide both quantities by the same common factor.
Answer: 2:3
Worked Example 7
Problem: Simplify the ratio 8:12.
- Find the greatest common factor, 4.
- Divide both terms by 4.
Very beginner explanation: Simplifying a ratio is like simplifying a fraction: divide both quantities by the same common factor.
Answer: 2:3
Worked Example 8
Problem: Simplify the ratio 15:25.
- Find the greatest common factor, 5.
- Divide both terms by 5.
Very beginner explanation: Simplifying a ratio is like simplifying a fraction: divide both quantities by the same common factor.
Answer: 3:5
Worked Example 9
Problem: Simplify the ratio 18:30.
- Find the greatest common factor, 6.
- Divide both terms by 6.
Very beginner explanation: Simplifying a ratio is like simplifying a fraction: divide both quantities by the same common factor.
Answer: 3:5
Worked Example 10
Problem: Simplify the ratio 21:28.
- Find the greatest common factor, 7.
- Divide both terms by 7.
Very beginner explanation: Simplifying a ratio is like simplifying a fraction: divide both quantities by the same common factor.
Answer: 3:4
Practice Exercise
Create one new question about Code for ratio patterns. Solve it step by step, include units or labels when needed, and check whether your answer is reasonable.
37.10 Tracing code outputs
Tracing code outputs uses clear step-by-step instructions to represent mathematics. Learners trace, test, and revise instructions to understand how changes affect results.
Beginner Note
Begin with meaning and a visual or concrete example. Work one step at a time and check the answer before moving on.
10 Worked Examples with Answers and Very-Beginner Explanations
Worked Example 1
Problem: In your own words, what is the main idea of Tracing code outputs?
- Read the topic name carefully.
- Identify the quantity, relationship, shape, or process it describes.
- Explain the idea without using a memorized sentence.
Very beginner explanation: Tracing code outputs uses clear step-by-step instructions to represent mathematics. Learners trace, test, and revise instructions to understand how changes affect results.
Answer: Tracing code outputs uses clear step-by-step instructions to represent mathematics. Learners trace, test, and revise instructions to understand how changes affect results.
Worked Example 2
Problem: What should you identify first before solving a problem about Tracing code outputs?
- Read the complete problem.
- Mark the information that is given.
- Identify exactly what the question asks you to find.
Very beginner explanation: Tracing code outputs uses clear step-by-step instructions to represent mathematics. Learners trace, test, and revise instructions to understand how changes affect results.
Answer: Identify the known information and the unknown before choosing an operation or rule.
Worked Example 3
Problem: Choose a useful representation for Tracing code outputs.
- Decide whether a model, number line, table, graph, diagram, equation, or labelled calculation best fits the idea.
- Label the representation clearly.
- Check that it matches the mathematical relationship.
Very beginner explanation: Tracing code outputs uses clear step-by-step instructions to represent mathematics. Learners trace, test, and revise instructions to understand how changes affect results.
Answer: Use the representation that makes the important relationship easiest to see and check.
Worked Example 4
Problem: A learner gets an answer in a Tracing code outputs problem. How can the learner check it?
- Estimate the expected size or direction of the answer.
- Check units, labels, signs, and place values.
- Use an inverse operation or a second method when possible.
Very beginner explanation: Tracing code outputs uses clear step-by-step instructions to represent mathematics. Learners trace, test, and revise instructions to understand how changes affect results.
Answer: The answer should agree with an estimate, the problem conditions, and a second check.
Worked Example 5
Problem: Give a real-life use for Tracing code outputs.
- Think about money, measurement, data, patterns, design, or everyday quantities.
- Choose a situation where the topic helps compare, calculate, measure, predict, or organize.
- Explain the connection in one sentence.
Very beginner explanation: Tracing code outputs uses clear step-by-step instructions to represent mathematics. Learners trace, test, and revise instructions to understand how changes affect results.
Answer: Tracing code outputs can be used in a real situation where mathematics helps make a clear calculation, comparison, measurement, prediction, or decision.
Worked Example 6
Problem: For y = 2x + (1), find y when x = 3.
- Substitute x = 3.
- y = 2(3) + (1).
- Multiply first, then add.
Very beginner explanation: A relation pairs inputs with outputs. In a linear relation, the rate of change is constant.
Answer: 7
Worked Example 7
Problem: For y = -1x + (4), find y when x = 3.
- Substitute x = 3.
- y = -1(3) + (4).
- Multiply first, then add.
Very beginner explanation: A relation pairs inputs with outputs. In a linear relation, the rate of change is constant.
Answer: 1
Worked Example 8
Problem: For y = 0.5x + (-2), find y when x = 3.
- Substitute x = 3.
- y = 0.5(3) + (-2).
- Multiply first, then add.
Very beginner explanation: A relation pairs inputs with outputs. In a linear relation, the rate of change is constant.
Answer: -0.5
Worked Example 9
Problem: For y = 3x + (0), find y when x = 3.
- Substitute x = 3.
- y = 3(3) + (0).
- Multiply first, then add.
Very beginner explanation: A relation pairs inputs with outputs. In a linear relation, the rate of change is constant.
Answer: 9
Worked Example 10
Problem: For y = -2x + (5), find y when x = 3.
- Substitute x = 3.
- y = -2(3) + (5).
- Multiply first, then add.
Very beginner explanation: A relation pairs inputs with outputs. In a linear relation, the rate of change is constant.
Answer: -1
Practice Exercise
Create one new question about Tracing code outputs. Solve it step by step, include units or labels when needed, and check whether your answer is reasonable.
Chapter Notes, Practice, and Common Mistakes
Chapter Notes
- Read the question before calculating.
- Represent the mathematics with a model, table, graph, diagram, number line, or equation when useful.
- Show the reasoning and check the final answer with a second method when possible.
Extra Practice
- Create and solve one original problem about Algorithms and ordered steps.
- Create and solve one original problem about Variables in code.
- Create and solve one original problem about Repeating instructions.
- Create and solve one original problem about Conditional statements.
- Create and solve one original problem about If-then decisions.
- Create and solve one original problem about Using conditions with numbers.
Common Mistakes
- Skipping the meaning and trying to memorize a rule only.
- Using the wrong operation because the question was not read completely.
- Ignoring units, labels, place values, or the context of the problem.
- Not estimating or checking whether the final answer is reasonable.
30 Review Questions and Answers
Q1. What is the key idea in Algorithms and ordered steps?
Answer: Algorithms and ordered steps uses clear step-by-step instructions to represent mathematics. Learners trace, test, and revise instructions to understand how changes affect results.
Q2. What is the key idea in Variables in code?
Answer: Variables in code introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Q3. What is the key idea in Repeating instructions?
Answer: Repeating instructions is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Q4. What is the key idea in Conditional statements?
Answer: Conditional statements is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Q5. What is the key idea in If-then decisions?
Answer: If-then decisions is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Q6. What is the key idea in Using conditions with numbers?
Answer: Using conditions with numbers is an important Grade 5 mathematics idea. Learn its meaning first, then connect it to a representation, a worked example, and a real-life use.
Q7. What is the key idea in Using loops with patterns?
Answer: Using loops with patterns introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Q8. What is the key idea in Code for growing patterns?
Answer: Code for growing patterns introduces algebraic thinking by describing relationships, using symbols for unknown values, and checking whether mathematical statements are true.
Q9. What is the key idea in Code for ratio patterns?
Answer: Code for ratio patterns compares quantities. Equivalent ratios and unit rates help learners scale situations and compare choices fairly.
Q10. What is the key idea in Tracing code outputs?
Answer: Tracing code outputs uses clear step-by-step instructions to represent mathematics. Learners trace, test, and revise instructions to understand how changes affect results.
Q11. Why should you estimate before or after a calculation?
Answer: Estimation gives a reasonable range and can reveal place-value or operation mistakes.
Q12. Why are labels and units important?
Answer: They show what a number represents and help prevent mixing unlike quantities.
Q13. How can a diagram help solve a problem?
Answer: A diagram makes quantities and relationships visible before calculation.
Q14. How can inverse operations check an answer?
Answer: An inverse operation reverses the original operation and should recover the starting value when the work is correct.
Q15. Why should you show steps?
Answer: Showing steps makes reasoning clear and helps find where an error happened.
Q16. What should you do after making a mistake?
Answer: Find the step where the reasoning changed, correct it, and try a similar problem again.
Q17. How can a number line support reasoning?
Answer: It shows order, distance, relative size, fractions, decimals, and inequality solutions visually.
Q18. When is a table useful?
Answer: A table organizes related values so patterns and comparisons are easier to see.
Q19. When is a graph useful?
Answer: A graph makes trends, comparisons, locations, or data patterns visible.
Q20. How do you decide which operation to use?
Answer: Use the meaning of the situation: combine, compare, find a difference, form equal groups, or find how many groups fit.
Q21. Why should you check place value?
Answer: A digit or decimal has a different value depending on its position.
Q22. What makes an answer reasonable?
Answer: It fits the context, has the expected size and units, and agrees with an estimate or second method.
Q23. How can you explain mathematical reasoning clearly?
Answer: Name the information, the rule or operation, the steps, and why the final answer fits the problem.
Q24. Why can more than one strategy be correct?
Answer: Different valid strategies can represent the same mathematical relationship and lead to the same result.
Q25. How should you approach a difficult Grade 5 problem?
Answer: Break it into smaller parts, solve one part at a time, and check each result before continuing.
Q26. How can you practise Coding Mathematical Situations with Conditions effectively?
Answer: Work a small example, explain every step, check the answer, then try a similar problem without looking at the first solution.
Q27. How can you practise Coding Mathematical Situations with Conditions effectively?
Answer: Work a small example, explain every step, check the answer, then try a similar problem without looking at the first solution.
Q28. How can you practise Coding Mathematical Situations with Conditions effectively?
Answer: Work a small example, explain every step, check the answer, then try a similar problem without looking at the first solution.
Q29. How can you practise Coding Mathematical Situations with Conditions effectively?
Answer: Work a small example, explain every step, check the answer, then try a similar problem without looking at the first solution.
Q30. How can you practise Coding Mathematical Situations with Conditions effectively?
Answer: Work a small example, explain every step, check the answer, then try a similar problem without looking at the first solution.