1st Iranian Combinatorics
Olympiad
Contest problems with solutions
1st Iranian Combinatorics Olympiad
Contest problems with solutions.
This booklet is prepared by Seyed Reza Hosseini, Matin Yousefi, Benyamin
Ghaseminia, Abolfazl Asadi and Alireza Dadgarnia.
With special thanks to Morteza Saghafian.
The 1st Iranian Combinatorics Olympiad was held on April 22nd , 2020 with
over 750 participants in 320 groups and each group was consisted of either
two or three members. The Problem Selection Committee for 1st Iranian
Combinatorics Olympiad was consisted of
Morteza Saghafian, Alireza Alipour, Yaser Ahmadi Fouladi,
Abbas Servati, Abolfazl Asadi, Seyed Reza Hosseini, Seyed
Hessam Firouzi, Afrouz Jabalameli
The Problem Selection Committee gratefully acknowledges the assistance of
Erfan Moeini, Alireza Abdollahpour, Kasra Masoudi,
Shayan Peyghambari, Sina Pakseresht, Amirreza Akbari,
Arsham Jamshidi, Mohammad Mahdi Hatami, Sadra
Dashti, Mohammad Heydari, Mohammad Saeid Haghi, Mo-
hammad Bagher Sharifi, Dorsa Majdi, Mohaddese Ghafari,
Sana Amin Naji, Amir Mohammad Imani, Mehrshad Mo-
hammadi, Sogol Samanian, Diba Hashemi
who played a decisive role in holding the contest as online referees. Thanks
should also go to Arman Karimi and Mohammad Ali Heydari for designing
the online system.
Contents
Short Answer Exam 3
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Main Exam 11
Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Short Answer Exam
1
Problems
1) Consider a 9 × 9 table with a bear in the middle cell of the top row and
a beehive in the middle cell of the bottom row. We want to dig a hole in 6
cells (other than initial cells containing the bear and the beehive) of the table.
After digging the holes, the bear starts moving towards the beehive. In each
step the bear moves from a cell to a cell with no holes that has an adjacent
edge to it. The holes must be chosen such that there is at least a valid path
that the bear can take to reach the beehive. The bear always chooses the
shortest possible path. In all possible ways of digging the holes, what is the
maximum number of steps that the bear takes to reach the beehive?
2) What is the number of sequences of letters a, b and c of length 7 such
that no two adjacent letters are the same and no two sub-sequences are equal?
A sub-sequence is a consecutive set of letters from the sequence.
3) Consider the ordered pairs (0, 0), (0, 1), . . . , (9, 8) and (9, 9). Assign a
card to each of these 100 pairs. We have a subset of these 100 cards and a de-
vice that takes two cards like (a, b) and (c, d), then other than returning these
cards, it also gives us two more cards with ordered pairs of (min{a, c}, min{b, d})
and (max{a, c}, max{b, d}). Find the minimum number of cards needed to
obtain all 100 cards using the device.
4) Football league organization of Abolfistan has announced that if the
Corona pandemic does not end until December, due to shortage of time in
the next season every two team will play against each other exactly once.
This league has 2048 teams. To choose the host, the organization uses the
following algorithm:
For each match in week i, if the teams who have to play each other have
not hosted the same number of games in the past i − 1 weeks, the host
will be the team with lower number of hosting, otherwise the host will
be chosen randomly.
3
4 Problems
What is the maximum possible number of times a team can be a host?
5) Find the total number of possible ways to partition the set {1, 2, . . . , 99}
into some subsets such that the average of elements in each subset equals to
the total number of subsets.
6) For each non-empty subset S of the set A = {10, 12, . . . , 26}, consider a
number cS defined as
multiplication of all elements in S
cS = ,
2|S|
where |S| is the number of elements of S.
10×14×18
For example, for the subset S = {10, 14, 18}, we have cS = 23 . Find
X
cS .
S⊆A, S6=∅
7) A frog is at the origin point of the Cartesian plane. Each time, it jumps
one or two units to the right. Let ab be the possibility of the frog getting to
the point (10, 0) after a few jumps, where a and b are positive integers and
gcd(a, b) = 1. Determine a + b.
8) Each diagonal parallel to one of the main diagonals is called a tape. For
instance, a tape is shown in the following figure:
Figure 1: A tape
Note that each corner cell also counts as a tape, thus there are 26 tapes in
the given figure. Consider a 1399 × 1399 table. We want to put some pins in
Problems 5
some of the cells of this rectangle such that each tape covers an odd number
of pins. Let a and b respectively be the minimum and maximum number of
pins to achieve this. Find the value of a + b.
9) Determine the maximum number of tiles shown in the figure bellow that
can be placed in a 10 × 10 table such that no two of them share a vertex.
Figure 2: L-shaped tetromino
10) Consider the graph shown in the figure bellow. The value of an edge
is defined to be the number of edges intersecting it (other than the ending
points). The maximum value assigned to edges of a graph is called the ugliness
of the graph. Asad wants to redraw the given graph in the following figure
to minimize its ugliness. What is the minimum ugliness that he can achieve?
Figure 3: Graph of problem 10
11) Some bids are placed in the cells of a 1399 × 2020 table. In each turn
we can choose a cell with more than one bid, take two of them and place one
of them in the cell above and place the other in the cell to the right; If the
current cell is the highest cell in its column, the bid is placed in the lowest
cell of the column and similarly, a bid moves from the rightmost cell to the
leftmost cell of the same row. Determine the minimum number of bids needed
such that one can continue this processes forever.
6 Problems
12) We call a set of rectangles as a good set if the following properties are
satisfied:
• All sides of the rectangles are either horizontal or vertical.
• The length of the sides of the rectangles can only be from the set
{1, 2, . . . , 10}.
• The length of at least one side of each rectangle is 6.
• The sum of the area of all rectangles is less than 100.
Determine the minimum value of k such that all the rectangles included in
an arbitrary good set can be located in a rectangle with width 10 and height
k, without overlapping.
Read the following passage and answer to the next 3 problems:
Suppose that G is a Graph with n vertices labeled by 1, 2, . . . , n and A is a
subset of vertices of G with even number of elements. We want to choose
some edges such that the degree of each vertex in A is odd and the degree of
each vertex outside of A is even. Denote the minimum number of such edges
by f (G, A).
13) Let n = 10 and A = {1, 2, 3, 4}. For how many initial graphs G we have
f (G, A) = n − 1?
14) Let G be a cycle with 19 vertices. Find the total sum of f (G, A) for
every possible subset A of G.
15) Let G be a graph shown in the following figure.
Find the number of subsets A of G satisfying f (G, A) = 9.
Problems 7
Short Answers:
1 16
2 18
3 10
4 1029
5 1
6 726485759
7 1707
8 1958602
9 12
10 1
11 3419
12 18
13 33868800
14 2028478
15 1620
8 Problems
Main Exam
9
Problems
1- Increasing Difference.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
A soccer tournament has 2020 teams. Each pair of teams have played each
other exactly once. Suppose that no game have led to a draw. The partici-
pating teams are ranked first by their points, 3 points for a win and 0 point
for a loss; then by their goal difference which is the number of goals scored
minus the number of goals against. Is it possible for the goal difference in
such ranking to be strictly increasing from top to bottom?
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2- Friendly Game.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
Morteza and Amirreza play the following game. First each of them indepen-
dently rolls a dice 100 times in a row to construct a 100 digit number with
digits {1, 2, 3, 4, 5, 6}; None of these players can see the 100 digit number
of the other. After that, each of them simultaneously selects a digit of the
other’s number. If both selected digits are equal to 6, both players win oth-
1
erwise they both lose. Is there a playing strategy with more than 36 chance
of winning?
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
3- Intersecting Chords.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
On the perimeter of a circle, 1399 points and some chords between them are
given.
a) In every step we can take two chords RS, P Q with a common point
other than P, Q, R, S and erase exactly one of RS, P Q, then we draw
P S, P R, QS and QR(if some of them exist then we just keep the existing
chords). Let s be the minimum number of chords after some steps. Find
11
12 Problems
the maximum possible value of s over all possible initial arrangements
of chords.
b) In every step we can take two chords RS, P Q with a common point other
than P, Q, R, S and erase both RS and P Q and draw P S, P R, QS, QR(if
some of them exist then we just keep the existing chords). Let s be
the minimum number of chords after some steps. Find the maximum
possible value of s over all possible initial arrangements of chords.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
4- Common Friend.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
At a party there are 99 guests and each person has at least 81 and at most
90 friends. Prove that there exists a group of 10 people with equal number
of friends such that they all have a common friend.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
5- Way to Success.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
The infinite axis shown in the following figure is a view of Abol’s way to suc-
cess!
0 1 2 3 4 5 6 7 8 9 10
Point 0 refers to his failure. In any other point there is a traffic light. Each
light is either blinking in green, yellow or red. Abol is at point 1 and by
increasing the number of the point he is in, he gets closer to his goal towards
success. In each step the following happens:
Abol looks at the color of the light in his current point. He will
continue moving to the right if the blinking color is green or yellow. If
the light blinks red he moves a point to the left; After Abol has moved
to either right or left, the light that he previously saw, changes its color
from green, yellow and red to yellow, red and green respectively. If
Abol sees a red light at point 1 he will resist for the first time and
stays in the same point (But the light changes). But the second time
he sees a red light in point 1 he gives up and will never move again.
Prove that Abol eventually meets any positive integer point on the axis.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
Problems 13
6- Triangular Grid.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
Consider a triangular grid of equilateral triangles with unit sides. Assume
that P is a simple polygon with perimeter 1399 and sides from the grid lines.
Prove that P has at least one 120◦ or one 240◦ angle.
a simple polygon in a triangular grid
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
7- Red Coin.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
Seyed has 998 white coins, one red coin and an unusual coin with one red
side and one white side. He can not see the color of the coins; Instead he has
a scanner which he can place a subset of the coins on one of their sides and
the scanner tells him whether all of the coin sides touching its glass are white
or not. Prove that Seyed can find the red coin by using the scanner at most
17 times.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
14 Problems
Solutions
1- Increasing Difference.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
A soccer tournament has 2020 teams. Each pair of teams have played each
other exactly once. Suppose that no game have led to a draw. The partici-
pating teams are ranked first by their points, 3 points for a win and 0 point
for a loss; then by their goal difference which is the number of goals scored
minus the number of goals against. Is it possible for the goal difference in
such ranking to be strictly increasing from top to bottom?
Proposed by Abolfazl Asadi
Solution. Assume that such configuration is possible. No two teams can win
the Assume that such configuration is possible. No two teams can win the
same number of matches, because then the ordering of their goal differences
would not satisfy the condition. Each team wins at least 0 and at most 2019
matches. So, the team that finishes k th place wins exactly 2020 − k matches.
Thus 2020th team always lose, and its goal difference is negative, which im-
plies the goal difference of every team is negative. But it is not possible since
the total sum of goal differences equals zero.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
2- Friendly Game.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
Morteza and Amirreza play the following game. First each of them indepen-
dently rolls a dice 100 times in a row to construct a 100 digit number with
digits {1, 2, 3, 4, 5, 6}; None of these players can see the 100 digit number
of the other. After that, each of them simultaneously selects a digit of the
other’s number. If both selected digits are equal to 6, both players win oth-
1
erwise they both lose. Is there a playing strategy with more than 36 chance
of winning?
15
16 Solutions
Proposed by Morteza Saghafian
Solution. The answer is positive. The strategy is that each player selects
the position of his first 6(100 if there is no 6 in his sequence). The possibility
that both of them select the same k is (( 65 )k × 16 )2 . Summing up over all
possible ks, we get
100 100
X 5 1 1 X 5 1 1
(( )k × )2 = + (( )k × )2 > .
6 6 36 6 6 36
k=1 k=2
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
3- Intersecting Chords.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
On the perimeter of a circle, 1399 points and some chords between them are
given.
a) In every step we can take two chords RS, P Q with a common point
other than P, Q, R, S and erase exactly one of RS, P Q, then we draw
P S, P R, QS and QR(if some of them exist then we just keep the existing
chords). Let s be the minimum number of chords after some steps. Find
the maximum possible value of s over all possible initial arrangements
of chords.
b) In every step we can take two chords RS, P Q with a common point other
than P, Q, R, S and erase both RS and P Q and draw P S, P R, QS, QR(if
some of them exist then we just keep the existing chords). Let s be
the minimum number of chords after some steps. Find the maximum
possible value of s over all possible initial arrangements of chords.
Proposed by Afrouz Jabalameli, Abolfazl Asadi
Solution. a) Call a chord side if it is between two consecutive points and
call it a diameter otherwise. We prove that the answer is 2n − 3 whenever
there are n points on the circle. Consequently the final answer is 2795.
Consider a convex n-gon along with an arbitrary triangulation of this
polygon. Since these chords are pairwise non-intersecting there is no possible
moves and the number of initial chords which is 2n − 3 remains constant.
Now we will prove that for any initial arrangement of chords one can reach
a position with no intersecting chords after some number of steps. In that case
the number of drawn chords is less than such a number for a triangulation
Solutions 17
which is 2n − 3. We proceed by induction. The base case is n = 3 in this
case the maximum possible chord is 3 = 2 ∗ 3 − 3. Now assume the induction
hypothesis for all numbers less than n. Note that the claim is true if the
initial position has no diameters since there are no possible moves. So we
may assume the existence of a diameter like P Q. Now we do the problem’s
progress on any chord RS intersecting P Q and delete all such RS. Thus after
this no chord intersects P Q and we can apply the induction hypothesis on
two different sides of P Q. The conclusion fallows.
b)The answer is again 2n − 3 and the construction is similar to A. First
we prove by induction that for any n ≥ 4 if there does not exist intersecting
chords then there are two non-adjacent points non of which are an endpoint
to a diameter. The base case n = 4 is obviously true. For the inductive
step if there does not exist any diameter the assertion is immediate. So we
may assume the existence of a diameter like P Q. Each side of P Q is either
a triangle or it has at least four points. In the triangle case the vertex other
than P and Q in the triangle has no diameter. When there are four points
from the induction hypothesis we can find a vertex with no diameter. In
either case there exists a vertex each side of P Q with no diameter drawn
from it. These two points apply the desired condition.
Back to the main problem we proceed again by induction and prove that
for any initial position one can reach a position with no intersecting chord.
For the base case take n = 4. since there are only 2 diameters assume they
intersect. Performing a step on this two intersecting chord will delete all in-
tersections. For the inductive step ignore a vertex A and use the induction
hypothesis on the other n − 1 points. Then there are no intersection and from
the first part there are two points with no diameters drawn form them (from
the diameters and chords between n-1 points other than A); at least one of
these two points is not adjacent with A call that point B. Ignore B and use
the inductive step on n − 1 other points. Observe that every intersection is
on AB. If AB does not exist the conclusion follows directly. So assume the
existence of AB. Once again form the first part we know that there is a point
C other than A which has no diameter (form the second induction points).
If C and B are non-adjacent or are adjacent but C is not connected to the
other neighbour of B ignoring C from the induction hypothesis on n−1 points
other than C the result follows. So assume that C is adjacent and connected
to the other neighbour of B. After applying a step on intersecting chords AB
and CD there is no diameter connected to B. Ignore B and use the induc-
tion hypotheses on n−1 points other than B deletes all possible intersections.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
4- Common Friend.
18 Solutions
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
At a party there are 99 guests and each person has at least 81 and at most
90 friends. Prove that there exists a group of 10 people with equal number
of friends such that they all have a common friend.
Proposed by Alireza Alipour
Solution. It is impossible for every vertex to have degree 81, because it would
imply that the sum of all degrees is odd. Suppose the contrary. If there does
not exist such 10 vertices. Let v be a vertex with degree more than 81. Con-
sider N (v), the set of neighbours of v. For each k ∈ {81, 82, . . . , 89}, at most
9 vertices of degree k belong to N (v). Since |N (v)| > 9 × 9, there exists a
vertex in N (v) of degree 90. Call this vertex w. Consider N (w), the set of
neighbours of w. By a similar argument N (w) must contain exactly 9 vertices
of degree k for each k ∈ {81, 82, . . . , 90}. Hence, there are at least 10 vertices
that have degree 90. We claim that they constitute the desired 10 vertices.
For each vertex u of the 10 vertices, the number of vertices non-adjacent to
u is 9. Hence, there exist at least 99−10·9 > 1 vertices adjacent to all of them.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
5- Way to Success.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
The infinite axis shown in the following figure is a view of Abol’s way to suc-
cess!
0 1 2 3 4 5 6 7 8 9 10
Point 0 refers to his failure. In any other point there is a traffic light. Each
light is either blinking in green, yellow or red. Abol is at point 1 and by
increasing the number of the point he is in, he gets closer to his goal towards
success. In each step the following happens:
Abol looks at the color of the light in his current point. He will
continue moving to the right if the blinking color is green or yellow. If
the light blinks red he moves a point to the left; After Abol has moved
to either right or left, the light that he previously saw, changes its color
from green, yellow and red to yellow, red and green respectively. If
Abol sees a red light at point 1 he will resist for the first time and
stays in the same point (But the light changes). But the second time
he sees a red light in point 1 he gives up and will never move again.
Prove that Abol eventually meets any positive integer point on the axis.
Solutions 19
Proposed by Yaser Ahmadi Fouladi
Solution. Assume the contrary. let S be the highest number in which Abol
has been at least twice and returned a point back. Note that between any
two returns, Abol moves right at least twice. Hence, Abol has passed point
S and came back again through the point after S at least twice. It means
that Abol has returned back at least twice from the point after S. This is a
contradiction to the maximality of S.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
6- Triangular Grid.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
Consider a triangular grid of equilateral triangles with unit sides. Assume
that P is a simple polygon with perimeter 1399 and sides from the grid lines.
Prove that P has at least one 120◦ or one 240◦ angle.
a simple polygon in a triangular grid
Proposed by Seyed Hessam Firouzi
Solution. Suppose the opposite. Color the vertices of the grid in red, green
and blue in the following format.
Assume the contrary. Without loss of generality, assume that the first and
second color we see are red and blue respectively. Walking around the poly-
gon creates a sequence of colors. In this sequence no two consecutive colors
20 Solutions
are the same. Also color of two vertices with distance two in the sequence
are different since there are no 120◦ or 240◦ angles. So the sequence must
be red → blue → green → red → blue → green → · · · → green → red. But
this means that perimeter of the polygon is divisible by 3, contradicting the
assumption.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
7- Red Coin.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
Seyed has 998 white coins, one red coin and an unusual coin with one red
side and one white side. He can not see the color of the coins; Instead he has
a scanner which he can place a subset of the coins on one of their sides and
the scanner tells him whether all of the coin sides touching its glass are white
or not. Prove that Seyed can find the red coin by using the scanner at most
17 times.
Proposed by Seyed Reza Hosseini
Lemma 1: Consider the Fibonacci sequence. Let n be an integer greater
than 1, then
Fn ≤ 2n−2 .
Proof: We proceed it by induction. For the case n = 2, F2 = 1 ≤ 22−2 =
0. The inductive step follows from
Fn+1 = Fn + Fn−1 ≤ 2Fn ≤ 2.2n−2 = 2n−1 .
Hence the lemma is true for all integers greater than 1.
Lemma 2: We can find the red coin from n coins consisting of a red and
n − 1 white coins in at most dlog2 ne steps.
Proof: We proceed by induction. The base case n = 1 is true since there is
only one coin and it must be red. Assume that the claim for i = 1, 2, . . . n − 1.
We prove that it is true for n as well. We take b n2 c of the coins and put them
in the scanner. From the answer we find out that the red coin is among these
coins the remaining ones. So from the induction hypothesis we can find the
red coin in at most dlog2 (b n2 c)e + 1 which is less than or equal to dlog2 ne
steps.
Back to the main problem. We want to prove that we can find the red
coin among any group of at most Fn coins including at most one unusual coin
using the scanner at most n times. We proceed by induction. For the Base
cases n = 1 and n = 2 we can find the red coin using the scanner at most 1
Solutions 21
and 2 times, respectively. Now assume the claim for i = 1, 2, . . . , n − 1. We
take Fn coins and divide them into groups A and B with at most Fn−1 and
Fn−2 coins, respectively. Then we scan group B. We have the following two
cases:
1. There is no red side meaning that the red coin is in group A. Thus from
the induction hypothesis, we can find it in at most n − 1 steps.
2. There is a red side. In this case, we reverse the coins in the scanner and
scan them again. We have the following two cases:
(a) There is a red side meaning that the red coin is in this group. From
the induction hypothesis we can find the red coin in at most n − 2
steps.
(b) There is no red side meaning that group A has a red coin and at
most Fn−1 − 1 white coins. From the second lemma can find the
red coin in at most dlog2 Fn − 1e steps. But form the first lemma
this number is at most n − 3 which completes the inductive step.
−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−