0% found this document useful (0 votes)
30 views31 pages

IBIC-Sample Paper-CLASS 11-12

The document outlines tasks for an International Contest on Computational Thinking, focusing on various problems related to computational concepts such as graph theory, binary numbers, and algorithms. Each task presents a scenario that requires logical reasoning and problem-solving skills, with a brief explanation of the underlying informatics principles. The tasks are designed for students in classes 11-12 and cover topics like shortest paths, binary counting, and game strategies.

Uploaded by

Saleem Momin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views31 pages

IBIC-Sample Paper-CLASS 11-12

The document outlines tasks for an International Contest on Computational Thinking, focusing on various problems related to computational concepts such as graph theory, binary numbers, and algorithms. Each task presents a scenario that requires logical reasoning and problem-solving skills, with a brief explanation of the underlying informatics principles. The tasks are designed for students in classes 11-12 and cover topics like shortest paths, binary counting, and game strategies.

Uploaded by

Saleem Momin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

B bras

International Contest on
Computational Thinking Time Allowed: 150 Minutes

Tasks T1 – T10 carry 3 points each


T1: Traveling upriver
To reach home, a beaver has to make a trip through a system of creeks. To have energy for the trip the
beaver eats 15 twigs. On its trip, the beaver must get across some obstacles. This consumes energy
corresponding to the following amount of eaten twigs:

On the right, you see the system of creeks and the locations of the obstacles. The locations A, B, C, D, and
E are used to describe routes through the creeks.

Which of the following routes can the beaver take?


Remember it starts with an energy of 15 twigs.

A) Start → A → C → E → Home B) Start → A → C → E → D → Home


C) Start → B → C → D → E → Home D) Start → B → C → D → Home

It's informatics!
The system of creeks is like a network, with the locations A to E plus Start and Home as nodes that are
connected. The energy consumption of the obstacles on the connections can be regarded as a distance
between connected nodes. Then, the beaver is looking for a shortest path from node ”Start“ to node „Home“.
In informatics, the mathematical construct ”graph“ is often used to represent such networks with distances.
Many algorithms have been developed for graphs. For the “shortest path problem“, several efficient algorithms
have been invented, e.g. by Dijkstra and (together) by Floyd and Warshall. You may have seen the application
of such algorithms already, for instance in route planning services like car navigation systems. So the next time
you reach your goal thanks to computer software, you may think of Dijkstra and all the other computer
scientists that have improved the finding of shortest paths.

Keywords
Graph
Shortest path problem
Dijkstra

1 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T2: Colourful Table


A little beaver would like to pave his new room with different coloured tiles:

He decided that he will not rotate or cut the tiles in any way.

He wants to make his room as colorful as possible.


What is the maximum number of different colours he can use to pave the room in the picture?

A) 2 B) 3 C) 4 D) 5

It's informatics!
The partition on the subsets of given sizes is one of the classical problems in the Algorithms theory. It is packing
problem, where we have an area and we decide how to cover the area with certain shapes.

Keywords
Partition
Graphical Algorithm

2 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T3: Ring Game

The Ring game is played on this ring-shaped board. Each player has two pieces. When it is your turn, you
must move one of your pieces to a free adjacent cell, you are not allowed to pass a cell with a piece in it.
When a player is unable to move, he has lost the game.
When both players play as well as possible, what will happen starting with the situation above?

A) The first one to move will win the game.


B) The first one to move will lose the game.
C) The white player will win the game, no matter who plays the first move.
D) The black player will win the game, no matter who plays the first move.

It's informatics!
In these strategy games you do a lot of if – then – else reasoning. Analyzing all possible situations and grouping
them into different categories which all need their own approach is often done by computer programmers.
Some computer programs are really good in playing games like chess or checkers. The research on these topics
is part of the field of artificial intelligence.

Keywords
Game
Artificial intelligence
Programming
Gametree

3 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T4: Binary Counter


Little beavers use a weird counter, which only uses two digits: 0 and 1. Every time the counter is pressed,
it changes the rightmost 0 to 1, and every digit 1 on its right to 0.

For example, when it is pressed:


- the number 01001 changes to 01010.
- the number 01011 changes to 01100.
- the number 01111 changes to 10000.

The first number in the counter is 00000. After how many presses will the counter show 11111?

A) 21 B) 23 C) 27 D) 31

It's informatics!
The described numbers are binary numbers, which represents values using two symbols, typically 0 and 1. The
reason for this is that there are only two states an electrical circuit can be in: either off or on. Since computers
can only understand either 0 (off) or 1 (1), they use the binary number system.

Keywords
Binary number
Number system

4 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T5: Forest Monitoring


Ranger Olivier is monitoring a forest. Every year, he counts the total number of trees. If the total is:
• even, he cuts half of the trees;
• odd, he plants new trees in the forest so that the total number of trees has tripled, plus one.
For example, if there are 10 trees the first year, Ranger Olivier will cut half of them which will reduce the
size of the forest to 5 trees. Then, the next year, Ranger Olivier will plant new trees so that the size of the
forest grows to (5 × 3) + 1 = 16 trees.

After how many years will the size of the forest be reduced to a single tree, knowing
that the initial number of trees is 15?

A) 16 B) 17 C) 18 D) Never

It's Informatics!
The background of this task is the Collatz conjecture, one of the open problems in mathematics. It is defined
as f(n)=n/2 for even n and f(n)=3n+1 for odd n. In this case the amount of steps needed until f(n)=1 is reached
are compared for different start values n. Linked below is a graph of some more complex ways to 1.

This is an example of a seemingly simple problem with a set of just two simple rules that shows a very complex
behaviour. Unfortunately this happens quite often in computer science, especially if it comes to how long it
takes to calculate something. Linked below is a graph presenting pairs of n and length of the way from n to 1
for values of n up to 9999.

Keywords
Recursion
Algorithm
Program execution

5 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T6: Moving in Hexagonal Grids


Beavers love the shape of hexagons, so they decided to divide their country into
several hexagonal cities. They set a coordinate for each city (see the figure), and set the
distance between two neighboring cities is 1. One little beaver is currently in the city (2, 1),
and he is going to meet his brother in the city (5, 7). Then, they are going home to
the city (6, 3) together.

What is the minimum distance that the little beaver can travel to meet his brother and go home?

A) 8 B) 9 C) 10 D) 11

It's informatics!
Hex coordinates are commonly used in computer games or computer graphics. Calculating distances between
grids in hex coordinate is the basis of using hex coordinates. In addition, since students are already familiar
with Cartesian coordinates, it is a good practice for students to compare the differences between Cartesian
coordinates and hex coordinates.

Keywords
Hex coordinate

6 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T7: Shopping at Shoes World


Beaver Sébastien is at Shoes World. He would like to buy a new pair of shoes. After searching for a long
time, he finally found the model he wants. Unfortunately, the sizes are not written on the boxes, but only
on shoes. In order not to make a mess in the store, he will only check one box at a time. He also knows that
the boxes are sorted in ascending order of size.

If there are 20 boxes and considering that the size he is searching for is available, how many boxes must
he open at least to be sure to find his size?

A) 4 B) 5 C) 10 D) 20

It's Informatics!
In programming, it is important to know what's the maximum time your program will take to execute. Knowing
the maximum value, and the minimum, you can try to improve his performance. Binary search and search
algorithms are very important in informatics.

Keywords
Optimisation
Binary search
Complexity

7 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T8: Binary one half


The only digits in binary are 0 and 1. (A subscript 2 indicates that the number is written in binary). The
numbers 1 to 6 can be written in binary as 12, 102, 112, 1002, 1012 and 1102 . Note the following important
numbers 1 = 12, 2 = 102, 4 = 1002, 8 = 10002 and so on. Of course, even fractional numbers can be written
in binary.
How can the number 0.5 be written in binary?

A) 0.12 B) 0.1012 C) 0.52 D) 0.22

It's informatics!
Computers internally work with binary numbers only. The system to represent positive integer numbers can
be extended to binary fractions (in an analogue way to decimal fractions). Interestingly, like 1/3=0.33333... in
decimal, the number 0.2 cannot be represented as a finite binary fraction: 0.2 = 0.001100110011...2

Keywords
Binary numbers
Binary fraction
Floating points numbers

8 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T9: Some strange words


Beavers consider words containing only the letters a, b, c. They can do three operations on such words:
1. Replace every a with the sequence aa.
2. Replace some b with c.
3. Insert the letter c anywhere in the word.

For example, if we have the word abbbcaab then using instruction 1 we would get aabbbcaaaab, then using
instruction 2 we would get aabcbcaaaab, and finally using instruction 3 we would get aabcbcaacaab.

Which of the following words is impossible to get if we start with aabbbbaabbccbbabbc?

A) abbbaabbccbaaaabbc B) aaaaccbbaacaaccccbbaabbc
C) caaccccaaccccccacccc D) acacbcbcbcbcacacbcbcccccbcbcacbcbcc

It's informatics!
Programs usually consist of statements. Since programming languages must be clear and concise, the form of
the statements is described by strict sets of rules similar to those above. We prescribe the form and define its
meaning, and, voila!, we have a programming language.

How about the rules of the English language? Could we also describe how to properly form English sentences?
It turns out we can – to some extent –, and it also helps us attach the meaning to them. When you use a
computer to translate some text from a foreign language, the computer needs to analyze and synthesize its
sentences in such a way. If you are used to seeing poor translations, this is mostly because the human languages
are so much more difficult to describe than programming languages.

Therefore, if you learned to speak and understand English, programming should be a piece of cake for you.

Keywords!
Formal languages theory
Turing machine
Grammar

9 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T10: Follow the squirrel


Pavel is standing in a park in the middle of a crossroad of eight paths.

He he facing the tree when he sees a squirrel jumping down from the tree.

The squirrel then runs around the park and Pavel try to follow it by turning around without leaving the
crossroad.

First he turns by 2 paths to the left, so now he faces the bush.


Then he turns by 4 paths to the right,
by 4 paths to the left,
by 1 path to the left,
by 4 paths to the right,
and finally by 6 paths to the right.

What is facing Pavel after all his turns?

A) B)

C) D)

It's informatics
The topic of this task is following sequences of instructions. Understanding sequences of instructions is an
important pre-knowledge to programming a this also to informatics.

Keywords
Turning
Instructions
Sequences of instructions

10 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

Tasks T11 – T20 carry 4 points each


T11: Missing Step
Beaver Johnny received a task from his computer science teacher. He has two cards, card a and card b. On
card a is a number, and on card b is a different number. He has to exchange the numbers on card a and
card b by the following three steps:

a=a+b;
???????
a=a-b;

The first step, a=a+b, means to replace the number on card a by adding the number on card a and card b.
The third step, a=a-b, means to replace the number on card a by subtracting the number on card b from
the number on card a. However, Johnny has forgotten the second step.

What of the following is the second step:

A) a = a + b B) b = a – b C) b = b - a D) a = b

It's informatics!
This task is from the field of writing programs for beginners.

Keywords
Programming for beginners

11 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T12: Hotel rooms keys


In a hotel, the rooms are numbered with two digits. The first digit
indicates on which floor the room is located; the second digit
indicates the distance from the elevator to the room.

A customer comes and asks for a room, but he really does not want
to walk much. So any room which takes less walking to reach it is
better than a room with more walking. If multiple rooms involve the
same amount of walking, the customer prefers the lower floor.

Sort the available room keys based on how much the customer would like them. On the left you should
place the room key that the customer will like the best; on the right the room key that he likes the least.
The following room keys are available: 12, 25, 11, 43, 22, 15, 18, 31, 44, 52

A) 18, 15, 12, 11, 25, 22, 31, 44, 43, 52 B) 52, 43, 44, 31, 22, 25, 11, 12, 15, 18
C) 11, 31, 12, 22, 52, 43, 44, 15, 25, 18 D) 11, 12, 15, 18, 22, 25, 31, 43, 44, 52

It's informatics!
In computer science, radix sort is a non-comparative integer sorting algorithm that sorts data with integer keys
by grouping keys by the individual digits which share the same significant position and value. A positional
notation is required, but because integers can represent strings of characters (e.g., names or dates) and
specially formatted floating point numbers, radix sort is not limited to integers. Radix sort dates back as far as
1887 to the work of Herman Hollerith on tabulating machines.

Keywords
Sort
Radix sort

12 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T13: Logic Circuit


Logic gates have one or two inputs on the left, and one output on the right. They switch ON or OFF a
current on the output, depending on the currents of the inputs

If input A is OFF, and inputs B and C are ON, what will the outputs X and Y be?

A) X is OFF, Y is OFF B) X is OFF, Y is ON C) X is ON, Y is OFF D) X is ON, Y is ON

It's informatics!
Logic gates are the fundamental building blocks of digital electronics, like computer processors. Zeroes and
Ones are represented by switching on or off electrical currents. In todays processors, billions of such gates are
fitted together to make a computer work. The analysis of such networks can be done using boolean algebra.
One can for instance show, that input C has no effect in the above network.

Keywords
Logic gates
Boolean algebra

13 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T14: Car Passing


Six cars are trapped on a narrow road. Three of the cars (A, B, and C) are going in the same direction, and
there are three others cars (1, 2, and 3) going in the opposite direction. Fortunately, cars can use a passing
bay for one car at the time near the checkpoint (as in the initial state figure). This checkpoint counts the
number of cars driven through it. Each car can go forwards or backwards along the straight road or stop
on the road or in the passing bay.

What is the minimum number of passes past the checkpoint to drive all cars from the initial state to
the goal state?

A) 6 passes B) 9 passes C) 15 passes D) 18 passes

It's informatics!
This is a sorting problem, in which the elements in a list should be sorted into a required permutation. Students
will also apply the concepts of FIFO and LIFO like how the queue and the stack operate.

Keywords
Sorting
Queue
Stack

14 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T15: Serial Transmission


Beavers Alice and Bob want to send signals in the night using a flashlight. They transmit sequences of 4
symbols '0' or '1'. Before each sequence they turn on the light for 1 second. If the symbol is '0', the light
is on for 1 seconds and if the symbol is '1', the light is off for 1 second. After each sequence a pause of
at least 1 second is made. For example, the sequences '1001' and '0110' are transmitted as follows:

Which sequence or sequences are transmitted in the following diagram?

A) 1100 and 0011 B) 0011 and 1100 C) 1100 and 0001 D) 1010 and 0011

It's informatics!
This task describes the core of the RS232 protocol for data exchange over a serial cable. Some GPS devices and
many programmable micrcontrollers use this protocol for its simplicity. Turned off corresponds to a negative
voltage and turned on to a positive voltage. Normally one uses 8 Bits (Symbols '0' or '1') which make up 1 Byte
(instead of only four like in this task).

Keywords
RS232
Serial transmission
Bits
Bytes

15 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T16: Painting robot


Beaver-tennis is played on an odd-shaped court shown below.

Beaver uses a robot to paint lines for the court. To save paint, Beaver wants to paint all the lines without
painting any lines twice. The painting robot can only be switched off when it has finished painting.

Find the way to paint the tennis court without painting any lines twice.

A) A → B → C → D → E → B → D → A → B B) A → D → B → E → D → C → B → A → E
C) A → D → B → E → D → C → B → A D) E → A → D → E → B → C → D → E

It's informatics!
This problem is the Eulerian tour problem. That is finding a path in a graph that visits every edge of the graph
exactly once. Such Eulerian trails are used in various domains such as bioinformatics or circuit design.

Keywords
Graph
Eulerian tour
Path

16 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T17: Railway-System

In the mapped railway-system the trains A and B have to swap their positions with the trains C and D.
All trains will start in a schedule with an offset of one hour.
It takes one hour to cover the distance between two stations.
Once a train has started it cannot be held back anymore.
The scheduler has to prevent all crash scenarios.
Scenario 1 occurs if two trains use the same single track line at the same time. Scenario 2 occurs if two
trains pull into the same station at once.
Now it's on you to create the train-schedule.

How does your train-schedule looks like?

It's informatics!
The scheduler in this task works like a semaphore in an operating system. A semaphore is a data type consisting
of both integer and access operations. It can be used for controlling access to a common resource in a multi-
user environment for example. Each process (user) that requests access to the resource has to call an access-
operation first. The semaphore has to prevent that two processes modify/use one and the same resource at
the same time to suppress interactive manipulation. In the task the scheduler has to map the train schedule
correctly to prevent simultaneously use of the bottle-neck part of the railway-system.

Keywords
Scheduling
Semaphore
Multi-user environment
Bottle-neck

17 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T18: Carrot Storehouses


Ruby Rabbit has 32 storehouses with carrots for the next winter for her large family. Storehouses stand in
a row. Every storehouse has some amount of carrots, for example, the picture shows that there are 2, 5,
3 and 1 tons of carrots in the first four storehouses. Other storehouses are marked with a star.

Ruby made some computations. First, she organized the houses into pairs and computed the number of
carrots for each pair. The picture shows that there are 7 and 4 tons in the first two pairs. Then she paired
the pairs, and again computed the amount of carrots. So, there are 11 tons of carrots in the first four
storehouses. She continued in that manner, filled all rectangles on the picture with numbers, and finally
computed the total amount of carrots she has got.

Imagine now, Ruby wants to compute the amount of carrots in a segment of consecutive storehouses, for
example, from the 8th to the 22nd storehouse (they are market with a brace). She does not need to add
all the amounts from these houses, she may add the amounts from the rectangles marked with red. So,
she needs to sum up only 4 numbers instead of 15.

What is a minimal amount of numbers that are always enough to add for Ruby if she wants to compute
the carrots in any segment of consecutive storehouses?

A) 6 B) 7 C) 8 D) 15

It's informatics!
The problem describes the data structure known as “segment tree”. It allows fast summing up of a segment of
elements in an array, and also it allows fast changing of elements. If one array element is changed, then one
should only recompute one segment at each level.

Keywords
Segment tree

18 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T19: Shout Your Name


Seven kids named Ana, Beate, Cezar, Diana, Elena, Ieva and Greg get together. Some of the kids point to
each other as shown below.

Cezar is pointing to Diana with his right hand and to Elena with his left hand.
More generally, anything in the form below means that kid X is pointing to kid Y with his right hand and
kid X is pointing to kid Z with his left hand.

As soon as a kid is tapped on the head, he shouts his name if he is not pointing at any other kids. Otherwise,
assume X is pointing to Y and Z with his right and left hands respectively. Then, in order:
1. Kid X taps the head of kid Y.
2. Kid X waits for kid Y to shout Y's name.
3. Kid X taps the head of kid Z.
4. Kid X waits for kid Z to shout Z's name.
5. Kid X shouts her name (X's name).

To begin, Ana is tapped on the head.


In what order do the seven kids shout out their names?

A) Beate, Ieva, Diana, Greg, Cezar, Elena, Ana


B) Beate, Ana, Cezar, Diana, Ieva, Greg, Elena
C) Beate, Ieva, Greg, Diana, Elena, Cezar, Ana
D) Beate, Ana, Cezar, Ieva, Greg, Diana, Elena

It's informatics!
This task involves at least two fundamental computer science concepts. First, the picture is a binary tree which
can be used to represent some data that is “nested” or arranged in a hierarchy. Large binary trees consist of
smaller binary trees in the same way we can find many instances of “X,Y,Z” in the picture of seven kids. This
allows the process in the task to be recursive. That is, the process (or algorithm) is described in terms of itself.
When used with care, recursion and binary trees can be used to solve a wide ranging set of problems in natural
and efficient ways.

Keywords
Binary tree
Recursion
Traversal
Postorder

19 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T20: Path to the Summit


The cable-car-system goes to the
mountain-top in several lines.
Every line is equipped with one
disco-gondola, which has music
playing inside.

Tom needs to travel from the base


camp-station to the summit-
station, but he likes music, so he
will travel only in disco-gondolas.
All lines move counterclockwise.
Their speeds are equal, so on each
station new gondolas arrive
simultaneously. If Tom arrives at
some station and sees a disco-
gondola arrived at the other line, he can occupy it immediately.

Which is the fastest way for Tom to the summit, if at his arrival at the bascecamp- station, the state of
the cable-car-system was as in the image.

A) basecamp ⤇ snowbar ⤇ summit


B) basecamp ⤇ snowbar ⤇ basecamp ⤇ summit
C) basecamp ⤇ summit
D) basecamp ⤇ mountain-view ⤇ summit

It's informatics!
The main topic of this task is called “shortest path problem”. The shortest path problem deals with finding the
shortest path between two nodes in a network of nodes. The length of a path depends on the weight of each
of its constituent nodes. The path with the minimum total weight is the shortest one. In the example, the
weight of each node depends on both time and the state of the system at the beginning. For example: the
weight of the purple line at t=0 (at the beginning) is 12 because it would take 12 moves to reach the summit-
station with the disco-gondolas. At t=7 (the time Tom returns from snowbar-station in answer B) the weight of
the purple line is 5 because Tom could change directly from pink to purple.

Keywords
Shortest path problem
Graph theory
Königsberg bridge problem
Loops
Greedy algorithm

20 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

Tasks T21 – T30 carry 5 points each


T21: Jump sequence
Sven the frog is playing a jumping game on numbered squares. He starts on square 0 and then jumps 1
step forward, then 4 steps, then 7 steps, then again 1 step, then 4, and so on, repeating forever. A
square is good if Sven visits the square during his game.

Which of the following sequences of squares contain only good squares?

A) 38, 59, 124 B) 36, 61, 125 C) 38, 60, 124 D) 36, 59, 125

It's informatics!
When faced with an algorithm, such as Sven's jump sequence, it's often useful to execute the algorithm for a
few steps to try to discover a pattern. From this pattern, it might be possible to derive a more efficient way of
solving the problem than naively running the algorithm.

Keywords
Algorithm
Modulus

21 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T22: Rotation Tool


There is a rotate tool on the computer. If you select a picture and use this tool,
the picture will turn clockwise (see picture). You can use it several times on
the same picture.

Which of puzzle pieces A, B, C, D is impossible to get from the puzzle piece X


with the rotate tool?

A) B)

C) D)

It's informatics!
To know how to work with computer means not only to use its tools but to understand how they work and
what they are able to do. The good way how to decide which solution is impossible is to compare all images
and search for distinguishing feature.

Keywords
Rotate tool
Transformation

22 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T23: Cutting pipes


Xavier has pipes of length 4, 7 and 100 meters. For a new project he needs a pipe of 13 meters.
Unfortunately, Xavier lost his tape measure. All he has now is a machine that cuts a pipe using the existing
pipes and any new lengths produced from them as a reference measure.

Xavier wants to keep as much of the 100-meter pipe intact as possible.

How long is the longest possible pipe after producing a 13-meter pipe?

A) 87 B) 82 C) 81 D) 76

It's informatics!
That problem is an optimization problem, where the state space has to be searched to find a solution that
minimises the number of cuts of the main log of 100m.

Keywords
Combinatorics
Optimization
Scheduling

23 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T24: Robber Language


In the "robber language" (used in Astrid Lindgren's children's books about Kalle Blomkvist), each consonant
in a word is replaced with a combination: the consonant, then 'o', and then the consonant again; while the
vowels are left unchanged.
For example, the word “beaver” becomes “bobeavoveror”.
Beaver Oskar encrypts his passwords with the robber language, and for additional security he does not
always change all the consonants. So if he has written "dodog", the original password could have been
either "dog" or "dodog".

On one note, Oskar has written "boboboborororhejmowowdor". How many different passwords could
be encrypted there?

A) 7 B) 12 C) 16 D) 24

It's informatics!
A very useful strategy in computer science is to break down the problem into smaller subproblems. Sometimes
these are completely independent, as in this case. If the subproblems are interconnected, a more sophisticated
algorithm is usually required.

Keywords
String algorithms

24 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T25: Trees in the Forest


In the forest, there are two special kinds of trees that grow.
Type A trees live for only one year (starting from a seed), but at the end of this year they release a seed
for a B tree.
Type B trees live forever and produce one A seed at the end of every year.

If we start with just one A tree seed in the forest, how many A trees and B trees will there be after 10
years?

A) 34 A trees, 20 B trees B) 54 A trees, 144 B trees


C) 34 A trees, 55 B trees D) 121 A trees, 55 B trees

It's informatics!
This task is about a recursive formula: we have a sequence of numbers (amounts of trees in this task) where
each number is evaluated based on previous numbers in a sequence. Such sequences usually appear in design
of algorithms because it usually turns out that it is hard to solve some problem at once, one should start from
more simple problems. Here we do not get the answer for the 10th year at once, we sequentially solve the
same problems for the 1st, 2nd, 3rd years and so on. This approach to programming is called a dynamic
programming.

Keywords
Recursive formula
Fibonacci numbers
Dynamic programming

25 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T26: Rectangles
A small robot is specialized in drawing rectangles. These are the commands it can execute.

Orange Draw an orange line of length 1 unit


Black Draw a black line of length 1 unit
Turn Turn 90 degrees to the right

These are the rules the robot can follow.

A,B do A followed by B
nxB do B n times
n x (...) execute the commands within the brackets n times.

The robot wants to draw the image shown here in orange and black. It is given four possible sets of
instructions to follow. However one of them will not lead to a drawing of the correct shape.

Which one of these sets of instructions is WRONG?

A) 4 x (2 x (Orange , Turn) , Orange , 3 x Black , Orange , Turn)


B) 4 x (3 x Black , 3 x (Orange , Turn) , Orange)
C) 4 x (2 x (Orange , Turn) , 3 x Black , 2 x (Orange , Turn))
D) 4 x (Black , 3 x (Orange , Turn) , Orange , 2 x Black)

It's informatics!
The program of the robot is a so-called algorithm, in other words a sequence of commands. It describes how a
problem (here the drawing of the figure) is solved by decomposing the problem into many small individual
steps.
These individual steps are repeatedly executed when needed (here, for example, 3 x Black to draw the long
black line).
If the right commands are in the correct order, we have a program that solves the problem.

Keywords
Algorithm

26 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T27: Putting People in Line


You are in charge of arranging a group of people in the correct order by the number on individual's shirts.
The initial ordering is:
732985146
You will arrange individuals using the following technique:

– Look at two consecutive people at a time, starting from the left


– If the person on the left has a number which is larger than that of the person on the right, switch the
positions of those two people; otherwise, leave them in the order they are in
– Move to the right one position, so that you are comparing one new person with one of the people just
compared, and repeat the above comparison and potential swap

Once you have compared the right-most two people in the list, we call this “one pass” over the list.

How many passes over the list are required until the list is in the order 1 2 3 4 5 6 7 8 9?

A) 2 B) 4 C) 6 D) 9

It's informatics
The process described above is an algorithm known as “bubble-sort”. The algorithm will sort any sequence into
increasing order, but the worst-case running time is quadratic in the size of the input. Other sorting algorithms
include mergesort, quicksort and heapsort, each of which highlights different aspects of algorithm analysis and
also various data structures (such as heaps, in the case of heapsort) or algorithms (such as recursive divide-
and-conquer in both quicksort and mergesort).

Keywords
Bubble-sort
Sorting techniques
Algorithm running time

27 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T28: Summed Area Table


A colony of beavers lives in a rectangular wetland, which is divided into a 6x5 grid as shown on the left
map below.

One big tree that is located at the bottom left corner of the map is used a reference point. In order to
keep each beaver's home a secret from other animals, the beavers decided to encrypt their map. They
put an integer in each grid of the encrypted map (a 6x5 table). The last year map is shown above on the
right. Figure out how the encryption works.

The encrypted map of this year looks like the table below:

How many beavers are living in the bold rectangle region?

A) 5 B) 4 C) 3 D) 2

It's informatics!
A summed area table is an efficient data structure to calculate the sum of values in a rectangle subset of a grid.
It has been used in several computer science applications, for example, in Haarlike features for object
recognition.

Keywords
Summed area table
Integral image
Encryption

28 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T29: Soda Machine

Oh no! The new soda machine has got only two buttons (A, B). But there are four drinks (warm coffee,
warm tea, cold apple juice, cold soda). Carl the clever caretaker programs the machine to offer a choice of
four drinks at the press of two buttons:
First press A for a warm drink and B for a cold drink.
Then press A for coffee and B for tea, or A for Apple juice and B for Soda, respectively.
Example: Press B – A for apple juice.

Which instruction is correct?

A) Press A – A for two warm beverages. B) Press A – B for a warm tea.


C) Press B – B for a cold tea. D) Press B for soda.

It's informatics!
It's informatics because it refers to coding. With 2 buttons you need a code length of 2 (first press X, then press
Y) for the coding of 4 drinks. Furthermore it's informatics in relation to finite state automata. These are
imaginary automata for the purpose of modelling the behaviour of real machines. If you want to describe the
soda machine controller in terms of a finite state automaton, you need a state „Start“. From „Start“ there is a
transition to „Warm“ by pressing A and a transition to „Cold“ by pressing B. From „Warm“ there are transitions
to „Coffee“ and „Tea“. From „Cold“ there are transitions to „Apple juice“ and „Soda“. The state diagram is
helpful to answer the question, as A – A clearly results in a Coffee, B – B in a Soda. B results in the „Warm“-
State.

Keywords
Final state automata

29 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

T30: Beaver the Hobbit


Beaver goes on an adventure. He has to pick up three rings and then throw them in the lava of a volcano.
After this he wants to return back home.

Beaver has a map. Every path on the map can be walked in exactly one day. Beaver is allowed to take the
same path more than once, and he does not have to walk on every path.

What is the minimum number of days that Beaver has to walk to pick up the three rings, then throw them
in one of the volcanoes and then return home?

A) 9 B) 10 C) 11 D) 12

It's Informatics!
The goal of this problem is to find a shortest path that satisfies several constraints. The path must go through
three particular nodes of the map, and it must then go through at least one of two particular nodes of the map.
One way to be sure that there is no better solution consists in trying all possible paths, in a bruteforce way. The
bruteforce approach is always an effective way to solve a problem using a computer, even though it only gives
results in a reasonable amount of time when the number of possibilities to enumerate is not too large (e.g.,
less than a billion). Otherwise, more clever algorithms may need to be devised.

30 Student Level (Class 11-12)


B bras
International Contest on
Computational Thinking Time Allowed: 150 Minutes

CORRECT ANSWERS
Task # Answer Task # Answer Task # Answer
1. C 11. B 21. B
2. D 12. C 22. B
3. B 13. B 23. C
4. D 14. D 24. B
5. B 15. A 25. C
6. D 16. B 26. C
7. B 17. B 27. C
8. A 18. C 28. C
9. A 19. C 29. B
10. C 20. D 30. B

31 Student Level (Class 11-12)

You might also like