## Friday 8 December 2017

### Some recent maths activity

Yesterday I received the question from my engineering friend:

Let $f$ be a real function so that for all $x,y\in \mathbb{R}$, $f(x+y) = f(x)+f(y)+xy(x+y)$ and $\lim _{x \to 0} f(x)/x = 1$ hold. Find $f$.

It does not like a casual question to ordinary university students, not even for maths students...but anyway one may notice that $xy(x+y) = (x+y)^3 - x^3 - y^3$ if you know symmetric polynomials well, and the free linear term makes up the limit we have $f(x) = x^3/3 + x$.

Well, it is easy to show that the function is continuous by exploiting the equality $f(2x) = 2f(x) + 2x^3$, but even stronger we can prove differentiability. Rearranging gives

$\frac{f(x+y)-f(y)}{x} = \frac{f(x) + xy(x+y)}{x}$

Taking limit $x\to 0$ yields $f'(y) = 1 + y^2$ - not only that the derivative exists, we also get a complete DE with an initial value $f(0) = 0$. That easily solves to $f(x) = x^3/3 + x$.

What if the limit condition is changed? Say, $\lim _{x\to 1} f(x)/(x-1) = 1$? We can rewrite the expression as the following:

$f(x+y-1) = f(x-1)+f(y)+(x-1)y(x+y-1)$

Dividing both sides by $(x-1)$ reduces the question to the original case which gives the same solution.

Let is consider the functional equation at a much generalized form: $f(x+y) = f(x)+f(y)+g(x,y)$. According to the above argument if we managed to show that
$\lim _{x\to 0} (f(x)+g(x,y))/x$ exists then we can easily reduce it back to a DE where existance or uniqueness is clear. However this is hard to work around if we do not assume the limit condition because we know pretty much nothing about $f$. It does not work by assuming continuity of $f$ or $g$, since we may come across to some very nasty functions like the Weierstrass function which makes no sense in these questions. We leave a few observations here without solving it (or even getting close):

1. $g$ must by symmetric. This is obvious by observing the rest of the term. In particular, if $g$ is a polynomial then it is in the ring generated by $\sigma _1 = x+y$ and $\sigma _2 = xy$.

2. If $g(x,y) = O(xy)$ for small $x,y$ then it is possible to recover $\lim _{x\to 0}f(x)/x = 1$ using estimates like $f(x) = 2^n f(2^{-n}x) + O(x^2)$ or $f(x) = nf(x/n) + \log n O(x^2)$.

3. If $g$ is Lipschitz we know immediately that it's differentiable a.e. but that says we could have uncountably many non-differentiable points that we not want to deal with...

But that's it. I do not want to spend more than 60 minutes on this useless (for me) problem :d

------------

The 1st Simon-Marais (aka the Pacific Putnam) was held on October 2017 and the statistics are finally out (compare the efficiency against IMO marking team...). It's very surprising that only 1~2% of the students got problem A4 (and A3). I expected the top rankers to be close to 42 (aka 6 correct answers) but it turned out that not many olympiad players participated the event as can be judged from the award list. I expected the event to be much harder next year.

## Thursday 27 April 2017

### 夢．十夜 (1) The beginning

「叮」一聲，電梯緩緩在四樓打開了門。穿過左邊的文青型樓上書店和右邊的波鞋店，眼前是一條連接著兩梗大廈的橋樑。說是橋也不過是三四米左右的距離而已。兩邊用鐵絲網圍住大概就是防止有人在這裡跳下去吧。站在橋的中間向下望依稀可以看見幾座老舊的唐樓之間剛好空出了一小塊空地，上面排滿了一個個被清理完不久的垃圾筒，飄上來的一絲垃圾味被濃重的油煙味蓋過－－魚蛋燒賣、煎釀三寶……還有新有的炸雞？不過我的思緒卻沒有和這些氣味糾纏太久，一個有趣的問題在我腦中閃過：在寸金買不到尺土的這片地方，空出這樣「被遺忘的一畝」是一件很奢侈的事情。到底以前是發生了甚麼事讓大廈圍繞這裡建成？這一格土地又屬於何人、以後又會怎樣－－嘛，在這條街衰落之前大概不可能被重建吧。

## Tuesday 11 April 2017

### 11-04-2017

The 10-point rating system

According to the announcement, Pixiv removed the 10 point rating system and instead put a "Like" button up there. The reason is that "95% of the evaluation function are currently evaluated at 10 points. Also, some problems rose due to the negative usage of the evaluation function".

Well the reason is not very surprising especially to those Osu! players. The average rating rises with time due to multiple reasons (the actual improvement in quality, fan-based community, points became popularity contests etc) and it's occasionally abused like spammed by 1-pointers (this is less common in pixiv because we don't have a in-built critic circle there, but for Osu! this is really obvious).

Two questions arose: should we modify the 10-point rating system to avoid those problems? Is the "Like" button serves as a better indicator than the rating system?

One important observation is that there's almost zero qualification required for someone to vote in both system. You just need to be a member (and played once, for Osu!) then you can rate the map/picture. That makes the source of voters very suspicious and very vulnerable against manipulation. Whether those manipulated accounts are alts or "followers" from the same community are not important -- it's out of the control of the system itself. The system can do nothing but to serve as what the sources wanted. In Pixiv, people spam 10-points for drawings they like/appreciate and that becomes a popularity contest, so why not? A "Like" system is better as for a popularity contest.

As for Osu! the in-build communication platform allows us to manually adhere some metric on the rating system - one may provide a guideline on giving rating and perhaps some suggested examples. Assuming that players (or at least the officials) reached an agreement on the ratings and players are willing to rate according to the guidelines, it is possible to introduce weighting on how valuable a vote is from a player. Players are still free to rate by their free will but votes that are overwhemingly random will receive a relatively lower weight. Ratings may also be scaled by approximating players' voting curve and make it close to the supposed guideline.

It is not possible to eliminate popularity contest because (1) first of all popularity-ish rating would still be the dominating voters after all (2) the minimal weight can't really be too low because at the end of the still this is "players' rating" not "players' rating on quality" - popularity remains as a non-negligible factor, but what we did is to reduce the power of pure haters/lovers and that gives a more representative overall rating.

A last note: although "my favourite" function exists in both Pixiv and Osu!, I would still prefer the "Like" button for Pixiv and the rating system to Osu! because Osu! system provide possibility of improving the rating system and we really have so many metric that has high correlation to pure popularity - instantaneous and long term play count etc that we don't really need another useless button to show that explicitly.

3D Touhou

Blender these days are powerful to simulate these nasty bullet hell screens and this is one of my favourite. But my question comes from the perspective of the characters themselves.

It's extremely interesting to see how the authors blend a 2-dimensional spell card into a 3-dimensional space so that the bullets (at least apparently) fill the space. But what if we really want to fill the space and wipe those characters off the screen? What kind of spellcards should we use?

- For spherical bombs you would like to pack the space so that no escape route exists. That's essentially the sphere packing problem...that clearly gets harder at higher dimensions.

- If you want to shoot radial danmaku that floods the character without allowing it to move towards you, the thing you will need is to increase the bullet density on the manifold as the tangent plane of the character per Hausdorff measure in the space (?!?) -- in simple terms, it grows in the volume of (n-1)-sphere for Euclidean spaces, which is not looking good either.

- Laser type weapons. Using spherical coordinates it is also clear that aiming with the correct angles in all those angle-based coordinates has exponential difficulty as well.

The best weapon might be Sakuya's ability of freezing time because time as an extra dimension is independent of the space dimension so it works equally well despite the change in space...but well I am not a resident of Gensokyo so I'd better leave the problem to them...

## Tuesday 4 April 2017

### Two game mechanics

Great game follows from small details and smart mechanics.

As always, game mechanics are great source of giving interesting mathematical questions. Here are another two short examples on games that I've been following.

Fire Emblem Heroes

As a hardcore Nintendo fans this is probably a must, especially when the game is now full of GBA-era characters replenished. Without much money and effort I managed to score 4200~4400 per week in the arena, but this is not what I want to talk today. It is the summoning mechanism that caught my eye --- to be honest the summoning mechanism is quite special as a Japanese game because that can be treated as an attempt to adopt western consumption behavior on gaming, rather than the eastern elitism style, but such qualitative topic does not fit this entry as well.

Let's talk about simple probability. This is the (simplified version of) FEH's summoning mechanism:

- You spend 20 orbs to summon 5 heroes/cards (a complete summoning).
- By default, there will be a 6% chance of getting a 5-star (5*) hero.
- If you get no 5* heroes after a complete summoning, the chance for 5* is raised by 0.5%.
- The chance restores to 6% if a 5* hero is summoned.
- The chance only change after a complete summoning.
- Assume everything else to be independent.

Now the interesting special rule: if you get no 5* in 24 complete summonings, you will automatically get 5 5* heroes in the 25th summoning (i.e. the chance become 100% rather than 18%). The question is, why 24? A simple calculation reveals the truth:

Chance of getting 5 5*s under default chance = 0.06^5 = 0.0000007776 = 7.77*10^-7
Chance of getting 5 5*s via the special way = product (i=0..23) (1-(6+i/2)/100)^5 = 2.79*10^-7

That says, both ways getting 5 5*s in a single summoning process are of equal magnitude in terms of probability! It is quite clear that the chance varies exponentially if we change 24 to something else, so that is quite a slick design that gives mathematician a smile on his face.

A round robin league

I am recently sticking to another Japanese baseball android game, in which has an event where each team is assigned into a group of 5 every day. At the end of the day the rank is calculated and points are given to the team accordingly. At the end of the event (10 days, i.e. 10 rounds) the overall team rank is decided by the total points.

That reminds me of the guild battles from Fantasica -- the old good days where a team of 9 players around the world commit in 35 real time battles, each lasting 1 hr in 7 days that takes numerous hours of preparation work and probably thousands of cash -- that has a very similar system. Each round you fight with another guild and the total victory count determines your rank. The common feature between the two is that, your next opponent depends on your current standing and will not be someone that you have fought before.

Depending on your goals, it has been practically shown that in Fantasica there is a range of standing (typically the mid-high range) that can be achieved by lying dead in the first few battles despite random-ish weak opponents, because you can meet fewer top teams (hence less guaranteed defeat) by doing so.

The core principle in guild battle events -- rise fast, sink slow. You quick edge towards the top by defeating consecutive weak opponents then get crushed by top opponents, but your rank drop slowly because everyone of the same tier is taking defeats at the same time as well.

The question here is, does it work for such system where you are assigned into groups of 5 instead of 2? It is foreseeable that if you always group all top teams together you will be running out of top teams very quickly. Another question is if we alter the matching algorithm will it be cheat-free? At the end of the day, we want to distinguish those heavy spenders (top 5-10), light spenders (top tier) and heavy free players (mid-top) while minimal players are not too important to game revenue. With 35 turns, Fanta somehow (but not quite) managed to put mid-top players to where they should have been, but the sinking phase is still a bit too short.

Here the dev solved this problem by matching 5 teams, each with some distance on the rank but not too far away, ranging from top teams to mid table teams. Each round can be deemed as battling with 4 other teams at the same time: finishing second in the day implies you won against the 3 lower teams and lost against the top team. By such the converging can be done even quicker than the Fanta system. It's also cheat-free in the sense that you are battling with teams of the same tier every round that you don't have much space to lose.

But that's only my prediction -- no one knows how the system exactly works and I doubt if this is systematically studied in this game given its competitiveness, but I look forward very much to those post-event statistics.

*

3 April, 2017

## Thursday 9 March 2017

### 09-03-2017

6/3/2007 - 6/3/2017

Ogame (2008-2009)

Osu! (2008-)

Fantasica (2012-2015)

Quiz．「黑貓」．RPG (2013-2017)

(EDIT: 無生還啊無生還，讓我們一勝也不行？)

*

Forretrio / Chris
9th Mar, 2017

## Tuesday 21 February 2017

### DDR, the 3rd year

3 years since I start played Dance Dance Revolution (DDR). A short summary on my progress over the last year. Well to be honest I only played 3 months out of 12 last year, since they replaced the ITG machine by the stupid PIU machine.

ITG: Here I started to train those 'crazy foots' - I got 86% with 2 misses on MAX300 ("the gate towards the inner DDR world") that has not been replicated in DDR. Below is my best record:

But those custom maps opened a whole new world to me. There aren't lots of BPM 120~140 1/4 equivalent streams in DDR (BPM 240~280 is too fast and 120~140 is quite slow in general) except for some old maps (you don't expect highly electric songs with pace falling in that range) like Paranoia Survivor, but you can find loads of them in ITG. One of my favourite is Hatsura Yuki's ~Confession~, but sadly I failed to find the corresponding difficulty (SP challenge) in Stepmania :( These songs provide excellent training and eventually allow me to play MAX300 fluently. ITG also include diffs with high number of notes while retaining a relatively low density, and that is a nice training for stamina. (Maps like kokoro contains up to 750 notes which is around 17~18 while the real difficulty is around 14+ or 15-).

In 2 months I managed to go through consecutive Lv. 11 (old extended scale) maps - difficulty of these maps varies greatly but they gave me a good foundation on getting through those real DDR songs.

DDR: I spent 1.5 weeks out of 4 weeks to familiarize DDR again, wasting time on easier maps like 12-13-14 or 11-13-15 on a single credit. These are not my limit so I does not gain a lot except limited accuracy due to repeated gaming. But then I decided to start training myself to adapt higher speed - both real speed and apparent speed ("SV"). Plan 8, NEPHILIM DELTA and 放課後ストライド are three excellent songs (14)  for BPM 220+ range -- with consecutive long streams and huge number of notes you eventually pick up the stamina you need for higher difficulty. Another focus before you can confidently step into Lv.15 is the ability to switch between footing 1/2 and 1/4. Here ちくわパフェだよ☆CKP and POSSESSION are two great trainers in 14.

(Well, I had a lucky 1 miss play last year, but that couldn't be consistent...)

Last year I was able to play a few 15 but I will get exhausted after any single attempt, but now I can step into 15 and confidently play most of the songs - except for weird SV changes that requires extra reciting. Pluto series is always hard to do in that sense -- Pluto relinquish (14) and Pluto the First (14) are still hard for me (my record is still B).

14 to 15 is hard because 15 marks the beginning of the inner DDR world, but 15 to 16 is not as hard as that. Before I started to attempt some easier 16s, one of first two 16 passes was from one that I thought to be quite hard among the 16 songs - VANESSA:

The 1/3 stream is extremely nasty, but once you get used with long stream at that speed it becomes more like a routine. Though I haven't tried it for the second time I am quite confident that I can easily get better result.

I got some other high 15s and mid 16s as well...but passing those technical maps are more satisfying --- Spanish Snow Dance (15) that is supposed to be mid 16, and 灼熱Beach Side Bunny (15) with lots of exhausting jumps.

Talking about jumps that is still my weakest link and hardest bit to improve. I passed 隅田川夏恋歌 (16) (another one out of two first 16s that I passed) but I got the "kiai" part by hammering double arrow every note instead the supposedly every other note. The fact that I can't switch between single and double foot fluently hinder my performance on maps heavily seasoned with such features: 轟け！恋のビーンボール！！ (a B+ pass) and 嘆きの樹:

Improving accuracy on double jumps takes a damn lot of practices, so I turned into those harder maps that I can achieve relatively easier -- 恋する☆宇宙戦争っ!! (17) and ドーパミン (17) -- in Taiwan I have fresh machine that allows an almost 10% accuracy boost on songs in the 12-14 range, so I made use of the chance to try those hardcore maps, and turned out with some successes:

In order to get through this diff I played two BPM200 songs before trying this in the final stage...and the plan worked out properly. I passed on the first time without the 4 miss extra stage limitation. Same goes for Dopamine :3

So that's my third year on DDR. Perhaps I can get a light taste of 18 next year?

Statistics, 2016:
18 days in DDR, 129 credits
Ability to pass maps: 14 ~ 15- → 15+ ~ 17-
Ability to AA maps: 11 ~ 13- → 14 ~ 15- (under the new grading scale)
Lv. 15: 23Pass / 2AA
LV. 16: 11Pass
Lv. 17: 2 Pass

## Tuesday 31 January 2017

### After Dark 4.0 in Windows 7/10

Nostalgia...

Rodger Dodger and Rock Paper Scissor are two main reasons that I keep bringing this antique back to the modern world. Every single time when I adopt a new OS the first mission would be fitting my Chinese input method into the system, and the second mission is to introduce AD4.0 into the machine.

Obviously this is hard because of a few reasons:

1) This is super old. Probably one of the oldest software that people still liked to use in 2017.
2) This is partially for 16-bit system and has limited support for 32-bit system, but machine these days are mainly 64-bit (my Chinese input software failed because of the same reason).
3) The developer decided to integrate the setting page in some very weird position which is then removed in the subsequent Windows version, particularly during the introduction of the Metro UI in 8/10 (and that applies to my Chinese input software...)
4) The installation is flawed - some registry change are missed.
5) This is not the usual kind of screensaver (and again, super old), so you can hardly find support on the Internet except for some people asking the same question every single version of the Windows OS: does AD4.0 fit into Windows xxx?

Anyway I made this entry as to share my way of getting it worked in Windows 7 and 10. Somehow I gave up on doing this on Windows 8 (I only used that computer for a very short time), but the 10-method should work for 8 as well.

Windows 7:

This forum post gave a complete guide on fixing this. It worked for me and should work for every one.

In Windows 7 you have no access to the AD setting page (which was in the monitor page) and you will see "unable to select module..." as the screensaver name. These are minor things (settings can be change directly in the registry and no one cares about the name) but you can fix it following the instructions here.

Windows 10:

(Updated 2/2/17)

EDIT: Somehow I need to perform a recovery on the system hence giving me a second chance to install AD4. Here is a simple solution to get it solved:

- Install AD4 as usual.
- Bring "After Dark.scr" into C:\Windows\System32
- Settings can be done via the registry package from this YouTube video.

Now everything should work the same as what you get in Windows7. The same problem remains -- the 'unable to select module' name and limited access to the settings. Since more registry entries are missed you really have to rely on the package from that video.

But for those AD lovers, I hope the above manual helps you to retrieve what your beloved screensaver that you first met 20 years ago :D

Windows 11:

(Updated 20/11/22) Works the same as in Windows 10!!!!!