HomeBlogAbout UsWorkContentContact Us
 
 Advertisment 

Classic Minesweeper

I’m sure everyone has wasted a few hours playing Minesweeper on earlier version of Windows. It’s a timeless puzzle game.

[ As I was researching this post I discovered that the version of Minesweeper that ships with Windows 7 (developed by Oberon) has different starting logic and so I’m reverting to the earlier classic versions of Minesweeper for this analysis. ]

Guessing

Minesweeper is a great little game and the only annoying part is that, sometimes, you have to guess in order to continue. It’s not hard to expose a situation where it is a coin toss as to the exact location of a mine. For example, in the image to the right, either of the top two squares could be a mine. There’s no way to find any additional information to disambiguate.

When you lose a coin flip, the result is that you’re usually very eager to start a new game and get invested into the next game very quickly. This requires opening up the board as fast as possible.

When starting a game, ideally, what you’d like to see happen is to have a nice large blob open up so that you can walk around the edge, just like in the image below. If you click on a square that is entirely surrounded by safe areas, then minesweeper automatically ‘clicks’ on these areas and the region expands.

Windows Minesweeper always allows makes your first click safe. No matter how ridiculously dense the board, if your first click would have landed you on a bomb, the program swaps this bomb with a blank space. After this you are on your own.

Where is the best place for your first click?

Using the criteria that we want the first click to be a click that Maximizes the chances that we click on a square entirely surrounded by other blank spaces, where is the best place to click? A Corner, an Edge, or a Middle square?

Corner Edge Middle

Let’s do the math …

Probability of a blank space

To create an exposed blob, we need all the squares around the square we click to also be empty spaces.

We already know that the first click square is going to be an empty space (our freebie). We now need to calculate the probability that the first touching square is also an empty space.

If there are N squares in the grid, then, because we've already exposed one cell, there are N - 1 squares left, and the number of empty squares (not mines) is N - M - 1

(Where M is the total number of mines in the puzzle.)

The probability that the first touching cell is also an empty cell is therefore: (N - M - 1) / (N - 1)

 

If the center cell is empty, and the first touching cell is empty, then the probability that the second touching square will also empty can be calculated.

It's not hard to see that the denominator changes to N - 2 (There are now two less unidentified squares on the grid), and the numerator changes to N - M - 2 (There are two less possible empty spaces).

The probability that the second touching cell is an empty cell is therefore: (N - M - 2) / (N - 2)

We can carry this on around all eight touching squares. Mathematically, we need to AND all these probabilities together, which we do by multiplying them.

The probability that a hole is created when a click is made in the middle of the board is therefore:

Similarly, if we click on a corner or edge we can see that the calculations are similar, but this time there are less touching squares. (Only three touching squares for a corner click, and five touching squares for an edge click).

Beginner, Intermediate and Advanced

Classic Minesweeper has three default difficulty settings: Beginner, Intermediate and Expert.

Below are details of the settings

LevelWidthHeightMines
Beginner9910
Intermediate161640
Expert301699

Plugging these numbers into formula reveals these probabilities:

LevelCornerEdgeMiddle
Beginner66.626 %50.345 %32.567 %
Intermediate59.805 %42.294 %25.010 %
Expert49.846 %31.251 %15.449 %

Always click on a corner !

It should be no surprise now that we've walked through the math that it is always best to click in a corner to maximize the chances that a cascade will occur. This should now be obvious, as the corner is the place that minimizes the number of adjacent squares!

 

You can find a complete list of all the articles here.      Click here to receive email alerts on new articles.

© 2009-2013 DataGenetics