Sunday 18 August 2024

IMO 2024 quick thoughts

Wow I thought IMO is in August. Is that a sign showing high school math is no longer in my range?

Q1. I don't expect anyone else to notice that floor function related problems is one of the most frequent type of questions appearing on this site but this is indeed a fact, so naturally I like this question a lot.

The integral case is clear: $\sum i\alpha = \alpha n(n+1)/2$, so it works for even integral $\alpha$ but not odd -- note that it must hold for all $n$. Now what about the decimal case? Well, notice that there are $n$ floor functions which means the summands is at most $n$ away from $\alpha n(n+1)/2$. If we choose $n$ so that $\alpha (n+1)/2 \approx m $ is almost an integer -- some fractional approximation here -- we can show that
$|mn - \sum [i\alpha]|\leq |mn - \alpha n(n+1)/2| + |\sum (i\alpha - [i\alpha])| \leq \varepsilon + (n-1/2)$.

Scrolling through the AoPS solutions I feel like my approach is overly analytical (which again, is natural), because it is actually easy to find an explicit $n$ for that.

Q2. Oh...number theory that I can solve. It is fun that both Q1 and Q2 contain conditions to hold for all large enough parameters, then the key is to pick the critical number that actually works.

This is a nicely constructed question, but the "key" is clear when the motivation is grabbed: you want to reduce the power into something $n$-irrelevant. There are a few choices like reducing it to (1) power one but that is trivial (2) power zero which does not help... and (3) power minus 1. In that case we are looking at $(1/a+b, 1/b+a)$ which gives a common denominator of $ab+1$ where a nice characterization arises from here.

Many solutions started immediately proceed to show that $ab+1$ is a power of 2. It works of course but only in the refined final answer. To me it is still easier to start from the traditional Archimedean approach.

Consider a simpler version where $(a,b) = 1$. The key step is to notice that we can actually tweek the gcd terms as follows:
$(a^n + b, b^n + a) = (a^{n+1}+ab, b^n+a) = (a^{n+1}+ab, b^{n+1}+ab)$.
And now, the terms are ready to be subtracted each other:
$(a^{n+1}+ab, b^{n+1}+ab) = (a^{n+1}-b^{n+1}, b^{n+1}+ab)$.

Suppose the above equals $g$ for large enough $n$ and $g$ admits a prime factor $p$. The first term implies $a=b$ mod $p$. For the second term, choosing $n+1 = 2$ mod $p-1$ gives $b^2+ab = a+b = 0$ mod $p$. Since $(a,b) = 1$ the only possibility is $p=2$ with $a,b = 1$ mod 2. 

We now know that $g = 2^r$. i.e., $(a^n-b^n, b^n-ab) = 2^r$ for all large enough $n$, but that sounds counter intuitive because we could certainly expect some coincidences where the gcd is more than $2^r$, say $2^{r+1}$.

It turns out that you do not need to go very far away because mod 4 is enough. If $4\mid g$ we know that $a = b = 3$ mod 4 but then the GCD clearly oscillates between 2 and 4, so $g$ must be 1 or 2. From here the term $ab+1$ kicks in. Take $n = k\varphi (ab+1)-1$ which is of minimum 2, it follows that $ab+1=2$ and so $a=b=1$ is the only solution. The case where $(a,b)\neq 1$ is similar.

I really wonder if there is a reasonable solution without the use of $ab+1$. One possible approach is to argue mod $2^r$ for all $r$ to force $a=b=1$ mod $2^r$ for any $r$ which would lock them at $a=b=1$. Some field theory would be handy, but certainly not expected at this level.

The author says that the problem arose from a CS assignment. Although we do not observe any higher insight behind this is still an elegant number theory problem.

*Update: I suddenly realized my attempt of using alternate powers is not too bad at all. Taking $n = k\varphi (a+b)+1$ we actually reduced $a^n+b$ and $b^n+a$ to $a+b$ -- using the same argument we show that it must be a multiple of $a+b$ which is at least 2, locking $a=b=1$! Is that too clever to be correct...?

Q3. Wow, a combinatorial question hidden behind algebra. This is an interesting one and is probably the third question in a row I said that. The solution given in AoPS by mapping it on $\mathbb{N}^2$ to show boundedness hence periodicity is as elegant as you can get, and I managed to write down full solution the second I saw that. Anyone else?

Q4. Ohoho. A geometry Q1/4 means 7 less points for me.

Reading through the solutions I do have chance if I stare at the problem for 1 hour plus, but this is not going to happen right now. Complex bashing is still good up to this level of geometry questions...but what about harder ones?

Q5. I can't decide whether this is a combinatorial/game theory problem or just an algo problem, really. It lacks the taste of past questions where you find invariants/intrinsic structures that solves the problem. The question really is about finding a single, simple algorithm that works. It takes me longer to find prove lower bound than to find a solution.

It reminds me of SIMC which is also algo heavy but man this is IMO...

Q6. Functional equation is always amusing...and this time it returns stronger and harder. A family of functions based on an "OR" condition, and the question asks about a harsh character of the family. Definitely exceeds my ability to solve in a few hours, but this is something I am willing to try -- so no comment here I guess ;)

In overall I would say my solvable problems are very much to my taste and strength, but I would like to see a more balanced/classical setup. 

I asked for a NT Q6 but that did not happen in 2024 either -- even worse we are hit by a truckload of "easier" NT-algebra problems. I don't know what others might think but easier NT problems are usually disappointing than anything. Q5 is a huge upset, I entirely do not expect such question in IMO.

Oh well, we will see again in 2025.

Wednesday 7 August 2024

6/8/2024: Crossover

晚上十一點的機廳裡。

機廳坐落在熱鬧年輕的市中心裡,交通十分便利,到處都是餐飲店。只要到了下班時間--不,只要中午過後這裡便已經擠得水洩不通。可是只要到晚上十時半,所有人就像是約好了一樣陸續散去,留下空蕩蕩的大廳。明明這機廳一點才關門,為甚麼大家都急著走啊?那些在九點高峰期要排兩輪的玩意,現在不用排隊就能隨便玩。

背後的原因說起來也簡單,大家要趕著尾班車回家。可是反過來說的話,只要不用趕尾班車不是就不用趕著走了?

少年少女就是利用了這點,成功每個星期數個晚上霸著這台新進的DDR。載他們回家的不是鐵路而是巴士,尾班車在零時十五分,他們還有一小時時間。

連鎖機廳的氣魄就是不一樣,完全不用吝惜電費。DDR機台兩側和後方都有隔的的膠幕,但冷氣依然從機台後方灘進來。兩台工業用風扇、兩個籃子、放水瓶的支架、USB截取卡……你能想到的設施一應俱全,此刻只為兩人所用。

畫面上顯示只有P2那邊在玩,歌曲是新出來的蘿莉神。天知道Konmai是怎樣想的,為了一個看上去就像是抄中二機台的新音遊而掃入大量的VTB向歌曲版權。把這些歌同時發到現有音遊上對推廣新音遊不知算不算好事,但對老玩家來說有新歌肯定不是壞事。只是這些版權曲的版權到期時玩家會怎樣抱怨,那又是另一回事了。太多歌曲前車可鑑:蛋糕舞、獸娘……如果到時候一口氣下架二十首歌的話玩家會暴動嗎?

蘿莉神的譜面很有趣。激譜面是14,在14裡面偏難但沒有很離譜。鬼譜面反倒是更簡單的12等。看到這種反差組合的老玩家第一反應大概就是Konmai又在搞事了吧?smooooch・∀・的鬼譜面也是比激譜面低的10,但整首都在轉圈圈,打起來完全不像10。蘿莉神的鬼譜面上有shock arrow的標記,但大家都知道這個坑絕不會幾個SA就完事的。果然打開一看,這首說是12的譜面塞滿了各種大跳、突然的的加減速、交互打法……還有八分十二分縱連。對應的DP譜面看上去是比較像羽衣跳舞的步伐,但放在SP上只有一個字的感覺:難。用兩個字那叫詐稱,用三個字叫大詐稱。

可是為甚麼少年現正為了這樣一首12而苦戰呢?就算這首是難,那也是相對12而言而難。把等級改成13的話這首就算不上詐稱,更別提比鬼譜難得多,的確是14沒錯的激譜面了。12或者13等對少年來說連熱身都算不上,就算放上Flare V的限制也一樣。

除非……少女給少年下了某種額外限制。

不是把少年常用的Boost選項換成Brake或者把Note顏色換成Flat之類遊戲選項改動,也不是在少年身上貼上甚麼可顫動物件之類的可疑情趣。

少女坐在P1的邊上喝著剛剛按出來的烏龍茶:「你又不小心單腳硬抗了。」

少年喊冤:「我才沒有……啊啊啊啊!!!」畫面上彈出Stage Failed的字樣。剛剛少女一句過來,少年為了回想自己哪一腳踏錯了而忘記留意加速滑條後面接著SA,被「電」到後連miss幾個當然就直接掛掉了。

結算畫面下方顯示六顆星,加上這首一顆星就是七顆,但這首已經是3rd stage。本來少年這首也打過去的話就能達到一道裡面拿九顆星進extra stage的目標,現在又要從頭來過了。

沒錯,少女叫他乖乖練交互不要老是用單腳在那邊轉換了。

「我知道你連chromatic bust和Lightspeed都可以這樣硬過啦~可是你HyperTwist不就只能開random過了嗎?到時候你要打Paranoia Revolution怎麼辦?Over The Period呢?你現在刷13 Flare IX這麼痛苦不就是因為一碰到要交互的譜面就自亂陣腳了嗎?」這一通連珠砲發下來,少年只得照做。本來習慣了各種17連發的他只好回去從12和13打起。

12等的譜面不代表譜面沒有交互,只是沒有十六分的交互而已。相反譜面作者可能覺得八分音可以逐個打沒有交互的必要,這樣做出來的交互反而更多。或者這樣想:要堅持用交互的話不但可以在12等找到交互,在7和8找到交互也不奇怪。

比如→↓⠀↓←的微縱連。金框的跳板比起以前的跳板更為敏感,所以縱連在近年出的越來越多,比如び;也有在連打裡放縱連的,比如The World Ends Now。少年對這種微縱連最有印象的是那他打了很久才蒙過的Avengers。在前面的慢速段就很多這種2-2連。想要滿血進到最後的高速連打的話這些較簡單的部分就不容有失。要較真的話少年當然不會打不動微縱連,但他只想用最省力的方式打過去。右腳尖點右邊後腳跟點下,半拍後用右腳左腳理所當然。這種打法當然沒錯,但看上去第二個下用左腳打真的順很多。那為甚麼少年不這樣打呢?在他的認知裡左腳打下就代表右腳打上或右,因為左是交互,下是縱連。讓他左腳打下的話要不試圖也用左腳打第二個下然後因為發現要右腳打左而大腦當機,要不就直接卡住miss掉一串。蘿莉神的→↓⠀↓←沒有Avengers那麼兇險,但Flare V也不是吃素的。以少年的準度只要miss三四個大概就過不去了。

又比如從後方交互的處理。幾乎從不交互打的少年唯一會交互的情況是左腳打下然後右腳打左,就像Elemental Creation裡面那樣。可是Elemental Creation後面不也有右腳打下然後左腳打右的嗎?很抱歉,面對這個組合少年後選擇兩個都用右腳打。右腳本來就比左腳靈活,肌肉記憶固定下來的守備範圍就是右腳多一點。用右腳點兩個的例外是當你看到右腳在左邊時下一個箭頭卻在右邊,這樣少年便會用左腳點兩個然後用右腳打右箭頭。在交互的世界裡如果右腳已經在左邊,左腳還要到右邊的話他就要進一步向左扭,順勢把左腳逆時針帶到右箭頭那邊去。對少年來說這樣又有兩個問題。

第一是他重心偏後。就算怎樣扭動後方的空間必然有限,這樣卡住的機會並不小,但把重心挪前的話勢必要重構整個肌肉記憶。第二是你扭到左邊去,接下來如果一直有向左扭的箭頭呢?總不能像smooooch・∀・那樣放手轉過去吧?

「你好歹也是老玩家了,這種事就不能變通一下嗎?交互是希望盡可能讓兩隻腳輪流打,可是轉不過來的時候也沒辦法呢。如果硬要全交互的話一個譜面的打法從一開始已經固定了,但如果放棄一兩個交互可以打得更輕鬆的話為甚麼不這樣打呢?」少女這樣說道。

如何提早判定打法呢?少年不可能每次都看youtube先把How to Execute背下來再去打吧。少女答得輕鬆:靠經驗囉。

她又拿chromatic burst做例子:←↓⠀↓→←↑的連打,第二個下應該用左還是右腳呢?用右腳的話整個人向右扭,右腳打在後左腳打上,打完連打後依然扭了半個圈。同一個節奏用左腳的話後面四個音根本沒有交互的必要。可如果換成←↓⠀↓→←↓呢?全交互打法直接死掉,完全沒法轉過來。

如何選擇正確的打法,更重要是如何在扭錯方向時修正回來,這才是在實戰的關鍵。

「只有實戰才能把這些刻進你的肌肉裡面。等你可以三首Flare V打進Extra Stage再說吧!」

少年指著她道:「至少你要下場跟我一起打,不要再在那邊吹風扇了!」

少女拒絕:「不要,我要監督著你會不會打著打著回到老打法。」

「那下次我就要看著你能不能打過量子海和New Millennium了。每次都說自己要全清18可是自WORLD出來了以後你就只顧著刷分數都把這個目標拋到腦後了不是嗎?」

「哼哼,現在是精度的天下呢。要不這樣吧,我從15 EX開始打,我每過一首就換你練一道交互如何?」

「這根本不公平吧!!」

NEPHILIM DELTA、TRIP MACHINE EVOLUTION、ラキラキ……每一首平時打到滾瓜爛熟的老圖,此刻打起來又有著新的感受。

少年的在跳舞機上的苦難還在持續中,不過跟她一起在這沒啥人的機廳裡打的話這點苦難也不算甚麼。

頂多就把刷19的時程往後推一點吧。

***

下次DDR相關更新有空會寫Lv18超難關全剖析(?

是說Konmai快點把拍照功能還回來吧,我這樣不太好放成績上來orz