University of Waterloo Logo and CEMC Banner

2024 Beaver Computing Challenge
(Grade 5 & 6)

Questions, Answers, Explanations, and Connections

Part A

Pizza Party

Story

Jun is ordering a large pizza for four of his friends. Each of his friends has three favourite pizza toppings as shown below.

Friend Favourite toppings
Eslam Hot pepper Mushroom Cheese
Meral

Mushroom Pineapple Onion

Salma Mushroom Spinach Cheese
Wout Mushroom Cheese Onion

Jun wants to choose the three most popular toppings for the pizza he is ordering. (A topping is more popular than another topping if it is the favourite of more friends than the other topping.)

Question

Which of the following pizzas should Jun choose?

  1. A pizza with mushrooms, hot peppers, and spinach.

  2. A pizza with cheese, pineapple, and hot peppers.

  3. A pizza with cheese, mushrooms, and onions.

  4. A pizza with cheese, mushrooms, and spinach.

Answer

(C) cheese, mushrooms, and onions

Explanation of Answer

Looking at the favourite pizza toppings of each friend, we see that

The other three toppings (hot pepper, pineapple and spinach) are each the favourite of only one friend. This means that mushrooms, cheese, and onions are the three most popular toppings among Jun’s friends. These are the three toppings in Option C.

Connections to Computer Science

This problem highlights how to organize data in a way that makes retrieval easier. Specifically, if there was a way to ask a question such as "How many people like this topping?", we could quickly determine what the most popular toppings were.

When there is a large amount of data to be stored and retrieved, often it is stored in a database system. A database stores some key value along with data associated with that key. In this particular problem, the name of the friend is the key, and the data associated with the key is their favourite toppings. Each entry can be thought of as a row in a table in a database.

To analyze the data, most database systems have the ability to SELECT various rows of data WHERE certain conditions are met, and even COUNT the number of such rows. For example, we could count the number of rows in our pizza table where cheese is one of the favourite toppings, and determine that there are three such rows.

Being able to organize data in a database, and perform queries to analyze the data contained in the database, are important skills for database administrators.

Country of Original Author

Germany

Nature Hike

Story

Beaver Alia hiked along a path from her home to the middle of the forest, enjoying nature along the way.

She first passed rocks . Then she passed an apple tree , followed by a bird’s nest .

Four paths, named A, B, C, and D, that each lead to the middle of the forest where Alia is. A description of the
paths follows.

Question

Which of the four paths leads back to Alia’s home?

  1. Path A
  2. Path B
  3. Path C
  4. Path D

Answer

(B) Path B

Explanation of Answer

On the way into the forest, Alia first saw rocks, then an apple tree, and finally a bird’s nest. If she takes the same path to get home, she will see the same objects, but in the reverse order. So, on the way home, she will first see a bird’s nest, then an apple tree, and finally the rocks. Hence, Option B is the correct answer.

Option A is incorrect, because there is no bird’s nest.

Option C is incorrect because the rocks should be seen last on the way home, not first.

Option D is incorrect because there are no rocks.

Connections to Computer Science

This problem simulates a stack data structure that uses the LIFO (Last In First Out) rule: the item that is placed in last is the first to be removed. The objects seen by Alia can be thought of as objects put into a stack. The first object seen (rocks) is put into a stack, followed by the second object (apple tree) and the third object (bird’s nest) so that the stack can be described as follows:

Three stacks of objects. The first stack has one object: Rocks. The second stack has two objects: Rocks on the bottom and Apple Tree on top. The third stack has three objects: Rocks on the bottom, then Apple Tree in the middle, then Bird’s Nest on top.

When Alia walks in the opposite direction, each object in the stack needs to be removed. The first thing Alia sees on her way home is a bird’s nest. Then the bird’s nest is removed from the stack so that in the top position is the apple tree. Then the apple tree is removed from the stack as well. The last item remaining in the stack is the rocks.

Stacks are used frequently in computer science. One such usage is keeping track of operations that can be "undone", such as edits to a document, browsing history in a browser, or searching through a maze by way of backtracking if a dead end is reached.

Country of Original Author

Indonesia

Candies

Story

Gabija offers to share the nine candies shown below with her friends.

A dish has three green dotted candies, four
round striped candies, and two square blue candies.

They take some candy as follows:

Question

After this, how many candies of each type remain?

  1. two round striped candies, one square blue candy, zero green dotted candies
  2. one round striped candy, one square blue candy, zero green dotted candies
  3. two round striped candies, two square blue candies, zero green dotted candies
  4. one round striped candy, one square blue candy, one green dotted candy

Answer

(A) two round striped candies, one square blue candy, zero green dotted candies

Explanation of Answer

After Benas takes one candy of each type, the number of candies is as follows:

three round striped candies, one square blue candy, two green dotted candies.

Then, after Marija takes two green dotted candies, the number of candies is as follows:

three round striped candies, one square blue candies, zero green dotted candies.

Finally, after Andrius takes one round striped candy, the number of candies is as listed in Option A.

Connections to Computer Science

This task is focused on keeping track of a set of variables. We can think of the number of each type of candy as being stored in a variable that describes the candy being stored. For example, the variable rs could store the number of round striped candies, the variable gd could store the number of green dotted candies, and the variable sb could store the number of square blue candies.

Initially, we know that rs=4, gd=3 and sb=2. After each person takes their selection of candies, the values of some of the variables change. For example, if Benas takes one candy of each type, the variables would have values rs=3, gd=2 and sb=1.

Variables are used extensively in many programming languages to store information that computers can read, process, and display.

Country of Original Author

Lithuania

Gift Box

Story

When folded, a gift box is a pyramid with a square base as shown.

A tilted view of the pyramid showing three
outer faces: the square base that is coloured with red stripes, and two
side-by-side triangular faces with the one to the left coloured white
and the one to the right coloured blue.

The sides and bottom of the box are different colours and patterns, but only some of these are shown.

Question

Which of the following could be the outside of the gift box when it is unfolded?

  1. A square in the middle with a triangle along
each of its sides. The square is orange. The top triangle is blue, the
triangle on the right has red stripes, the triangle on the bottom is
pink, and the triangle on the left is white.

  2. A square in the middle with a triangle along
each of its sides. The square has red stripes. The top triangle is blue,
the triangle on the right is orange, the triangle on the bottom is pink,
and the triangle on the left is white.

  3. A square in the middle with a triangle along
each of its sides. The square has red stripes. The top triangle is blue,
the triangle on the right is white, the triangle on the bottom is pink,
and the triangle on the left is orange.

  4. A square in the middle with a triangle along
each of its sides. The square has red stripes. The top triangle is
orange, the triangle on the right is white, the triangle on the bottom
is pink, and the triangle on the left is blue.

Answer

(B)

Explanation of Answer

All four options have a square in the centre with a triangle on each of its four sides, which would fold up to make a pyramid with a square base. Since they are all the correct shape, we need to use the colours and patterns to determine which option is correct.

The square base of the folded gift box is striped, so when it is unfolded, the square in the centre will be striped. Two of the triangular sides of the folded gift box are shown. One of the triangular sides appears to be white and the other appears to be dark blue. Looking from the base, the dark blue side is beside the white side in the clockwise direction. The other two sides are not shown on the folded box so they can be any colour and/or pattern.

Option A is incorrect because its square is not striped.

Option C is incorrect because the dark blue triangle and white triangle are in the wrong order. The dark blue triangle should be the next triangle clockwise from the white triangle, but in Option C the dark blue triangle is the next triangle counter-clockwise from the white triangle.

Option D is incorrect because when it is folded, the dark blue triangle and white triangle would be opposite each other instead of beside each other.

Option B is correct because the square in the centre is striped like the base on the folded gift box. Also the dark blue triangle is the next triangle clockwise from the white triangle.

Connections to Computer Science

To solve this task, we must identify the properties of the parts of the gift package that remain the same when the gift package is unfolded and possibly rotated. Because of these various arrangements, it is crucial to consider the positions of the parts of the gift package relative to each other. For example, the blue part’s left-hand neighbour is the light part when looking from below the gift package.

This use of visual pattern matching is also used in computer vision, to detect the location and position of objects based on characteristics of those objects. One example of visual pattern matching is in the design of robots to locate and move physical objects in a factory. Another application is assisting medical doctors in the detection of tumours from CT scans of patients. Both of these applications use partial information to make inferences about the most likely location/orientation/size of objects in visual images.

Country of Original Author

Estonia

Part B

Map It Out

Story

Four animals travelled across a plain. The following map shows their routes with a path from where each animal started to where they finished. However, the middle section of the map is missing.