[Math] Correct probability calculation for Minesweeper

combinatoricsprobabilityrecreational-mathematics

When I play Minesweeper, every now and then I reach a point where I have to make a guess. I then try to calculate the probability for every option to be a mine in order to choose the safest move. But sometimes I find that different calculations result in different probabilities, which means I'm doing it wrong in some sense, and this is what I want to clarify.

Below is an example of such a dilemma.
enter image description here
Notice the green mark in the upper-left region. I have two choices next to the 4-mark, each with a probability of $\frac{1}{2}$.

On the other hand, from the 5-mark point of view, we need to select 2 squares out of 3, suggesting a $\frac{2}{3}$ probability for each square.

We can also follow a third calculation, by starting from the 2-mark on the rightmost square on this remaining "island": if the upper square is a mine, it can be easily seen that the upper square of the 4-mark must also be a mine; if not- it can be shown that both 4-mark squares have equal probability to be mines. This implies that the upper 4-mark square has probability of $\frac{3}{4}$ to be a mine – again a contradiction.

A more "desperate" attempt would be to say that all three "calculation trajectories" are equally likely, thus we need to add the calculated probabilities and sum them up with a factor of $\frac{1}{3}$. But that is quite awkward, and I'm sure there is more solid reasoning here, but I wasn't able to prove it myself.

So… what is the correct way to calculate the probability?

As a last remark – I assume here that the remaining island is large enough such that no further meaningful information can be extracted from the remaining squares, such as the number of remaining mines, or a direct enumeration of all possible mine distributions.

Thanks, and I hope you find this intriguing as I do. 🙂

Best Answer

You get different probabilities because in each case you only consider a particular part of the board, and thus in each case you only consider only a strict part of all the information that is there. So, there really aren't any contradictions here.

If you want to know what the probability is given the whole board, then your calculations will become more complicated. In fact, you'd have to take into account even more than those three 'trajectories' you mentioned ... and if you add the information that there are exactly 10 more mines to place, it becomes more complicated yet.

Still, I would say that your third line of reasoning (that start with the 2 in the top right of the open region) probably gets closest to the actual probability, for the following reasons:

  1. It takes into account the most information (indeed, it includes the information regarding the 5-square).

  2. There is a good bit of room left at the top left, thus you can easily pack different numbers of mines there, so even knowing there are 10 mines left should minimally impact/constrain what could happen next to that 2.

  3. The 3 flags stacked on top of each other next to the 5 naturally carve the space in a 'left' and 'right', and there is no direct line of reasoning as to how satisfying the numbers on the left will impact what happens on the right.

So, the number of ways you can work out having a mine directly to the left of the top right 2 should be very close to the number of ways you can have a mine below that ... meaning that I would agree that, even if you take into account the whole board, the probability of a mine in each of those squares is indeed around $1/2$, and with that, the probability of the top square next to the 4 being a mine is indeed very close to 3/4

In general, though, yeah, try and take into account everything as is 'humanly possible' ... which in most cases is not considering how many more mines there are. But the example you gave here does show how certain lines of reasoning take into account more information than others, and the more information you take into account, the closer you tend to get to the probability if you somehow could take into everything.