Skip to main content
Skip to main content

Water Water Everywhere

Integrating Digital Technologies
Years 3-4; 5-6

DT+ Mathematics

In this lesson, students are presented with the challenging problem of measuring a volume of water using containers that are not the exact measurement size. Students will decompose a complex problem into discrete steps, design an algorithm for solving the problem, and evaluate solution efficiencies and optimization in a simulation.

Based on the original lessons developed by the Exploring Computational Thinking team at Google.

Decorative image

Rony Michaud/ Pixabay

Learning hook: The challenge (15 minutes)

In this activity, students will be faced with the complex problem of measuring 5 mL of water with only a 4 mL container and a 7 mL container. Students must use decomposition to break the problem into smaller problems and then to design an algorithm to solve it.


Ask students to solve the following problem:

You’ve run into a predicament. You want to do a science experiment. Given two containers, one that can hold 4 millilitres and one that can hold 7 millilitres, how can you get one of these containers to hold exactly 5 millilitres?

Image of two containers, one holding 4 millilitres of water and the other holding 7 milliliitres of water

Notes to the teacher:

Tell the students the containers are blacked out and oddly shaped, so you can’t tell by weight or watermark how much is in the container - you can only accurately tell if it is empty or if it is full. You can’t look at the container to ascertain any other quantities.

You may notice that some students need help to get started. Stop their work and ask, “What do you know about the final desired volume?” “How can you express that value other than ‘5’?” “How do you think you can break this big problem into smaller problems?”


Ask students how they came up with the process for determining the correct solution. After the discussion, continue to Activity 1 in which you will suggest decomposition as a starting point.

Learning input: Pour the water (20 minutes)

In this activity, students will use decomposition to break down the problem into discrete steps and use the set of steps to design a method, or algorithm, to measure 5 mL of water.

Encourage students to describe the solution in discrete steps and to record the amount of water in each container (A and B) contains at each step.

We can do this by first noting that at any point there are only three actions we can do: completely fill a container, completely empty a container, or move the contents of one container to another (for this, we can use the shorthand A -> B to mean pouring the contents of A into B).

So an instruction to fill up the first container (A), pour it into the second (B) and then empty container B would look like:

Learning demo: Pour the water (20 minutes)

In this activity, students will use decomposition to break down the problem into discrete steps and use the set of steps to design a method, or algorithm, to measure 5 mL of water. Finally, they will execute a simulation to test their algorithm for optimization and efficiency.

Once students are comfortable with the notation, allow them to create their own table to describe the solution by interacting collaboratively in small groups.

An example solution might look like:

If students find a valid solution, encourage them to find other solutions to the same problem. Ask them to count the number of ‘instructions’ used by their solution (for example, the number of instructions for the above would be 12). Explain that the number of instructions used can be taken as a measure of the optimization or efficiency of their solution - the lower the number, the more efficient the solution because it takes fewer operations to achieve the goal.

A more efficient solution (because it only uses 9 instructions) would be:


Assess students on their ability to reach the correct answer. Assess higher-level students on finding the most efficient/optimal method (the fewest number of steps).

Learning reflection: Assessment (10 to 20 minutes)

In this activity, students analyze their method for measuring 5 mL to determine: a) how they figured out how to start - decomposition, b) how they worked out the solution - algorithm - to solve the problem, and c) if their method is efficient based upon testing a simulation. Finally, they solve a similar problem and their solution is assessed.


Give students the task of optimizing the algorithm they designed.

Assign a similar problem with different sized flasks of water and a different goal. If they have learned a process for solving this type of problem, they can apply the process to a different scenario.

Q1: How do you know how to start?

Q2: How do you know if you should use the method that pours A into B or the method that pours B into A?


Assess student answers to a new problem or assess optimization strategies.

A1: You know that you do not have a 5 mL container, so the only way you can get 5 is by adding two smaller components like 4 and 1 or 2 and 3, for instance. The only way you can get 1 mL, 2 mL, or 3 mL of water is to mix and pour water from one container into another.

A2: Generally speaking pouring the smaller container (4) into the larger container (7) gets you to the amount of 1 mL much faster which is helpful if you want to add it to 4 mL in order to get 5 mL, the goal.

Additional information and resources

Lesson Vocabulary

Computational Thinking concepts