IBIC-Sample Paper-CLASS 11-12
IBIC-Sample Paper-CLASS 11-12
International Contest on
Computational Thinking Time Allowed: 150 Minutes
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.
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
He decided that he will not rotate or cut the tiles in any way.
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
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?
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
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
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
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
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
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
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.
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
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.
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
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.
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
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
If input A is OFF, and inputs B and C are ON, what will the outputs X and Y be?
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
What is the minimum number of passes past the checkpoint to drive all cars from the initial state to
the goal state?
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
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
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
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.
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
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
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).
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
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.
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
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
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
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
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
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?
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
T26: Rectangles
A small robot is specialized in drawing rectangles. These are the commands it can execute.
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.
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
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
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:
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
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.
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
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.
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