Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

2019 CAT — Junior Solutions Page 23

Computational and Algorithmic Thinking 2019 (Junior Solutions) 1

Solutions
Part A: Questions 1–6

1. MazeBot
The path MazeBot takes is 50 → 48 → 46 → 41 → 37 → 43 → 36 → 32 → 30, as shown
below.
30

32
31

36
46
41

50 48 29 28

37
42
43

33
34

35

MazeBot ends in room 30. Hence (B).

2. Spider
The numbers in the circles show the total distance the spider has to walk to get to the
hole. (The distance is the same at the bottom of the hole.)

2 4

5 6 5

7 7 6

8 8 7

9 10 8

The shortest distance the spider has to walk is 8 units. Hence (C).
2019 CAT — Junior Solutions Page 24

Computational and Algorithmic Thinking 2019 (Junior Solutions) 2

3. Fusing Numbers
Solution 1
Following the fusing numbers rules:

4, 5, 3, 6, 7, 2, 9, 4, 5, 6, 4, 7, 8, 2, 1, 5

→ 54, 63, 72, 94, 65, 74, 82, 51

→ 6354, 9472, 7465, 8251

→ 94726354, 82517465

→ 9472635482517465

The last digit is 5. Hence (E).


Solution 2
We take advantage of only needing the last digit.
As there is a 9 in the first half of 4, 5, 3, 6, 7, 2, 9, 4, 5, 6, 4, 7, 8, 2, 1, 5 , the last digit
will be in the second half. That is, in 5, 6, 4, 7, 8, 2, 1, 5.
As there is an 8 in the second half of 5, 6, 4, 7, 8, 2, 1, 5, the last digit will be in the first
half. That is, in 5, 6, 4, 7.
As there is a 7 in the second half of 5, 6, 4, 7, the last digit will be in the first half. That
is, in 5, 6.
So the last digit will be 5. Hence (E).

4. Annoying Nephew
After 6 moves, the counter will be back at its starting position.

D
C A

A C

→ D E

A B

E D
A

The counter will be back at its starting position after 6, 12, 18, . . . , 60 moves. Then on
the 61st move it will cross the circle to E. Hence (E).
2019 CAT — Junior Solutions Page 25

Computational and Algorithmic Thinking 2019 (Junior Solutions) 3

5. Hearts / Spades
Starting from the rightmost card we work to the left counting the excess of ♥s over ♠s.
The greatest excess shows where we should flip from.
card ♥ ♠ ♥ ♥ ♠ ♠ ♥ ♠ ♠ ♥ ♥ ♠ ♥ ♥
excess 2 1 2 1 0 1 2 1 2 3 2 1 2 1
The greatest excess is 3, at the 5th last card. Hence (B).

6. Wetlands
In the map, the number beside a channel represents the flow along the channel after the
previous swamp has filled. If there is no number, there is no overflow from the swamp.

10

5
20 5

5 20 20

10
20
45
5

100 15 10
10
5
15 5
45

5
15 10
5
15

A total of 5 + 5 = 10 ML of water will reach the rightmost swamp. Hence (C).


2019 CAT — Junior Solutions Page 26

Computational and Algorithmic Thinking 2019 (Junior Solutions) 4

Part B: Questions 7–9

7. Landscaping
For each worker, we calculate the relative profitability—how much more profitable it
would be to mow than to prune. Then the workers with the highest relative profitabilities
mow and the others prune.
For the example:
Worker 1 2 3 4
Mowing 5 2 6 5
Pruning 3 4 3 5
Rel profit 2 −2 3 0
The first and third workers have the highest relative profitabilities, so they mow, and the
other two prune.

A.
Worker 1 2 3 4 5 6 7 8
Mowing 3 2 4 4 3 6 3 1
Pruning 4 2 3 2 5 3 4 2
Rel profit −1 0 1 2 −2 3 −1 −1
The second, third, fourth and sixth workers have the highest relative probabili-
ties, so they mow. The profit is (2+4+4+6)+(4+5+4+2) = 16+15 = 31.

B.
Worker 1 2 3 4 5 6 7 8 9 10
Mowing 2 3 4 5 4 1 4 2 3 4
Pruning 3 3 3 4 5 2 6 3 5 4
Rel profit −1 0 1 1 −1 −1 −2 −1 −2 0
The first, second, third, fourth and tenth workers mow.
The profit is (2 + 3 + 4 + 5 + 4) + (5 + 2 + 6 + 3 + 5) = 18 + 21 = 39.
Note that the allocation is not unique. The mowers could be second, third,
fourth, tenth and any one of first, fifth, sixth or eighth. The total profit would
be the same in each case.
For instance, if the second, third, fourth, tenth and fifth workers mow, the profit
is (3 + 4 + 5 + 4 + 4) + (2 + 6 + 3 + 5 + 3) = 20 + 19 = 39.
2019 CAT — Junior Solutions Page 27

Computational and Algorithmic Thinking 2019 (Junior Solutions) 5

C.
Worker 1 2 3 4 5 6 7 8 9 10 11 12
Mowing 6 8 5 2 4 0 3 1 5 1 15 6
Pruning 7 7 4 1 1 2 2 2 3 3 14 4
Rel profit −1 1 1 1 3 −2 1 −1 2 −2 1 2
The second, third, fourth, fifth, ninth and twelfth workers mow.
The profit is (8 + 5 + 2 + 4 + 5 + 6) + (7 + 2 + 2 + 2 + 3 + 14) = 30 + 30 = 60.
Again, the solution is not unique.

8. Inertia
In the diagrams below, the route with the fewest number of pushes is shown with a
double line. Other safe routes with more pushes are shown with a single line. All other
possible routes do not stay within the grid. The number of pushes required for a safe
route is shown by a number within a circle.

A.
Y

5 7

There are two routes that Astrid can take, requiring 5 and 7 pushes. Hence 5.

B.

6 Y

There are two routes that Astrid can take, requiring 6 and 7 pushes. Hence 6.
2019 CAT — Junior Solutions Page 28

Computational and Algorithmic Thinking 2019 (Junior Solutions) 6

C.
7

There are two routes that Astrid can take, requiring 6 and 7 pushes. Hence 6.

9. Add Ten
The number 11498 is far too large to trace through the flow diagram. So we have to
determine what the flow diagram’s algorithm does.
We start by tracing the two smaller numbers through the flow diagram.

A.

A 36 36 36 36 36 36 36 36
B < A?     
B 0 10 20 30 40 40 39 38 37 36
A = B?     
C 0 1 2 3 4
The output is 4.

B.

A 77 77 77 77 77 77 77 77 77 77 77 77 77
B < A?         
B 0 10 20 30 40 50 60 70 80 80 79 78 77
A = B?    
C 0 1 2 3
The output is 3.

C. We can now see that the flowchart’s algorithm finds the difference between
the number and the smallest multiple of ten that is greater than or equal to the
number.
So if 11498 is input, the output is 11500 − 11498 = 2.

You might also like