Wednesday, 20 August 2025

古早遊戲BGM巡遊(11): 夏のspecial

八月已經過一半多一點了。雖然按農曆來看大暑已經過去,但用暑假來看現在才差不多要進入高潮的部分。比如說,永無止境的八月就是17日開始的。不知道還有多少人記得這個梗呢?

如果要問我印象最深刻的「夏」歌,近十年的話我一定會回答君の知らない物語

「あれがデネブ、アルタイルベガ
君は指さす夏の大三角
覚えて空を見る--

やっと見つけた織姫様
だけどどこだろう彦星様
これじゃひとりぼっち--

每次這段都聽得鳥肌直豎要哭出來,不是有這種衝動而是淚不知不覺就滾下來了。夏季大三角和牛郎織女都是洋溢夏日氣息的元素,簡單幾句不但押韻又富含深意:我望向妳指給我看的夜空,看得見織女卻找不到牛郎。這樣織女不會孤獨嗎?那麼、妳又在哪裡呢?

……

咳咳。跑題了。君の知らない物語再好聽也總不會是遊戲BGM吧?

夏日、古早經典、遊戲BGM。

我想不少讀者已經猜出來了,那就是夏祭り。

原曲來自JITTERIN’JINN(1990),當時就斬下不錯的成績(oricon週間三位、全年80)。沒想到十年後的Whiteberry版本更進一步,不但全年排34,更讓她們登上紅白大舞台。對我來說接觸這首歌的契機當然不是當年的J-POP,而是太鼓收錄的版本。從二代開始每代都有收錄,是太鼓存續率最高、最經典的曲目之一。

夏祭り成為太鼓的招牌可說是渾然天成。太鼓本來就帶有熱鬧和祭典屬性,跟夏祭り完美重合。現實中的夏祭會有太鼓表演,那遊戲裡的太鼓也放上這一首也是天作之合。

你還記得那個太鼓的鬼譜嗎?那些沒有變化的ddd和kkk三連音,簡單的節奏不但切題,也是很好的登龍門。對我來說大部分音遊「上級者」門檻的概念都差不多,就是對十六分連打的應付能力。DDR的話是MAX300,太鼓的話鬼6星的夏祭り作為上級者的分界或許過易,作為引導成為上級者的前置卻非常合適。夏祭り的BPM142不算快也不算慢,拿來適應連打剛好。這首的物量也不少,能穩定地把那堆三連連打全部打過的話相信難一點、天國與地獄之流也不會構成任何障礙。我想,這也是為甚麼太鼓玩家普遍對夏祭り記憶如此深刻吧?

其實我一直都不知道太鼓版本的夏祭就是Whiteberry唱的,以為是南夢宮自己找人唱,現在比較熟番音遊公司運作以後才知道這根本不太可能。Whiteberry版的夏祭り的確比原版更青春熱情,在基本的樂團樂器以上還加上了太鼓等祭典元素,放進遊戲裡再適合不過。不過原來後來太鼓也把原版給收了進去,還做了個十星的裡鬼譜。譜面好不好看人,至少原版在遊戲裡聽起來也不錯,不知道是不是因為被後加了太鼓音效的緣故就是。

夏祭り作為「夏」歌經典最難得的是跨界而且持續的影響力。作為流行曲在1990和2000年分別火紅過一次,太鼓是在2001收錄,但太鼓作為遊戲冒起是2005出新機台和2003-2008分別在PS2/PSP/NDS出遊戲以後的事。到了2020年代夏祭り在太鼓那快要氾濫的歌單中或許沒那麼顯眼了,但這不代表歌曲的影響力消失掉--夏祭り作為野球應援曲就從來沒有停止過。

夏祭り和狙いうち都是常見的甲子園應援曲。比如佐賀商版的狙いうち和濟美的夏祭り都不錯。說起來習志野和大阪桐蔭的版本也不錯,可惜這兩家今年都沒進去正賽。不過沒關係,橫濱的也不錯?在高校野球以外在NPB同樣能發現夏祭り的身影,比如養樂多的チャンステーマ1。給球員應援到一半也有機會變奏成夏祭り,比如這個給山田哲人和巴冷天打氣的

所以說,夏祭り在1990、2000、2010甚至2020四個世紀的年輕人心裡都留下了印記。就算在今時今日,網絡世界上的大家也都還記得這一首夏季定番。從天月、96貓等nico歌手唱的版本那超強的播放量就能知一二。我私心也推Gero的版本就是。

夏祭り和君の知らない物語這對比起來其實很有趣。兩首都是夏日夜上的青春物語。一首是熱血外放的祭典、一首是寧靜夜空的思憶。既然兩者並無衝突,串起成一個短篇故事應該也不錯吧?感覺會是非常棒的東京夢華錄題材,不過最近有點忙,這件事就交給GPT好了。

不知道再過十年、二十年,下個世代的人還會不會接觸到君の知らない物語那優美的歌詞。不過夏祭り的話,我想還能在機廳、球場上流傳很久吧。

我倒是希望大家兩首都能記住就是。畢竟歌曲就像牛郎織女那般,你找不找他們都在那裡。可是找不著的話,大概總會有點空虛寂寞。妳說是吧?

Wednesday, 13 August 2025

Trig function higher order estimates: the limit of squeezing

Let us recall the classic result. What is the limit of $\frac{\sin x}{x}$ at $x=0$?

Without using calculus, we usually prove that by squeezing with the following geometric argument.
The area of triangle $CAB$ is $\frac{1}{2}\sin x$.
The area of sector $CAB$ is $\frac{x}{2}$.
The area of triangle $EAB$ is $\frac{1}{2}\tan x$.

Thus we have the inequality $\sin x \leq x \leq \tan x$ in an neighborhood around $x = 0$.
Rearranging gives $1\leq \frac{x}{\sin x} \leq \sec x$, but since $\sec x \to 1$ as $x\to 0$, squeezing gives $\lim _{x\to 0} \frac{x}{\sin x} = 1$.

That is essentially saying that the first order term of $\sin x$ is $1$ (while the constant term is zero).

Now the question is, how can we calculate higher order terms again without calculus?

For example, what is $\lim _{x\to 0} \frac{1-\cos x}{x^2}$?

With the abundance of trig identities, there are quite a number of possible approaches. Let us start with a pure algebraic one.

For the lower bound, note that
$1-\cos x \geq \frac{1}{2}(1-\cos ^2 x) = \frac{1}{2} \sin ^2 x$, so
$\frac{1-\cos x}{x^2} \geq \frac{1}{2} \frac{\sin ^2 x}{x^2} \to \frac{1}{2}$.

For the upper bound, we use that $\cos x \geq \sqrt{1-x^2}$ that
$\frac{1-\cos x}{x^2} \leq \frac{1 - \sqrt{1-x^2}}{x^2} \leq \frac{1}{1+\sqrt{1-x^2}} \to \frac{1}{2}$, so squeezing gives the answer.

But wait! Isn't it such a pity if we are dealing with a limit with actual geometric interpretation? After all, $1-\cos x$ is the length of segment $BD$. In that case, allow me to present my 'geometric' approach:

We start with the $\sin \frac{x}{2} \leq \frac{x}{2} \leq \tan \frac{x}{2}$, squaring gives $\sin ^2 \frac{x}{2} \leq \frac{x^2}{4} \leq \tan ^2 \frac{x}{2}$.

We use the identity $\sin ^2 \frac{x}{2} = \frac{1}{2} (1-\cos x)$ and $\tan ^2 \frac{x}{2} = \frac{1-\cos x}{\sin x}$, then the above becomes
$\frac{1-\cos x}{2} \leq \frac{x^2}{4} \leq \frac{(1-\cos x)^2}{\sin ^2 x}$
$2 \leq \frac{x^2}{1-\cos x} \leq \frac{4(1-\cos x)}{\sin ^2 x} = \frac{4}{1+\cos x}$.
Squeezing gives the same answer.

*

The next step is then to find the third order estimates. Or, when instincts kicks in, you would hope that this is what you need to generalize the whole thing. However, the deeper you look into the problem the bigger trouble you would find.

The use of quadratic related identities would fail instantly because you know it only give factors of (powers of) 2, which is not good if we are at higher orders. They are simply not good enough to prove the estimate of the next order. (But how did we managed to prove the second order estimate of $\cos x$? My rough guess is that the second order estimate of $\cos x$ is equivalent in some sense to the first order estimate of $\sin x$ although I am not so sure.)

For the other approach, you would wish that you can start with the formula $\sin ^n \frac{x}{n} \leq n^{-n}x^n \leq \tan ^n \frac{x}{n}$ and apply the multiple angle formula. I can see that being a possibility, albeit a very slim one.

The multiple angle formula can be written as $\sin x = T_n(\sin \frac{x}{n})$ where $T_n$ is the Chebyshev polynomial of the n-th order. The surprising thing is, equations in form of $T_n(x) + q = 0$ is solvable in radicals (!!!). That says, you can explicitly express $\sin \frac{x}{n}$ in a nested radicals in $\sin x$ solely and the estimation may proceed. Are you surprised that the name of Galois appears consecutively in my math entries by the way?

For $n = 3$, the triple angle formula induced equation $4x^3 - 3x + q = 0$ has the real solution $x = \frac{1}{2}(r + r^{-1})$ where $r = \sqrt[3]{\sqrt{q^2-1}-q}$. For our purpose we know $q = \sin x$ so that it even simplifies to $r = \sqrt[3]{i\cos x - \sin x}$. The root is real since $q \leq 1$, and we can simplify that to a single real expression in terms of $\sin x$ (left as exercise). BUT, how do we actually retrieve the term $x-\sin x$ from there? This is another big problem...

*

That does not mean we are hopeless against such limit though. 

The term $x- \sin x$ is still geometrically natural on the circle chart as the difference between length of arc $CB$ and the length of segment $CD$. Set midpoint of segment and arc $BC$ as $F$ and $G$ respectively. The arc length can then be bounded using the length $CB$ and $FG$ (note that $CB$ alone is not enough for the third order estimate!). Such approach works for third order estimates, but not any further when we can't find corresponding interpretation for higher order estimates on the chart.

Instead of trying hard with the trig circle, we just reside to the use the limit toolbox...as long as we know the limit exists, but that's easy right?

The existence can be done by continuity and MCT as long as it is bounded. First order bound gives $x-\sin x \leq \tan x - \sin x = \sin x (\sec x -1)$. Notice that $\lim _{x\to 0}\frac{\sec x - 1}{x^2} = \frac{1}{2}$ (why?), we conclude that $x-\sin x \leq (\frac{1}{2}+\varepsilon) x^3$ in a neighbourhood of $x = 0$. 

With the existence of limit being shown, we have all the tricks in our sleeves. Here are two neat solutions I like. Set $L = \lim _{x\to 0} \frac{x-\sin x}{x^3}$.

Solution 1. 
By triple angle formula:
$x-\sin x = x - 3\sin \frac{x}{3} + 4\sin ^3 \frac{x}{3}$
$= \frac{1}{9}(\frac{(x/3) - \sin (x/3)}{(x/3)^3}) + \frac{4}{27} \left ( \frac{\sin (x/3)}{x/3} \right )^3$
$\to \frac{1}{9}L + \frac{4}{27}$

which gives us $L = \frac{1}{6}$.

Solution 2. 
Note that $L$ is also the limit of $\frac{2x - \sin 2x}{8x^3}$, a linear combination of limits shows that
$4L - L = 3L = \lim_{x\to 0}\frac{x - (1/2)\sin 2x - x + \sin x}{x^3} = \lim_{x\to 0}\frac{2\sin x - \sin 2x}{2x^3}$.

Now $\frac{2\sin x - \sin 2x}{2x^3} = \frac{\sin x}{x} \cdot \frac{1-\cos x}{x^2} \to \frac{1}{2}$, hence $L = \frac{1}{6}$.

It turns out that squeezing is trying to prove existence and value in one go which makes things strictly harder, the need of monotonic estimates is really hard to deal with as well. In the above approach, we only need $x - \sin x = \Theta (x^3)$, in contrast to the bound of $\frac{1}{6}x^3 + O(x^4)$ for squeezing. It is also note worthy that n-th order estimate always gives a (n+2)-th order bound (i.e. generalization is possible) because if the n-th coefficient matches, we can argue the (n+1)-th order coefficient is zero by odd parity.

We may need to admit that squeezing theorem has its limit(!) after all.

***

Here is a bonus bound as suggested by Grok4 when I tested its capabilities, and it claimed that this is an 'elementary approach'. I asked it to prove $x - \sin x \leq \frac{1}{2}x^3$ and it returns as below:

Note Euler's infinite product $\sin x = x \prod (1 - \frac{x^2}{n^2 \pi ^2})$. Manipulating the formula gives
$\sin x = x \cdot \prod (1 - \frac{x^2}{n^2 \pi ^2}) \geq x(1 - \sum \frac{x^2}{n^2\pi ^2}) = x - \zeta(2) \frac{x^3}{\pi ^2}$,
and the claim follows since $\zeta (2) = \frac{\pi ^2}{6}$.

Beautiful? Yes. Elementary? Ummm...what's the difference between using infinite product and using Taylor series?

That isn't even the funniest part. In reality it failed to retrieve the tight constant $\frac{1}{6}$. Instead it uses the estimation $\sum \frac{1}{n^2} \leq 1 + \sum \frac{1}{n(n+1)} \leq 2$, so $\sin x \geq x - \frac{2}{\pi ^2}\cdot x^3$, where $\frac{2}{\pi ^2}\approx 0.2026$.

I asked is it possible to prove the inequality with the tight constant $\frac{1}{6}$ by elementary means then? It searched and thought seriously for a while, then it said no.