This post is mainly for Rohan Bhaiya. He gave me/EGMO contestants a lot and lots of problems. Here are solutions to a very few of them.
To Rohan Bhaiya: I just wrote the sketch/proofs here cause why not :P. I did a few more extra problems so yeah.
I sort of sorted the problems into different sub-areas, but it's just better to try all of them! I did try some more combo problems outside this but I tried them in my tablet and worked there itself. So latexing was tough.
Algorithms
- Algorithms Pset by Abhay Bestrapalli
- Algorithms by Cody Johnson
Problem1: Suppose the positive integer $n$ is odd. First Al writes the numbers $1, 2,\dots, 2n$ on the blackboard. Then he picks any two numbers $a, b$ erases them, and writes, instead, $|a - b|$. Prove that an odd number will remain at the end.
Proof: Well, we go $\mod 2$. Note that $$|a-b|\equiv a+b\mod 2\implies \text{ the final number is }1+2+\dots 2n\equiv n(2n+1)\equiv 1\mod 2.$$
Problem2[BAMO 1999]: A lock has $16$ keys arranged in a $4 \times 4$ array, each key oriented either horizontally or vertically. In order to open it, all the keys must be vertically oriented. When a key is switched to another position, all the other keys in the same row and column automatically switch their positions too. Show that no matter what the starting positions are, it is always possible to open this lock. (Only one key at a time can be switched.)
Proof: Well, note that the in the $4\times 4$ array, whenever we change a cell ( say cell $a$), $6$ more cells are affected. ($3$ rows and $3$ columns). Well, applying this move on all these $6$ cells will give us the same $4\times 4$ array, every cell is the same except cell $a$ which has now changed. We can repeat this move and we are done.
Problem3[BAMO 2006]: Suppose that n squares of an infinite square grid are colored grey, and the rest are colored white. At each step, a new grid of squares is obtained based on the previous one, as follows. For each location in the grid, examine that square, the square immediately above, and the square immediately to the right. If there are two or three grey squares among these three, then in the next grid, color that location grey; otherwise, color it white. Prove that after at most n steps all the squares in the grid will be white.
Proof: We take the smallest possible rectangle which includes all the grey cells. Now, note that the cells outside this rectangle would always be white. We will induct the size of the rectangle. Consider the rectangle ($R'$) which doesn't have the leftmost column (column $l$) and bottommost row (row $r$). Note that the column $l$, row $r$, doesn't affect cells inside $R'$. Applying induction, we get that after some finite moves, $R'$ will be all white cells. So now only a few cells of the column $l$ and a few cells of row $r$ are grey. But in the next step, all cells will go white except the leftmost cell (which might still be grey). Again, after another step, we get all cells white. Done!
Problem4[Cody Johnson]: Consider an ordered set $S$ of $6$ integers. A move is defined by the following rule: for each element of $S$, add either $1$ or $-1$ to it. Show that there exists a finite sequence of moves such that the elements of the resulting set, $S' = (n_1, n_2, \dots , n_6)$, satisfy $n_1n_5n_6 = n_2n_4n_6 = n_3n_4n_5$.
Solution: Well, clearly after a finite amount of moves, we can get all elements to be either $0$ or $1$. ( Say, once an element becomes $0$, we can then just add one and then subtract one to this element, while making sure other elements become $0$ or $1$.)
Now, after these moves, if we have $n_1n_5n_6 = n_2n_4n_6 = n_3n_4n_5=1$ or $n_1n_5n_6 = n_2n_4n_6 = n_3n_4n_5=0$ then we are done.
Else, we will have two cases.
Case1: $n_1n_5n_6 = n_2n_4n_6 =1, n_3n_4n_5=0$ (and it's permutations). Then notes that $(n_1,n_2,n_3,n_4,n_5,n_6)=(1,1,0,1,1,1)$. Then simply do $(0,0,1,0,0,0)$ which works.
Case2: $n_1n_5n_6 = n_2n_4n_6 = 0, n_3n_4n_5=1$ ( then we have $n_3=n_4=n_5=1$, then just make $n_3,n_4,n_5=0$. And we are done.
Problem5: Let $\Delta$ be the maximum degree of the vertices of a given graph. Devise a method to color this graph using at most $\Delta + 1$ colors such that no two neighboring vertices are of the same color.
Proof: Well, this sounds very obvious, but here is an algorithm which def works
- We give consider the following $\Delta+1$ colours: $C_1,\dots, C_{\Delta+1}$.
- Give preference to colours as $C_1>\dots> C_{\Delta+1}$.
- Now consider with any vertex and give it colour $C_1$ (since preference to $C_1$)
- And continue colouring.
- Now, at any stage, to colour the vertices, first see the adjacent vertices, and then colour the vertex with the colour which has not been used in the adjacent vertices ( and colour by preference).
- There can not be any problem as there are $\Delta+1$ colours.
Problem6: We have $n^2$ balls of $n$ colors. Show that we can place into n bins so that every bin has almost $2$ colors of balls. Each bin gets $n$ balls.
Proof: The following algorithm works for any $mn$.
- Well consider the sequence $a_1\le \dots\le a_n$ denote
Problem7[CAMP Application]: Given $n$ points on a plane, prove that you can label them $P_1, \dots, P_n$ such that $\angle P_iP_{i+1}P_{i+2} < 90^{\circ}$ for $1 \le i \le n-2.$
Proof: Well, here is the algorithm which works.
- Choose a random point. Name it $P_1.$
- Choose the farthest point from $P_1$ and name it $P_2.$
- Choose the farthest point from $P_2$ ( a point not chosen yet), and name it $P_3.$
- Continue the process till it terminates.
Invariance/Monovariance
References:
- Invariants and Monovariants by James
- Invariants by Dylan Yu
Problem8: Several positive integers are written on a blackboard. One can erase any two distinct integers and write their greatest common divisor and least common multiple instead. Prove that eventually the numbers will stop changing.
Proof: Well the product is invariant however the sum increase as $\gcd(a,b)+\text{lcm}(a,b) > a+b$. Say $\gcd(a,b)=d, a=dm,b=dn$. Then $\gcd(a,b)+\text{lcm}(a,b)=d+dmn, a+b=dm+dn$. And $mn+1>m+n$.
Problem9: Given a graph $G$ on $n$ vertices, show that we can color the vertices with the colors red and blue so that for every vertex, at least half of its neighbors are of opposite color.
Proof: Do any colouring. Now, if for any vertex, the number of neighbours of opposite colour are not at least half, then swap the colour of the vertex. Note that number of edges with distinct colour vertex endpoints increases. But there is only finite such edges. Hence this process must terminate.
Problem10: On an $n\times n$ board, there are $n^2$ squares, $n-1$ of which are infected. Each second, any square that is adjacent to at least two infected squares becomes infected. Show that at least one square always remains uninfected.
Proof: Name the rows as $r_1,r_2,\dots,r_n$ and columns as $c_1,c_2,\dots,c_n$. Say these $n-1$ squares are in $i$ rows and $j$ columns. Note that even after $n$ seconds, these infections can not go to a new square row or column. Hence at least one square always remains uninfected.
Problem11[ISL 2014]: We have $2^m$ sheets of paper, with the number $1$ written on each of them. We perform the following operation. In every step we choose two distinct sheets; if the numbers on the two sheets are $a$ and $b$, then we erase these numbers and write the number $a+ b$ on both sheets. Prove that after $m2^{m-1}$ steps, the sum of the numbers on all the sheets is at least $4^m$.
Proof: Well, consider the product. Note that after every minute, the product changes by $$\frac{P(a+b)^2}{ab}$$ and comparing it with $P$, we get by AM-GM $$\frac{P(a+b)^2}{ab}\ge 4P.$$ So the product multiplies by $4$ times, every minute. So after $m2^{m-1}$ steps, the product should be atleast $4^{m2^{m-1}}$ and hence the sum of numbers should be atleast, by AM-GM, $$2^m\cdot \sqrt[2^m]{4^{m2^{m-1}}}=4^m.$$
A good thing is to consider weights. We want stuffs to either be constant or increase strictly or decrease strictly usually.
Problem13[ISL 2012]: Several positive integers are written in a row. Alice chooses two adjacent numbers $x$ and $y$ such that $x > y$ and $x$ is to the left of $y$, and replaces the pair $(x, y)$ by either $(y + 1, x)$ or $(x - 1, x)$. Prove that she can perform only finitely many such iterations.
Proof: Here say we index rows $r_1,\dots,r_n$ and give weights $w_1<\dots<w_n$. Then we have $$w_1x+w_2y\rightarrow w_1(y+1)+w_2x, w_1(x-1)+w_2x$$
Taking weights such that $w_1<w_2$, we get that by reaarnegment inequality, $$w_1x+w_2y\le w_1(y+1)+w_2x, w_1x+w_2y\le w_1(x-1)+w_2x.$$ Hence the sum always increases.
But this cannot go on forever as there is a maximum sum. Hence this has to stop.
Taking $(w_1,\dots,w_n)=(1,2,\dots,n)$ works.
Problem14[Russia 2022]: $200$ natural numbers are written in a row. For any two adjacent numbers of the row, the right one is either $9$ times greater than the left one, $2$ times smaller than the left one. Can the sum of all these 200 numbers be equal to $24^{2022}$?
Proof: So we sort of want $9x\equiv x/2\mod m$. Taking $m=17$ works. We get that 17 must divide the sum. But $17$ doesn't divide $24^{2022}$.
Problem 15[Russia 2008]: A natural number is written on the blackboard. Whenever number $ x$ is written, one can write any of the numbers $ 2x + 1$ and $ \frac {x}{x + 2}$. At some moment the number $ 2008$ appears on the blackboard. Show that it was there from the very beginning.
Proof: Note that the sum of numerator and denominator (not written in simplified form) after any move doubles. But here we have the sum as $2009$.
Problem 16[EGMO2023 TST India]: Alice has an integer $N > 1$ on the blackboard. Each minute, she deletes the current number $x$ on the blackboard and writes $2x+1$ if $x$ is not the cube of an integer, or the cube root of $x$ otherwise. Prove that at some point of time, she writes a number larger than $10^{100}$.
Proof: Suppose not. Then in any case, add $1$ to all the terms of this sequence. Note that $$x+1\rightarrow 2(x+1) \text{ or } x^3+1\rightarrow z^3+1=(z+1)(z^2-z+1)\rightarrow z+1.$$
Note that $z^2-z+1$ is always odd. So after every move, the $v_2$ of the terms is non decreasing. Since the sequence is bounded. After good enough steps, $v-2$ stops increasing and then the cube root operation will be performed forever. Which is not possible.
Problem 17[Tuymaada 2018 P6]: The numbers $1, 2, 3, \dots, 1024$ are written on a blackboard. They are divided into pairs. Then each pair is wiped off the board and non-negative difference of its numbers is written on the board instead. $512$ numbers obtained in this way are divided into pairs and so on. One number remains on the blackboard after ten such operations. Determine all its possible values.
Proof: Note that the final number as $$1+2+\dots+2^{10}\equiv 0\mod 2.$$
And every even number is achievable. Say the number is $x$. Then here is the construction
$$(1,2),\dots, (2^{10}-x-3,2^{10}-x-3,2^{10}-x-2), (2^{10}-x,2^{10}-x+1),\dots (2^{10}-2,2^10-1),(2^{10}-x-1,2^{10})\rightarrow (1,1,\dots,1,x+1)\rightarrow (1,\dots, 1,x).$$
Problem 18[USAMO 2003]: At the vertices of a regular hexagon are written six nonnegative integers whose sum is $2003^{2003}$. Bert is allowed to make moves of the following form: he may pick a vertex and replace the number written there by the absolute value of the difference between the numbers written at the two neighboring vertices. Prove that Bert can make a sequence of moves, after which the number $0$ appears at all six vertices.
Sketch: Well, note that the maximal element in every move is either same or decreased. So now consider the step when the sum of the vertices is the minimum. And then just bash it. Note that one vertex must be $0$ and then we get many inequalities. At the end it is force that of four element, two are equal to each other, and there is one $0$.
Problem 19[TOT]: On a blackboard, several polynomials of degree $37$ are written, each of them has the leading coefficient equal to $1$. Initially all coefficients of each polynomial are nonnegative. By one move it is allowed to erase any pair of polynomials $f, g$ and replace it by another pair of polynomials $f_1, g_1$ of degree $37$ with the leading coefficients equal to $1$ such that either $f_1 + g_1 = f + g$ or $f_1g_1 = fg$. Prove that it is impossible that after some move each polynomial on the blackboard has $37$ distinct positive roots.
Proof: Take $$f=x^{37}+a_1x^{36}+\dots+ a_{37}$$
$$g=x^{37}+b_1x^{36}+\dots+ b_{37}$$
$$f_1=x^{37}+c_1x^{36}+\dots+ c_{37}$$
Graph Theory
Extremal Problems/Greedy Algorithms
- Algorithms Pset by Abhay Bestrapalli
- Algorithms by Cody Johnson
- Rushil Mathur's Greed is good OMC lecture
Dear Sunainam thankyou for posting these. Very helpful. Can you do the same for geometry?
ReplyDeleteBro the blog is filled with geometry solves,go just check'em out.
DeleteGonna grind these for APMO (in a week and i dont wanna lose out on a stupid combi)
ReplyDeleteayyy!!! Congrats for qualifying for APMO!
DeleteWow! This is very nice. It's very helpful.
ReplyDeletetitan watch repair shop near me