## Thursday 25 July 2019

### MSN minesweeper revisited (in 2019)

I have expressed numerous time my love on the MSN minesweeper...and now it is back online. It is a pity the mienfield was down without any support...but hopefully this is going to last longer.

So here this is a question related to the grid efficiency in MSN minesweeper.

$\begin{matrix} \square & \square & B_1 & B_2 & B_3 & \square & \square\\ \cdots & 1 & 1 & 1 & 1 & 1 & \cdots \\ \cdots & 0 & 0 & 0 & 0 & 0 & \cdots \end{matrix}$

Suppose that you have a line of 1s along a long enough edge (basically you do not get any information from the two endpoints of the edge), then at any of the 1s, the chance of a mine appearing on a random grid should be 1/3...or is it?

Assume that the universal distribution is uniform. I.e. that is an equal chance of getting any of the $C^n_r$ many combinations (ignoring the corner rule since it is less relevant). Similarly without further hints, if we have n remaining unrevealed grids and r remaining mines, then the number of possible combinations is again $C^n_r$.

Out of the formula there is one single variable that varies with actual config - the number of remaining mines depends on the length of the edge modulo 3. Let $r_i$ be the remaining mines count after revealing the row given the configuration $B_i$. Then

$P(B_i) = \frac{C^n_{r_i}}{\sum C^n _{r_k}}$

If the number of mines to be revealed is independent of the configuration then we can conclude that the chance are equal. Otherwise we can compare the binomial terms:

$C^n_{r+1} = C^n_r \frac{n-r-1}{r+1}$

The usual ratio between grids and mines is 5:1 -- but that varies greatly depending on the given situation. In particular there are loads of 1s and 0s in our example, which boosts the ratio greatly. At the ratio of 2:1 the increase of mines would not increase the likelihood of the evisceration, but of course such ratio is unrealistic in a minesweeper setup, so we can say that the configuration that the configuration that leads to less mines on the row, is more likely.

One may raise the question: shouldn't the equilibrium happens at 3:1 instead of 2:1, from a likelihood perspective? We can visualize the likelihood approach by the following problem.

In a box there are $n$ balls, in which $r\approx n/x$ are white, and the rest are black. (i.e., the ratio between balls and white balls is $x:1$). Suppose we draw $\alpha$ balls out of it and we want to compare the chance of having $\beta \approx \alpha /3$ or $\beta +1$ white balls in the draw. If we want the chance between the two events to be comparable:

$\frac{C^{n-\alpha}_{r-\beta}C^{\alpha}_{\beta}}{C^{n-\alpha}_{r-\beta-1}C^{\alpha}_{\beta +1}} = \frac{(n-\alpha-(r-\beta))(\beta +1)}{(r-\beta)(\alpha -\beta-1)} \approx \frac{1}{2} \frac{n-\alpha - (r-\beta)}{r-\beta} = 1$

That gives $n-\alpha \approx 3(r-\beta)$, or $n \approx 3r$.

In our problem however, the term $C^{\alpha}_{\beta}$ does not exist, because we do not take the full combination within the balls drawn. In other words, we do not allow orders like

BBBWWWWWW
BBWWBWWWW
BWWWWWWBB...

The three only allowed scenarios are

BWWBWWBWW
WBWWBWWBW
WWBWWBWWB

Once we fixed that in our formula, similar calculations yield $n\approx 2r$, instead of $3r$.

*

Of course there is no such 'infinite edge' in minesweeper. The endpoints is definitely giving extra information unless it looks like the following:

$\begin{matrix} \square & \square & \square & \square & \square & \square & \square & \square & \square\\ \square & 1 & 1 & 1 & \cdots & 1 & 1 & 1 & \square\\ \square & 1 & 0 & 0 & \cdots & 0 & 0 & 1 & \square\\ \square & 1 & 0 & 0 & \cdots & 0 & 0 & 1 & \square\\ \square & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \vdots & \square \end{matrix}$

Any extra information would impose extra difficulty on these kind of analyses, but I am here to give some primary idea on what's happening.

To give an application, consider the following example. I said on my twitter that red made a bad move:

The reason behind is simple. There is only [something between 1/4 and 1/2] chance that the grid contains a mine. On the other hand if it does not the opponent gets a free flag immediately with everything else remains the same.

But...is it possible to calculate the exact chance? Yes, and this is not hard at all: this is a 16x16 board with 51 mines. The shown area is the only revealed portion. To calculate the probability we list the few only scenarios then the chance follows by the binomial coefficients.

## Tuesday 23 July 2019

### Fire Emblem: Three Houses and Rokkr Sieges

Back to something casual...Fire Emblem. Surely quite a lot happened since last time I wrote about FE and now it is a good time to talk about that again, since Three Houses is coming soon.

Well what should I expect? Unfortunately it's very hard for me to make a fair comment because I have not played the main franchise since the GBA era, a time where skills did not exist and information was sacrce because you didn't know Japanese back in the days...But FEH players should beware of the vast difference between playing FEH and the main franchise.

In FEH the key word is competitiveness. We keep facing stronger and stronger metas and we need to use the same team to work around it (unless you spend heavily). When you use more or less the same team against the opponent, what brings you victories is either the tiny bit of stat difference, or a well-desgined tactic which after all tricks the AI.

In the main franchise it is a totally different story. You are not really fighting in the fair setup -- instead of a 4v4 battle you are doing a 15v50 battle in a well designed stage where you are expected to solve the puzzle bit by bit. Restrictions are kind of loosened but you often ended up putting soft restirctions on yourself: units can be "killed" without failing the stage, but you want to unlock all stories. Time limit is less of a problem but you want to get all secret items and recruit hidden characters...the flexibility is much higher but the difficulty can be no less than what we have met in FEH. The most important bit is, you need to know how to work with a complete army, instread of your precious 4 units.

But yeah I can't wait further for the game. And I am going for Edgelord. Based on the official tease and FEH unit intro she's gotta have an interesting story behind.

*

Back to FEH we now have two more game modes which I also want to talk about.

- Alligence battle -

Interesting concept, but competitiveness forces the highest difficulty and hence very tense and allows very limited unit choices. It's also very luck based when you are not using a DC/CC based team, then you will have to play multiple times to get a high enough score.

But the reward is kind of reasonable - taking 900 as the threshold, the effort required to climb above 900 is hard but not very rewarding, while scoring a 860 is of moderate difficulty. I believe a large portion of the players are settled to the casually playing state on this mode.

- Rokkr Siege -

The opposite of the alligence battle. Fun, promotes casual play and allows huge flexibility. The three difficulty means you can score quite a lot without getting into trouble, and the score cap means you do not need to strike for the optimal. For sure the reward is not the most attractive but 10k feather is still 10k feather and I will take it.

In the discord channel we have seen many different setups, but today I want to talk about my setup.

Three features about the dynamax (taking a lesson from the shitty pokemon sword&shield -- that's another story for another day) boss:
1) Swaps upon special proc
2) AOE damage upon special proc
3) Always counterattack creating non-zero damage

If you are taking lower difficulties, damage is not a problem and you can deploy simple means of recovery to overcome the damage like recover 3, or breath of life. In advanced however, you will either need to stop special from processing, or use a strong means of healing, like using a staff or heal based moves.

Swapping means your defense tiles will then be occupied by the boss, or that the boss will escape from your lineup. In lower difficulty, it is hard to hit the score cap just because the multiplier is too low, so stragety that adapts swapping is essential if we want to hit the score cap, especially if we are fighting cavalries.

With that being said, to tackle lower difficulties steadily you would like to:
- mobility to tackle swapping
- minimum healing power

And to tackle the advanced difficulty you would like to:
- much stronger healing
- ability to take down generic enemies
- not necessary to keep a full team to the end; in fact it would be easier to finish the battle within 5 or 6 turns with some units defeated

Some like to use tank units with guard and healing special to lock down the boss, but without enough merging it is hard to hit the score cap. Don't forget that special fighter and guard are both premium skills and quite costly to inherit (if you do not use to do that).

Another problem with guard is the 70% HP requirement which is hard to maintain during enemy phase. My brave sword guard DC Ayra strategy failed miserably -- not to mention that such build is so impractical in PVP battles.

So with my newly merged +10 Catria, I had an idea. A lesson taken from my Cherche.

The setup is basically dancer + flying healer (witchy hand) + 2 fliers

Dancer - Partial tank, need to tank attacks with triangle disadvantage

Olivia in my case
A - Atk/Def Bond 3
B - Wings of Mercy 3
C - Hone Atk 4 [flexible C-skill or depends on your flier performance]
S - Atk/Def Bond 3

L!Azura is of course a perfect choice for fliers, but she cannot tank physical attacks and you may not have enough Iote shields.

Flying healer - putting guard effect on enemy

HS!Sakura [with H!Mia inherited]
A - Iote shield [use something else if you have it on the S-slot]
B - Live to serve 3
C - Hone fliers [spur buffs are also preferred, since the units may move around]
S - Breath of life 3

Fliers - to block boss on one quadrant and DPS
Units depends on the color of enemy but they should be brave based with galeforce. Without galeforce we can steadily hit the cap in 5 turns. It is suggested to bring at least one galeforce flier. If you do not have galeforce, sol is a temporary solution.

Standard builds:
Weapon - Brave weapon [or amiti / whitewing weapons]
Special - Galeforce / Sol
A - Iote shield / Swift sparrow / Death blow / Life and death
B - Seal atk / seal def
C - Ward fliers
S - Iote shield / defensive based seals

We start by blocking the boss on one of the quadrant - attacking is of second priority because we have enough time. It is important to keep the right formation to keep things predictable.
(1): Cherche to destory the wall
(2): Sakura to attack so as to reset the special cooldown
(3): Catria attacks [quad attack due to whitewing effect] 3 times [galeforce + dancing]

If we are fighting close attack bosses then it's not going to move but otherwise the boss may move by a grid, then we have to reform. We first move the unit to facilitate Sakura - remember that when you are using Brave weapons, a second attack would trigger boss' special so we must use Sakura before the second attack.

Here Sonya moved up a grid.
(1): Cherche moved up and attack [galeforce activated so that she looks active again]
(2): Sakura goes up to attack
(3): Catria and Olivia go up accordingly

It is important to deal with other generic enemies. That's the advantage of using galeforce -- we wait until they approach the fliers and attack, within the attack range the two fliers can kill the enemy then going back to the original position without further dancing. The dancer is also expected to be capable to kill most non-armor enemy by floating around.

It is relatively easy to lock the boss using this strategy, unless it's cavalry distant boss -- then we will need to carefully corner her.

The theoretical limit is 6.5 mil points. I somehow used 2 crests in the first round, so this is a pretty good score. It's definitely not a very rewarding act, yet this is a fun mode to play.

*

Oh and the Three Houses banner is out. Bitybroken by Chrom I spent 400 orbs to get Edgelord and Byleth. Now I am not prepared for Ayra revival...

## Monday 22 July 2019

### 夢．十夜 (3) The Arena

「美麗動人的小姐，很榮幸可以再次見到您。今天需要我來介紹嗎？」一把熟悉的聲音從後傳來。我扭頭向後望，遊戲「愛麗絲與魔法之國」的男主雷伊就在身後。

「抱歉……你能不能被我俘獲？」

「！！」

「聽說你這個月一直在玩喔，上次活動也衝進7000位了，每天不玩個八小時基本上摸不到這個排名吧？」少年依舊「微笑」著，慢慢把臉湊過來：「我想，應該不會只為了拿到登入獎勵就這麼拼吧？」比起少年的問句，我開始感受到後面「愛麗絲」們兇狠的目光……應該是在想一會到底怎樣才能拿到這樣的殺必死吧。嗯，一定是這樣沒錯。

「我才沒有玩……喂你湊太近了啦！」我連忙抗議道：「玩這麼一個月甚麼鳥蛋六星都沒有抽到，我都快要放棄了……這種超弱玩家還是找來打活動只會拖後腿吧？還有你……過來是打工的還是來泡妹的？你看後面的太太們都快要暴動了哦。」

「嘛，我是特約過來cosplay的。這種事情我又不管，誰叫我長得這麼帥呢。」少年還是掛著「微笑」表情，他的帥氣笑容自信到要溢出來了：「與其看到我跟你玩會吃醋，不如說愛麗絲們下次光臨也有機會這樣互動呢……好啦，在我去應付其他太太們之前，可以請你點些甚麼嗎？今天點這幾個特調飲品的話可以抽遊戲精品回去喔。」他忽然湊到我耳邊說話，射我身上的殺氣變得更重了：「Alex他們又想找你一起打活動，在群組裡沒看到你回應只好讓我來問你了。今晚八點以後可以回來這邊等我嗎？正好這裡附近有家不錯的餐廳值得一試喔。」

「好、好啦！我叫點東西就是了！別來煩我，你去處理其他客人啦！我要這個！」我隨手拿起菜單一指，剛好是「雷伊小貓屋熱朱古力」。

「好哦～來一杯雷伊熱朱古力～」他居然直接對廚房喊了起來。等等只有拉麵屋才會這樣叫吧？！？

*

「都錯了，」對對對，我就是想看你的CG「警訝」表情。我禁不住揚起的嘴角應道：「我打jubeat打到手痛，剛好發現時間差不多才回來等你的。」

「至少你真的回來等我，這樣我就不用在西餐廳裡獨自用餐啊。我們先走過去吧？再晚一點的話可能沒有位子了哦。」

*

「別小看這裡生意一般，做出來的菜品可是十分正宗，只是跟一堆廉價快餐排在一起身價被拉低不少。」他很快點了幾道菜又把菜單還了回去：「先試試這幾個吧。不夠的話等下加點或者下去掃小吃就好了。」

「誰要跟你增進感情……」「我說是作為同一陣線的玩家情誼啦。當然你另有所指也可以……」

PVP這邊比較有趣。所有人都是固定每十分鐘可以挑戰一次，對手全是PVP排名附近的玩家。匹配相近玩家的用意就是將玩家按本身的硬實力進行排名，底子不夠強的玩家早期衝上去也只會因為不敵上級玩家而漸漸滑落，而老手玩家再怎樣休閒打也可以慢慢爬上去。

「基本上是這樣。不過有一群非重課玩家會在PVP從頭衝到尾然後互相匹配以避免被土豪隊屠殺。這個方法雖然不一定成功，但也算是不課金的最優解了。不過要跟上他們的話從一開始就要全力打，晚了的就會被他們拉開沒辦法抱大腿了。他們基本上都要24小時待命，只要失手個一兩次就掉下去了。實際上能待到最後的人都是少之又少，這就是所謂的『次元之壁』喔。」

「既然如此，我們自己製造可以互抱大腿的區間就好了嗎？」

「誒？」

「把我們公會的人聚集起來，讓大家的分數保持在同一個區間裡。每次大家要互刷時才把防守隊換成弱隊，這樣就不難刷勝場數了。分數區間最好比次元之壁低一截，這樣可以減低被頂尖玩家發現的風險。不過這樣勝場數可能不夠拿最高的排名賞呢，這方面可能要用過去的分數線去預測一下。不過這個活動不能回體也不耗時間，分數線相當穩定呢。要估算分數線的話大概在活動前半就能有個底了。」

「嗯……不清楚呢，視乎匹配到自己人的難度吧。如果是我們公會出人的話四五個人試試看？那邊應該也有人想刷活動的吧，人太多的話自然掉隊就好了呢。」

「好，我現在就叫他們。」卡羅放下半塊曲奇浮在上面的熱咖啡，然後拿出手機放在餐桌上。晚飯過後的群組裡相當熱鬧，大家都在討論接下來的活動。裡面有我已經認識的Alex、阿飛跟小雨，更多的是我從沒聽過的玩家。

Lampbear：「是新人玩家嗎？快點拉進群裡吧(ﾟ∀ﾟ)」是沒看過的玩家呢，先叫她熊熊好了。

Sora：「這張要PVP前一百才能拿到喔，相當的不容易呢。」

Sora：「好像很有趣的樣子，我也來幫忙吧。」

「都那麼晚了，一個女生去機廳還是很危險的。讓我陪你去吧。」

*

「搜查官」戴娜

「案件，處理完畢。」

*

「按照計劃，我們團隊的人也順利進到前一百名裡面。我們三個的排名是86、89和90名。門檻比上次高了不少。」

「嗯，很正常，這遊戲還在高速發展期吧。」

「六星排名那張我們叫價250瓶水還沒賣出去。不過市場上的賣家不多，這張卡又萌又好用，我覺得賣出去是遲早的事。」

「沒關係，這張賣不出給兄弟們掛在首頁也可以，錢我補貼就好了。」

「比較有趣的是，我們似乎注意到有其他成功刷勝場數的玩家。」

「嗯？」肥宅第一次停下手遊操作望向屏幕。

Skype的另一端是一位銀髮少女，寬鬆的T恤並沒法掩飾她玲瓏有致的身材。似乎是料到對面會對這個消息感興趣一般，她微微一笑，放慢將接下來的情報道出：「我們在匹配不到自己人時打過不少其他附近的玩家，其中有兩次對到送分的防守配置。」

「那你有調查過這兩個玩家的背景嗎？」

「有，」少女笑得更燦爛了：「他們才剛在遊戲內的留言版互打招呼呢。」

----