University of Waterloo Logo and CEMC Banner

2017 Beaver Computing Challenge
(Grade 9 & 10)

Questions, Answers, Explanations, and Connections

Part A

Parking Lot

Story

There are 12 spaces for cars in a parking lot. The pictures below show which spaces were used on Monday and which spaces were used on Tuesday.

The parking lot on Monday. The lot has two rows with six spaces each. In the first row, there are cars in spaces 1, 3, and 6. In the second row, there are cars in spaces 3 and 5. All other spaces are empty. The parking lot on Tuesday. The lot has two rows with six spaces each. In the first row, there are cars in spaces 1 and 4. In the second row, there are cars in spaces 4 , 5, and 6. All other spaces are empty.

Question

How many parking spaces were empty on both Monday and Tuesday?

  1. 3
  2. 4
  3. 5
  4. 6

Answer

(B) 4

Explanation of Answer

We can see which spaces were used by placing the cars from both days on the parking lot at the same time.

The parking lot on Monday and Tuesday. In the first row, space 1 has two cars, space 2 is empty, space 3 has one car, space 4 has one car, space 5 is empty, and space 6 has one car. In the second row, space 1 is empty, space 2 is empty, space 3 has one car, space 4 has one car, space 5 has two cars, and space 6 has one car.

Then we can simply count empty spaces to determine that four spaces were empty on both Monday and Tuesday.

Connections to Computer Science

All data can be thought of as a sequence of zeros and ones. Each zero or one is called a bit and the sequence is called a binary code, binary representation, or binary number.

In this task, we can model an empty space as 0 and a space with a car as 1; each parking space corresponds to a bit. We get a sequence of bits by viewing the parking spaces in order. For example, we can read the top row from left to right and and then the bottom row from left to right to get 101001001010 from the parking lot on Monday and 100100000111 from the parking lot on Tuesday. This task asks to determine which of the twelve positions contain a 1 in either of these binary numbers. This is a logical operation named OR. Notice how we can compute the correct answer by seeing that

Monday 1 0 1 0 0 1 0 0 1 0 1 0
Tuesday 1 0 0 1 0 0 0 0 0 1 1 1
Monday OR Tuesday 1 0 1 1 0 1 0 0 1 1 1 1

This resulting binary number has four zeros in it.

Country of Original Author

Canada

Skaters

Story

Seven people are skating in a line on a very long, frozen canal. They begin as shown below.

Seven skaters in a row, labelled P, Q, R, S, T, U, and V in order from left to right. The skaters are all facing right, with skater V leading.

After every minute the person at the front of the line moves to the end of the line. For example, after one minute, U will be in front of the line, since V will move behind P.

Question

Which skater will be at the front of the line after 9 minutes?

  1. Skater P
  2. Skater R
  3. Skater T
  4. Skater V

Answer

(C) Skater T

Explanation of Answer

We can simply trace out the positions after each minute:

Thus, after 9 minutes, T is in front.

Connections to Computer Science

This task is focussed on tracing an algorithm and remembering the state or configuration of all information. Specifically, we start in a given configuration, follow a sequence of (nine, in this task) steps, and we must determine the final configuration. This process of tracing is used by computer scientists to ensure that that computer programs perform the intended process, and if they do not, to find the location or step where the program is not correct.

Country of Original Author

Canada

Risk

Story

Darren’s computer is connected to the Internet but does not have any antivirus or firewall software. None of the accounts on his computer are protected by a password.

Question

Which computers are at risk because of this?

  1. only Darren’s own computer
  2. only the computers in the same room as Darren’s computer
  3. only the computers in the same country as Darren
  4. all computers in the world which are connected to the Internet and set up like Darren’s

Answer

(D) all computers in the world which are connected to the Internet and set up like Darren’s

Explanation of Answer

Due to Darren’s reckless behaviour, his own computer may get infected by malicious software. However, infected computers are often used as a platform for attacking other computers. This means that all computers connected to the Internet without proper protection, such as firewalls and antivirus software are at risk because of Darren’s actions.

Connections to Computer Science

Owners of other computers can reduce some of the risks by following good practices. For example, installing security updates and running antivirus software reduces the risk of malware spreading to other computers. Unfortunately, this does not eliminate all risks. Malware, which is software designed to do malicious things, if it is on Darren’s computer, may be used to send spam or overload network connections (these are called DDoS attacks), and there is very little other computer users can do to protect themselves against these larger scale attacks.

Cybersecurity (or Information Technology security) helps protect computer systems from theft or damage to the hardware, software or the information on them, as well as from disruption or misdirection of the services they provide.

Country of Original Author

Estonia

Story

The lines in the diagram show exactly which pairs of students in a class are friends. A popular artist releases a new song on Monday and there is a musical note beside each student that buys the song that day.

A description of the diagram follows.

Every day after that, if a student has not bought the song yet but at least half of their friends did buy the song before this day, he or she will also buy the song. Otherwise they do not buy the song yet.

Question

What is the earliest day when all students in the class own the song?

  1. Wednesday
  2. Thursday
  3. Saturday
  4. Sunday

Answer

(B) Thursday

Explanation of Answer

Tom, Ted and Kim buy the song on Tuesday:

Everyone except Jane, Joe and Anna have musical notes.

Anna and Jane buy the song on Wednesday:

Everyone except Joe has a musical note.

Finally Joe will buy the song on Thursday.

Connections to Computer Science

This task models a social network of friends by way of a graph. Each person is a vertex in the graph, and two friends are connected by an edge. The task is based on determining the spread of influence through a social network. This spread of influence can be modelled by defining a threshold of diffusion: that is, every person changes his/her mind if a certain ratio of his/her neighbours have a different idea.

Social media companies and marketing companies extract information about connections between individuals and purchasing preferences in order to attempt to market new products or ideas to individuals, based on the proportion of friends who have purchased those products or agree with the particular idea.

Country of Original Author

Iran

Soda Shoppe

Story

Four friends each buy one drink. How happy each person will be for each type of drink is shown in the table below. The more hearts indicated, the happier a person will be. Unfortunately, only one of each of the four types of drinks is available.

Four hearts Three hearts Two hearts One heart
Anna Cola Juice Coffee Water
Bernard Cola Coffee Juice Water
Christine Cola Coffee Juice Water
Daniel Water Cola Coffee Juice

For example, Anna prefers Cola with happiness Four hearts, Juice with happiness Three hearts, and so on.

Question

When measured by the total number of hearts, what is the happiest the friends can be?

  1. 13
  2. 14
  3. 15
  4. 16

Answer

(B) 14

Explanation of Answer

Since three people want Cola, the maximum total number of hearts the group could get is 4+4+3+3 = 14. This is obtainable via the following matching:

Another way to see this, since Daniel has Water as his favourite drink and all others rank this beverage last, Daniel must pick Water to maximize the group’s happiness. Now, the first three people have the same first preference however the Anna has Juice as the next favourite and the other two people have this as the third favourite. Thus Anna should pick Juice. The other two people can pick Cola and Coffee in whichever order.

Connections to Computer Science

Optimization is a very important part of computer science. In this situation, we are trying to maximize the happiness of the group. Optimization problems are ubiquitous in computer science.

This problem is a specific instance of an optimal matching problem. In this task, friends are trying to get matched to the best possible drink to make the group as happy as possible. These types of problems are extremely important in the real world. As an example, patients who are waiting for an organ transplant are place on a huge list. However, not all organs can be used on a person – organ donors must, for example, match their blood types in order to have a chance at a successful operation. These constraints make it harder to find a successful matching.

Country of Original Author

Canada

Part B

Balls

Story

Numbered balls roll down a ramp as shown below. When a ball comes to a hole, if there is enough space, the ball falls in. Otherwise, the ball rolls past the hole. A pin at the bottom of each hole can be pulled which ejects the balls.

In the first figure, balls labelled 1 through 5 lie on a slope leading to a hole that has space for three balls. Ball 1 is first (closest to the hole) followed by 2, 3, 4, and 5 in order. There is an empty horizontal shelf past the hole (on the other side). In the second figure, balls 1, 2 and 3 are in the hole with 1 at the bottom followed by 2, then 3 on top. Also, balls 4 and 5 lie on the horizontal shelf past the hole with 4 farthest from the hole. In the third figure, the pin has been pulled and all balls lie on the horizontal shelf past the hole. Ball 4 is farthest from the hole followed by 5, 3, 2, and 1 in order.

Note the final ordering of the balls in the example above is 45321.

In the diagram below, ten balls roll down the ramp. Three holes, with pins labelled A, B, and C, have space for 3, 2 and 1 balls, respectively. After all ten balls stop moving, pin A is pulled. Then, after all the balls released from A stop moving, pin B is pulled. Finally, after all the balls released from B stop moving, pin C is pulled.

Balls labelled 1 through 10 lie on a slope that has three holes. Ball 1 is first (closest to the first hole) followed by 2, 3, and so on in order. The closest hole is A and has room for 3 balls. The next hole is B and has room for 2 balls. The final hole is C and has room for 1 ball. There is an empty horizontal shelf past the three holes.

Question

Which of the following is the final ordering of the balls?

  1. Starting with the farthest ball from the holes, the horizontal shelf has balls 7, 8, 9, 10, 1, 2, 3, 4, 5, then 6.
  2. Starting with the farthest ball from the holes, the horizontal shelf has balls 7, 8, 9, 10, 1, 2, 3, 5, 4, 6
  3. Starting with the farthest ball from the holes, the horizontal shelf has balls 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
  4. Starting with the farthest ball from the holes, the horizontal shelf has balls 7, 8, 9, 10, 3, 2, 1, 5, 4, 6

Answer

(D) 7, 8, 9, 10, 1, 2, 3, 5, 4, 6

Explanation of Answer

Hole A has space for three balls, so balls 4 to 10 roll past it in order. Hole B has space for two balls, so balls 6 to 10 roll past it in order. Hole C has space for one ball, so balls 7 to 10 roll past it in order. Then the pin in hole A is pulled and balls are ejected in the order 3,2,1 and roll to the bottom. At this point, the balls are at the bottom in the order 7,8,9,10,3,2,1. Then the pin in hole B is pulled and balls are ejected in the order 5,4. At this point, the balls are at the bottom in the order 7,8,9,10,3,2,1,5,4. Finally, the pin is pulled in hole C and ball 6 rolls to the bottom giving the correct answer.

Connections to Computer Science

The holes act like a stack which is a data structure. A data structure is a way of organizing data to make certain operations, like insert, delete, or retrieve, more efficient. A stack is based on the last-in first-out principle (LIFO). For example, the first ball to fall into a hole, is the last ball ejected from the hole. Despite being a very simple idea, it is useful in many different situations.

As an example, a stack can be used to check that the brackets in a mathematical expression like \(((1+2)*3)\) are balanced but the brackets in \(((4+5)*(6-7)\) are not balanced. The way to perform this check is that all opening brackets should be put on a stack (this operation is called a push) and when its matching closing bracket is found, the opening bracket is removed from the top of the stack (this operation is called a pop).

Country of Original Author

Serbia

Fish

Story

Four fish are placed on a tray as shown below.

Four identical fish are placed into two rows and two columns. All fish are facing east.

Every time a fish is turned clockwise, the fish diagonal to it also turns the same amount but in a counter-clockwise direction. For example, if the fish in the upper right turns 90\(\degree\) clockwise, then the fish in the lower left turns 90\(\degree\) counter-clockwise.

Aimi makes the following four turns in order.

  1. Turn the fish in the upper left 45\(\degree\) clockwise.
  2. Turn the fish in the lower left 90\(\degree\) clockwise.
  3. Turn the fish in the lower right 90\(\degree\) clockwise.
  4. Turn the fish in the upper left 45\(\degree\) clockwise.

Question

What does the tray look like after Aimi is done?

  1. Four fish are in a 2 by 2 formation. They all face east.
  2. Four fish are in a 2 by 2 formation. The top-left fish faces northeast, the top-right and bottom-left fish face east, and the bottom-right fish faces southeast.
  3. Four fish are in a 2 by 2 formation. The top-left and bottom-right face east, the top-right faces north, and the bottom-left faces south.
  4. Four fish are in a 2 by 2 formation. The top-left and bottom-right face east, and the top-right and bottom-left face west (and are upside down).

Answer

(C) Four fish are in a 2 by 2 formation. The top-left and bottom-right face east, the top-right faces north, and the bottom-left faces south.

Explanation of Answer

A student who tries to follow this in their head is likely to get confused. A simpler way of solving this task reliably is required. One way is to produce a quick and simple notation to keep track of the changes. The system shown below is clear and easy to produce if arrows are used instead of fish.

Step start 1 2 3 4
Arrows Four arrows arranged in a two by two grid. All arrows point east. Top-left arrow points southeast, top-right and bottom-left point east, bottom-right points northeast. Top-left arrow points southeast, top-right points north, bottom-left points south, bottom-right points northeast. Top-left arrow points northeast, top-right points north, bottom-left points south,  bottom-right points southeast. Top-left and bottom-right arrows point east, top-right points north, bottom-left points south.

Alternatively this task can be quickly solved by reading all the operations and noticing that only step number 2 affects toys on the lower-left and upper-right. Therefore a student can simply look at the answer options and choose the only one with lower-left and upper-right fish in the correct position.

Connections to Computer Science

One way to solve this problem is remembering the state of each fish, in terms of its position after each turn. To determine the correctness of a program, typically we need to determine the state of all variables at each step of the program. This process of debugging or tracing of a program is an important part of designing and reasoning about the correctness of computer programs.

Computers, in particular the central processing unit or CPU, can be modelled as a finite state machine which keeps track of its current state and will change its state based on input. This problem can be simulated with a finite state machine with 4 states (one for each corner of the digram), and transitions for each possible rotation of each fish to its corresponding next state.

Country of Original Author

Japan

Apple Packing

Story

At the Beaver Apple Orchard, apples are either sold individually, or in bags of 8 apples (called Family Packs), or in boxes of 8 Family Packs. Therefore, apples are packed according to the following rules:

  1. Apples are put in bags. Each bag can only hold exactly 8 apples. If there are less than 8 apples, they remain outside the bags as loose apples.
  2. Bags are put in boxes. Each box can hold exactly 8 bags. If there are less than 8 bags, they are left outside the boxes as loose bags.

Eight apples become one bag. Eight bags become one box.

Question

How many boxes, loose bags and loose apples are used to pack 275 apples?

  1. 3 boxes, 7 bags, and 7 apples.
  2. 4 boxes, 2 bags, and 3 apples.
  3. 3 boxes, 5 bags, and 1 apple.
  4. 4 boxes, 1 bag, and 6 apples.

Answer

(B) 4 boxes, 2 bags, and 3 apples.

Explanation of Answer

Each box contains a total of 64 apples (8 bags \(\times\) 8 apples per bag). The beavers picked 275 apples which filled four boxes (\(275\div 64=4.296875\)). These four boxes contains a total of \(64 \times 4 = 256\) apples. Since each bag holds 8 apples, the remaining \(275-256=19\) apples filled 2 loose bags (\(19\div 8=2.375\)). These two loose bags contain 16 apples leaving 3 loose apples left.

As a check:

Choice A has a total of \(3\times 64 + 7\times 8 + 7 = 255\) apples

Choice B has \(4\times 64 + 2\times 8 + 3 = 275\) apples

Choice C has \(3\times 64 + 5\times 8 + 1 = 233\) apples

Choice D has \(4\times 64 + 1\times 8 + 6 = 270\) apples

Connections to Computer Science

The binary number system is the simplest form of computer code or information. The binary number system uses binary numbers, namely a sequence of zeros and ones, to represent all information.

The octal system, on the other hand, uses eight different symbols, values from 0 to 7. If any value larger than 7 is needed, extra columns are added to the left. Each value in one column is 8 times greater than the value in the column to its immediate right. The octal system allows the same information to be represented using only a third of the digits as each octal digit represents three binary digits. This was ideal for some old computer systems as they could concisely display certain machine code.

In the question, the boxes represent the number of \(8^2=64\) apples, the loose bags represent the number of \(8^1=8\) apples, and the loose apples represent the number of \(8^0=1\) (units). Thus, the decimal (base-10) number 275 is expressed as 423 in the octal (base-8) system.

Country of Original Author

Taiwan

Roundabout City

Story

In Roundabout City, navigation software gives instructions as a sequence of numbers, representing which exit number to take at each roundabout. For example, the instructions “4 1 2” mean to take the 4th exit at the first roundabout, the 1st exit at the next roundabout, and the 2nd exit at the next roundabout. The diagram shows this route highlighted in green, beginning at A.

A map of roundabout city with a path starting at a location marked A and moving through three roundabouts in turn. Three other locations are marked B, C, and D.

Question

If we start from A and follow the sequence “3 1 3 2 3" where will we end up?

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

Answer

(B) Point B

Explanation of Answer

This is the route you would take:

A path from A to B that passes through five roundabouts.

Connections to Computer Science

This task introduces one important element of many computer programming languages: the instructions in a computer program are performed sequential, one after another in order. Additionally, each individual instruction should be performed exactly as specified.

The sequence of instructions given in the task, which is the exit number at each roundabout, can be thought of as a program in a very simple programming language. In order to achieve the desired goal or output, each instruction must be followed exactly (e.g., the sequence “4 1 2” is different than “3 1 2”) and in the order specified (e.g., the sequence “4 1 2” is not the same as the sequence “2 4 1”).

Country of Original Author

Slovenia

Jumpers

Story

Peter and Henrietta are playing a video game. They move a beaver at a constant speed from the start of a course to the finish. The course consists of platforms on two levels. At the end of each platform before the finish, the beaver jumps instantaneously up or down to the next platform. The amount of time to move over each platform of the game is shown below each platform.

Here is an example course:

A low platform with length 5, a high platform with length 5, and a low platform with length 5. The start is the left end point of the first low platform. Arrow A points to a point on the first low platform, arrow B points to the left endpoint of the high platform, and arrow C points to the left endpoint of the second low platform. The finish is the right end of the second low platform.

Peter and Henrietta start playing the following two different courses at exactly the same time.

Peter's course has a low platform of length 3, a high platform of length 4, a low platform of length 2, a high platform of length 4, and a low platform of length 3. Henrietta's course alternates between a low platform of length 2 and a high platform of length 2, four times.

Question

For how long are both beavers moving along the top level at the same time?

  1. 2 seconds
  2. 4 seconds
  3. 6 seconds
  4. 8 seconds

Answer

(B) 4 seconds

Explanation of Answer

We can see this answer by writing down "being at the bottom level for one second" as a 0, and "being at the top level for one second" as 1. Then, Peter’s game can be described as: \[0001111001111000\] and Henrietta’s game can be described as: \[0011001100110011\] To find the times that they are both on the upper level, we need to find the times when both games have a 1 value simultaneously. This can be done by applying the boolean logic function AND between these two sequences to get:

Peter's game 0 0 0 1 1 1 1 0 0 1 1 1 1 0 0 0
Henrietta's game 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
Peter's AND Henrietta's games 0 0 0 1 0 0 1 0 0 0 1 1 0 0 0 0

Connections to Computer Science

One of the main philosophies in computer science is how to represent information. In this task, we can abstract (or hide) away some of the details of the game to focus on what matters, which in this case is when a player is on the upper level. Then, once the information is represented in a precise way, we can transform or combine the information into new and meaningful ways. Specifically, for this problem, we treat the information as sequences of binary numbers and perform a bit-wise AND operation to find where both sequences have a 1 value simultaneously.

Country of Original Author

Canada

Part C

Intrusion

Story

In the Bebras Museum of Post-Modern Wood Art, there is an intelligent security system that detects intruders. An intruder is a person who has entered the museum, but not via the entrance. The entrance of the museum is in Room 1.

Each and every time a person enters or leaves a room, the system detects exactly how many people are in each room and records this in a table. The system always correctly allocates each person in the museum to a single room. It may happen that several people enter or leave a room at the same time.

The table shows the records of the intelligent security system and the image shows the layout of the rooms in the museum.

Time Room 1 Room 2 Room 3 Room 4
10:00 2 0 0 0
10:07 3 0 0 0
10:08 2 1 0 0
10:12 4 1 1 0
10:13 2 2 3 0
10:17 5 2 2 1
10:20 4 1 2 2

A rectangular floor plan divided into four rectangular rooms forming a two by two grid. The top left-room is labelled 1, the top-right is 2, the bottom-right is 3, and the bottom-left is 4. There is a door between Rooms 1 and 2, between 2 and 3, between 3 and 4, and between 4 and 1. Room 1 has a door leading outside.

Question

At what time did the system detect an intruder?

  1. 10:07
  2. 10:12
  3. 10:13
  4. 10:17

Answer

(C) 10:13

Explanation of Answer

At 10:13 two people entered room 3, but in the attached rooms there was only one person before (in room 2). Thus someone entered room 3 from outside the museum not using the entrance.

Connections to Computer Science

Security systems keeping track of the number of people is critical in places such as airports, train stations or government buildings. Computer programs can evaluate and extract information from images, including the ability to detect people and thus count them. These programs use artificial intelligence, for example, to recognize humans, but also use simple logical rules like those outlined in this task (i.e., the number of people in a room cannot be more than the sum of all people in the room before plus the number of people in adjoining rooms) in order to detect security breaches.

Country of Original Author

Germany

Super Hero

Story

A super hero watches over Beaver City from a straight path across a river. From every point along the path, the super hero needs to be able to see the point in the city directly across the river. Unfortunately, 16 walls of varying lengths stand between the river and the city as shown.

There are sixteen walls between the super hero and the city, and some are in front of others.

Fortunately, the super hero has X-ray vision and can see through a wall.

Unfortunately, the super hero can only see through one wall at a time.

Fortunately, the super hero is strong enough to destroy walls, and when he destroys a wall, he destroys it completely.

Unfortunately, destroying a wall makes the super hero very tired.

Question

What is the fewest number of walls that the super hero needs to destroy?

  1. 9
  2. 10
  3. 11
  4. 12

Answer

(A) 9

Explanation of Answer

Instead of determining the fewest number of walls that the super hero needs to destroy, we consider the largest number of walls that the super hero can keep (not destroy). This is equivalent.

We will show that the largest number of walls that the super hero can keep is seven. Since there are at total of 16 walls, this means the super hero needs to destroy \(16-7=9\) walls.

Consider the seven grey walls in the picture below.

The sixteen walls, 7 of which are grey. Three walls are labelled with A, B, and C.

No two of these seven walls “overlap". That is, from every point along the path, at most one of these walls will be between the super hero and the point in the city directly across the river. Thus we know that the super hero can keep at least seven walls. We must show that the super hero cannot keep more than seven walls.

There are walls of four lengths. Let’s name these lengths 1, 2, 3 and 4 (which happen to be proportional to the actual lengths in the picture).

Interestingly, instead of the leftmost wall “A" of length 3 in our solution, the super hero could keep either of the two leftmost walls of length 2, “B" or “C". So there is an alternative set of seven walls of lengths 2, 1, 2, 1, 1, 2 and 1 that the super hero could keep. The super hero cannot do better than this because there are only five walls of length 1 and two of them “overlap".

Why did we choose a wall of length 3 in our solution? We did this because it comes from a way to solve this problem for any set and placement of walls, not just those in this particular task. More generally, we can find the walls to keep by starting from the left and always selecting the next (non-overlapping) wall that ends closest to the left. (Can you see why this always works?)

Another way to observe that we can’t destroy less than 9 walls is to notice that there are disjoint sets of overlapping walls of sizes 4, 3, 4, and 2 when reading from left to right. This means that at least \(3+2+3+1=9\) walls must be destroyed.

Connections to Computer Science

The general solution to this problem is a greedy algorithm. That is, it is a sequence that solves a problem by always making a choice at each step that seems best “locally" or “at the moment". It does not take into account the “big picture" or full set of information.

This particular problem is a model of a scheduling problem for which computer scientists are interested in solving with efficient algorithms. To see this, think of time moving forward as you move towards from left to right and think of the walls as tasks that need to be completed with a fixed start and end time. The restriction that the super hero can only see through one wall corresponds to the fact that only one task can be completed at any one time. In our problem, the super hero is trying to solve as many tasks as possible!

Country of Original Author

Canada

Litter

Story

All of the litter in the park shown below needs to be picked up. The park is a \(16\times 16\) grid.

A description of the park follows.

Lucy must divide the entire park into square regions of sizes \(1\times 1\), \(2\times 2\), \(4\times 4\) and \(8\times 8\).

Each of the square regions must contain at most one piece of litter.

Question

What is the fewest possible number of regions that Lucy can divide the park into?

  1. 9
  2. 13
  3. 16
  4. 64

Answer

(B) 13

Explanation of Answer

The solution is shown below, where the red lines indicate where we divide the park into regions:

The 16 by 16 grid is split into four 8 by 8 quadrants. The lower-left quadrant and the upper-right quadrant are again split into quadrants making four 4 by 4 grids in each. Finally, the top-right 4 by 4 grid is again split into quadrants making four 2 by 2 grids. This results in 13 square regions in total and there is at most one piece of litter in each region.

Notice that we must use at least 8 square regions, since there are 8 pieces of litter. To get the minimum number of squares, we want to maximum the size of each square region around each piece of litter. For the solution shown, there is no larger square of the given sizes that can surround each piece of litter without overlapping another piece of litter.

Connections to Computer Science

This representation of two-dimensional information is called a quad-tree. A quad-tree splits a two-dimensional region into four equal parts (quad meaning four in Latin), where each part may be further subdivided into four equal parts, until there is only one item in each part. The use of quad-trees as a data structure allows graphical information (such as the positions of windows on a computer screen) to be stored and searched efficiently, in particular, allowing range queries of the form “how many objects are in this part of a picture?" to be performed in a very efficient manner.

Country of Original Author

Canada

Beaver Lodge

Story

The Beaver family has built a lodge with 4 rooms and 5 tunnels connecting rooms as shown. There are also 7 doorways to the outside.

The Beaver children have noticed that it is possible to start in one of the rooms and run along a path passing through all of the tunnels and all of the doorways without walking through any doorway or tunnel twice.

The rooms are labelled A,B,C, and D. There is a tunnel connecting Rooms A and B, Rooms A and C, Rooms B and C, Rooms B and D, and Rooms C and D. Rooms A, C, and D each have have two doors to the outside. Room B has one door to the outside.

Question

In which room did the Beaver children start running along such a path?

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

Answer

(C) Room C

Explanation of Answer

Turn each room into a node with an additional node for the outside. The nodes are connected if and only if there is a tunnel between the rooms presented by them or a doorway if one of the nodes represents the outside.

The described path is possible if there are no more than two nodes with an odd number of edges. Such nodes will be the first and last node on a path.

In our case the starting node with an odd number of edges (3 tunnels + 2 doorways) has to be C.

A node is placed inside each room and an additional node is placed outside. If two locations are connected via a door or a tunnel, then a line is drawn between their corresponding nodes.

Connections to Computer Science

We can transform this task into a graph theory problem, where each location (room or outside) is represented as a node and each tunnel or doorway is represented as one edge. The path which this task asks to find is called an Eulerian path: that is, a path in a graph which visits every node exactly once. In order for there to be an Eulerian path in a graph, it is necessary that either zero or two nodes have an odd degree, where the degree of a node is the number of edges connected to that node. To see why that condition is necessary, notice that a continuous path will leave each node exactly as often as enters it, except for nodes which are at the start and at the finish.

Many problems are modelled using graphs, and computers algorithms for shortest paths, cycle finding, connectivity, and strongly connected components are some examples of well-known and well-studied algorithms that have been developed to solve real-world problems involving graphs.

Country of Original Author

Lithuania

Broken Digital Clock

Story

On a digital clock, each digit can be formed by lighting up some of the seven segments.

Seven segments of equal length are arranged to form two identical squares with one on top of the other sharing a common side.

Below, each of the digits from 0–9 are shown by lighting up some of those seven segments.

A description of the digits follows

Suppose that some of the seven segments are not working but each of the ten digits can still be determined unambiguously.

Question

What is the largest possible number of segments that are not working?

  1. 0
  2. 1
  3. 2
  4. 3

Answer

(C) 2

Explanation of Answer

Consider the following labelling of the 7 segments of one digit, with the letters a through g:

In the top square, the top side is labelled a, the right side is b, the bottom side is g, and the left side is f. In the bottom square, the top side is g, the right side is c, the bottom side is d, and the left side is e.

Segment a must work to distinguish between digits 1 and 7.

Segment b must work to distinguish between digits 6 and 8.

Segment e must work to distinguish between digits 5 and 6.

Segment f must work to distinguish between digits 3 and 9.

Segment g must work to distinguish between digits 0 and 8.

If both segments c and d were not working, we would have the following 10 digits, each of which is uniquely determined:

Partial digits from 0 to 9 each drawn on the figure formed by two squares, but each having the right side and bottom side of the bottom square unlit.

Connections to Computer Science

Pattern recognition algorithms are algorithms with take in complex information, such as a picture or sound, and try to categorize it. For example, pattern recognition algorithms are used to detect facial features, such as eyes, mouth, and nose, for security and social media applications. These algorithms look for identifying information and attempt to provide a “most likely” answer, using statistical models.

Pattern recognition is a branch of a larger area of computer science called machine learning, that focuses on the recognition of patterns and regularities in data. One of the approaches to recognition is to extract specific features, that allow uniquely identify objects. This task focuses on identifying these key features to distinguish between each digit.

Country of Original Author

Russia