# Monorail

Used as Death Match of Season 3, Round 10 and Season 4, Round 6. (Discussion of S4E6 in particular will come later.)

**Rules**

The objective is to be the one that completes a train track, or to be the one that declares it’s impossible (correctly).

There are 18 square tiles used in the game. Two of them show straight tracks, the station tiles, which are already placed on the grid; the remaining 16 tiles can be made to show a straight track or a bend track, which are to be placed. Players place tiles so that sides match (a track leading to a non-track side is not permitted; think of tile-based games (such as Dominoes or Carcassonne, where sides of tiles must match). A player may place one to three tiles at once, but all of them must be played in a straight line contiguously (think of Scrabble, where you cannot place your tiles separated, only that it’s even more strict; the tiles must be contiguous, not separated by already existing tiles). However, the track itself doesn’t need to be connected; as long as the tiles placed are connected, it’s fine.

The person who places the last tile, completing the track using all tiles already placed, wins. However, a player can also declare that it’s impossible to complete the track, in which the opponent must either complete it (for a win to the non-challenger) or resign (for a win to the challenger).

Also see this video from the Facebook page, which is unfortunately in Korean, but gives illustrations.

**Discussion**

I wrote up an introduction to combinatorial game theory, which is used in this discussion, if you’re not familiar with it before.

First, since in all cases moves are available to both players, this is an impartial game and so Sprague-Grundy theorem declares that it has a Grundy value (aka nim-value, nimber). This makes it possible to analyze the game by finding nimbers.

Sprague-Grundy theorem requires the game to have the normal play convention (player that cannot move loses). For the purpose of this game, it’s easy to decide whether a track can still be completed or not; if it’s not, the current player can declare so for a victory. It’s easier to interpret this as “making a move that makes the track impossible to complete is an illegal move”, so that in case there is an impossible track, the previous player must have made an illegal move; if they indeed didn’t have any legal move, they have lost by that point for having no legal move. This makes the game to satisfy the normal play convention.

Now, this should be solvable by bruteforcing the way, but I’m too lazy to code or let enough computer-hours to do the job. Instead, I will provide one move that I’ve analyzed, which is losing for the first player but the forced win is so deep that there are only two winning moves, both hard to find, and any other move (about 100+ moves exist in any position) loses. The station is marked in orange and the move I suggest is marked in green; the only two winning moves are those in red (both playing one tile).

The first reason is that the *only possible track* involving these tiles is the following:

This can be proven, but it’s a good puzzle nevertheless. (Aka I’m too lazy; you go figure it out yourself.)

Now, with all orientation of tiles fixed, the game suddenly becomes a completely new face: You may put one to three tiles in a contiguous straight line over the red tiles (still with connectivity to the rest of the board), where the last person to place a tile wins. This is way simpler to analyze, especially armed with Sprague-Grundy theorem. We can prove that the left L-shaped part has nimber , and the right d-shaped part has nimber . Thus, by using Nim strategy, the second player must play in the right part to reduce its nimber to . As it turns out, only the two moves above have this property; the rest doesn’t make the nimber , and thus the first player wins by moving on the left part appropriately. (Or if the second player plays in the left part, the first player can play in the right part to equalize the nimbers.)

With human players (and hence possible to make mistakes, especially those as deep as above), that move is a strong one even if losing. I haven’t found a winning first player move—indeed, I’m not even sure whether this is first-player or second-player win—but first player has a major advantage as they can force a major part of the track, if not completely, so that the second player must think carefully. On the other hand, once the track is completely determined, the game becomes simpler to analyze as above, so one must be careful of this if the opponent is aware of the strategy.

So is there a foolproof way to win this like what Hyunmin sort of claimed? https://www.youtube.com/watch?v=aoA9SsD51no

If there is, I haven’t found any, but Hyunmin’s position at 1:23 is clearly losing. The track is completely determined; he has an L-part at the left and two dominoes at top-middle and bottom-rightish. The two dominoes cancel each other since they have the same shape (if one plays in one, the other plays in the other; also their nimbers are both , adding up to ), and the L-part has nimber which is not zero, so the player to move (Jinho) wins. Playing either a single piece at the top of the L (leaving a smaller L of three squares) or two pieces in the middle of the L (breaking it into two single squares) would have won for Jinho. His next move was an error though, giving Hyunmin the win (due to two identical regions always winning for second player; see above).

As for after Hyunmin’s first move, I haven’t completely analyzed that yet, but the track is already completely determined so one can try doing the same as in this post.

“The two dominoes cancel each other since they have the same shape” – I thought they do not cancel each other out, because in this portion, there are 2 (2 double-tile), 3 (2 single-tile + 1 double-tile) or 4 (4 single-tile) moves instead of just 2 double-tile moves, right? Since Hyunmin plays after Jinho, he could have gone for 3 moves instead of 2 or 4.

“Playing either a single piece at the top of the L (leaving a smaller L of three squares) or two pieces in the middle of the L (breaking it into two single squares) would have won for Jinho.”

Wouldn’t this will depend on how the above dominoes play out as well? Hyunmin could have broken up one of the dominoes to create an extra move so he gets to place the last tile regardless.

Sorry, I’m not that good at such puzzles, but just curious at the possibilities of how Hyunmin as the last to go could have manipulated the no of tiles that can be put from a reactive position.

They do. Whoever is winning shouldn’t play on either of the dominoes; if the opponent plays on one, they can mirror the move, making sure that the two dominoes contribute an even number of moves. Hyunmin cannot force the dominoes to be spent in three moves, only if Jinho made a mistake.

And yes, the L also works because the dominoes cancel each other.

Yes, combinatorial game theory isn’t a simple thing. I think I shouldn’t have begun the post with “by Sprague-Grundy theorem”…

Pingback: Introduction to Combinatorial Game Theory, Part 1 | Chaos at the Sky

I wonder if any of the S4 players could have found this? I know Yoohyun knows English, Kyunghoon went to school in the US so surely he does as well, there are probably others…

Even if they found this, the big problem is learning combinatorial game theory. I don’t think any of them knows this; Yoohyun should know game theory by virtue of being a poker player, but combinatorial game theory is not quite the same thing. (Also, I’m pretty sure Hyunmin should know English too, if he’s a student in KAIST. English isn’t that uncommon in Korea.)

I just wanted to say, thanks for this good explanation. Knowing about nimbers allowed me to easily figure out all the puzzles in https://boardgamegeek.com/filepage/21051/venice-connectiondoc and know why the solutions are in fact the winning moves, without having to go through every possible move… I guess the designers of the game also knew that when they designed the puzzles?

Thank you. Well, apparently this is pretty accessible? I thought starting with the sentence “First, since in all cases moves are available to both players, this is an impartial game and so Sprague-Grundy theorem declares that it has a Grundy value (aka nim-value, nimber).” makes people flee. 😛

Yes, the solutions are indeed winning moves and can be verified by counting nimber, without needing to analyze every moves. I can’t tell if the designers know about it, but even if not, it’s still a nontrivial game even though equipped with an advanced technique. (I suppose anything coming from such an obscure field (combinatorial game theory) is advanced. Hey, mathematics don’t only deal with equations; they break open games!)

Someone mentioned on a podcast, and it turns out that if you look closely Kyunghoon actually did at least think about your move:

Apparently he decided that his was better, although they seem about equal to me.

Achievement unlocked: Affect one The Genius player’s thoughtsLet’s just hope Kyunghoon actually got the idea from this.

Meanwhile, both moves are losing, so they are equal against a perfect opponent. I guess his is better because the analysis is harder (the layout isn’t fixed, so there are many more moves, so it’s hard to compute the winning move for the opponent), while on the other hand mine is better because the analysis is simpler (if the opponent doesn’t play a winning move, you can find the winning move easier)…

🙂