Probability in Minesweeper Suppose I click a random tile during a Minesweeper game. It is a 1. During each time I click an adjacent square, what are the chances of hitting a mine? How would this change if it were a 2 or another number?
I think this is a fantastic question, because you actually arrive at a pretty good strategy for how to begin a game. Sorry it's such a long answer, I try to be thorough so you can see this is the correct answer - there is a summary at the end. I'm going to rephrase your question in the way I interpret what you mean.

At the start of a game of minesweeper, if you click adjacent cells what is the chance of there being a mine in a given cell around these clicked cells? Is there any way to use this for a good opening strategy?

Firstly I'd like to define the following parameters:


$n$ is the number of mines in a grid;
$N$ is the number of cells in a grid;
$\rho=n/N$ is the density of mines in a grid, and the probability of hitting a mine in a random cell.
$$\begin{array}{c c c c}
\mathrm{Difficulty}   &amp; n  &amp;  N  &amp; \rho\\
\hline
\mathrm{Beginner}     &amp; 10 &amp;  64 &amp; 0.156\\
\mathrm{Intermediate} &amp; 40 &amp; 256 &amp; 0.156\\
\mathrm{Expert}       &amp; 99 &amp; 480 &amp; 0.206
\end{array}$$


Secondly I'd like to define the following random variables and events:


$C=\bigcup_i C_i$ is the event of the grid configuration, where $C_i$ is the event of a particular mine configuration (see below). Note that the $C_i$ are disjoint events, so $\mathbb{P}(C)=\sum_i\mathbb{P}(C_i)$.
$X_i=\{\mathrm{mine\ in\ cell\ }i|C\}$ is the event there is a mine in cell $i$, given the situation of the board (these are the probabilities we want to find).
$Y_i$ is a random variable representing the number of mines in a group of cells as specified later on. $\mathbf{Y}$ is the corresponding vector.


Let's assume we neither hit a mine or an opening, as these events are trivial. Instead, let's start by supposing our first click, placed somewhere in the middle of the grid, reveals a 1, which is the most likely case. The probability of any of the 8 surrounding cells containing a mine is $\frac{1}{8}=0.125$, which is lower than $\rho$ on any normal game, so the safest move is to choose an adjacent cell. If the first click were to reveal a 2, you should not click an adjacent cell as $\frac{2}{8}=0.25&gt;\rho$. One possible resulting configuration is displayed below (I use '$(i)$' to label a cell as 'cell $i$').
$$\begin{array}{c c c c c c c}
_{(1)} &amp;|&amp; _{(4)}     &amp;|&amp; _{(5)}     &amp;|&amp; _{(8)}\\
\hline
_{(2)} &amp;|&amp; \mathbf{1} &amp;|&amp; \mathbf{1} &amp;|&amp; _{(9)}\\
\hline
_{(3)} &amp;|&amp; _{(6)}     &amp;|&amp; _{(7)}     &amp;|&amp; _{(10)}
\end{array}$$

The way to calculate the probabilities $\mathbb{P}(X_i)$ for $1\leq i\leq 10$, is to consider all possible configurations of mines in these 10 cells. Cells 1, 2 and 3 are effectively equivalent, as they have the same probabilities and are independent to the other cells in each configuration. In this case there are 3 such groups of cells, $\{1, 2, 3\}, \{4, 5, 6, 7\}, \{8, 9, 10\}$, which $Y_1, Y_2, Y_3$ refer to respectively.

There are two configurations: $\mathbf{Y}= (1,0,1)$ or $(0,1,0)$, which I refer to as $C_1$ and $C_2$ respectively, so $\mathbb{P}(C_1)=\mathbb{P}(Y_1=1,Y_2=0,Y_3=1)$. These are illustrated below.
$\begin{array}{*{7}c}
\star &amp;|&amp;   &amp;|&amp;   &amp;|&amp; \star\\ \hline 
\star &amp;|&amp; 1 &amp;|&amp; 1 &amp;|&amp; \star\\ \hline
\star &amp;|&amp;   &amp;|&amp;   &amp;|&amp; \star
\end{array}\qquad$ 
$\begin{array}{*{7}c}
 &amp;|&amp; \star &amp;|&amp; \star &amp;|&amp; \\ \hline
 &amp;|&amp; 1     &amp;|&amp; 1     &amp;|&amp; \\ \hline
 &amp;|&amp; \star &amp;|&amp; \star &amp;|&amp;
\end{array}$

Now we use conditional probability, and the fact that if $Y_1=1$ then we are in configuration 1.
$$\begin{align}
\mathbb{P}(Y_1=1|C) &amp;= \frac{\mathbb{P}(\{Y_1=1\}\cap C)}{\mathbb{P}(C)}\\
  &amp;= \frac{\mathbb{P}(C_1)}{\mathbb{P}(C_1)+\mathbb{P}(C_2)}
\end{align}$$

To calculate $\mathbb{P}(C_1)$, think about what is required for this to occur - we need exactly 1 mine in a given 3 cells, none in a given 4 cells, and 1 in a different 3 cells. Now to simplify the problem, we will assume that the mine density doesn't change, which is a good approximation at least for large grids like expert. We get
$$\begin{align}
\mathbb{P}(C_1) &amp;= \left[\binom{1}{3}\rho(1-\rho)^2\right] \times (1-\rho)^4 \times \left[\binom{1}{3}\rho(1-\rho)^2\right]\\
  &amp;= 9\rho^2(1-\rho)^8,
\end{align}$$
which corresponds to two situations of choosing 1 mine in 3 cells, 8 cells with no mine, and 2 cells with mines. Thinking of it this way makes it much easier to just write down probabilities, and we can see $\mathbb{P}(C_2)=4\rho(1-\rho)^9$.

This gives
$$\begin{align}
\mathbb{P}(Y_1=1|C) &amp;= \frac{9\rho^2(1-\rho)^8}{9\rho^2(1-\rho)^8+4\rho(1-\rho)^9}\\
  &amp;= \frac{9\rho}{9\rho+4(1-\rho)}\\
  &amp;= \frac{9\rho}{4+5\rho}.
\end{align}$$

Finally, divide this by $3$ to get $\mathbb{P}(X_1),\mathbb{P}(X_2),\mathbb{P}(X_3)$, and use this to deduce the other cells' probabilities. So we get the following probabilities (for expert grid):
$$\begin{array}{*{7}c}
0.123 &amp;|&amp; 0.158      &amp;|&amp; 0.158      &amp;|&amp; 0.123\\
\hline
0.123 &amp;|&amp; \mathbf{1} &amp;|&amp; \mathbf{1} &amp;|&amp; 0.123\\
\hline
0.123 &amp;|&amp; 0.158      &amp;|&amp; 0.158      &amp;|&amp; 0.123
\end{array}$$
So we conclude that the best next move would be to click on one of the side cells on the left or right, next to the clicked cells, as $0.123&lt;\rho$, so there is a lower chance of hitting a mine.

To speed up these calculations for other situations, notice it is easier to think of the ratio of the configuration probabilities, only having to consider the number of combinations and the relative number of mines. For example, if our second click was a 2 instead of a 1, to give
$\begin{array}{*{5}} \hline
|&amp; 1 &amp;|&amp; 2 &amp;| \\ \hline
\end{array}$
 the two combinations $C_1$ and $C_2$ are $\mathbf{Y}=(1,0,2)$ or $(0,1,1)$.
$$\frac{\mathbb{P}(C_1)}{\mathbb{P}(C_2)}=\frac{\binom{1}{3}\binom{2}{3}\rho}{\binom{1}{4}\binom{1}{3}(1-\rho)}$$

However, we can approximate $\rho\approx 0.2$ so that the relative chance of hitting a safe cell to hitting a mine is $\frac{1-\rho}{\rho}=4$. The calculations then become very easy:
$$\begin{align}
4\times12\mathbb{P}(C_1) &amp;= 9\mathbb{P}(C_2)\\
\mathbb{P}(X_1) &amp;= \frac{1}{3}\mathbb{P}(Y_1=1|C)\\
  &amp;= \frac{\mathbb{P}(C_1)}{3(\mathbb{P}(C_1)+\mathbb{P}(C_2))}\\
  &amp;= \frac{9}{3\times(4\times12+9)} = \frac{1}{19}\\
\mathbb{P}(X_4) &amp;= \frac{1}{4}\left(\frac{4\times12}{4\times12+9}\right) = \frac{4}{19}\\
\mathbb{P}(X_7) &amp;= \frac{2}{3}\left(\frac{9}{4\times12+9}\right) + \frac{1}{3}\left(\frac{4\times12}{4\times12+9}\right) = \frac{22}{57}.
\end{align}$$

So we see the cells that are only adjacent to the 1 are very safe.
$$\begin{array}{*{7}c}
0.05 &amp;|&amp; 0.21       &amp;|&amp; 0.21       &amp;|&amp; 0.39\\
\hline
0.05 &amp;|&amp; \mathbf{1} &amp;|&amp; \mathbf{2} &amp;|&amp; 0.39\\
\hline
0.05 &amp;|&amp; 0.21       &amp;|&amp; 0.21       &amp;|&amp; 0.39
\end{array}$$

We would see a similar result if it were a 3 on the right next to the 1. In any of these cases, our best option is to click one of $X_1, X_2, X_3$. Let's consider the case that we click $X_2$. We're fairly likely to hit an opening at this point, but lastly, I will analyse the other likely situation, of hitting another number 1, giving us
$$\begin{array}{*{9}c}
_{(1)} &amp;|&amp; _{(4)}     &amp;|&amp; _{(6)}     &amp;|&amp; _{(8)} &amp;|&amp; _{(10)}\\
\hline
_{(2)} &amp;|&amp; \mathbf{1} &amp;|&amp; \mathbf{1} &amp;|&amp; \mathbf{1}\ \mathrm{or}\ \mathbf{2} &amp;|&amp; _{(11)}\\
\hline
_{(3)} &amp;|&amp; _{(5)}     &amp;|&amp; _{(7)}     &amp;|&amp; _{(9)} &amp;|&amp; _{(12)}
\end{array}$$

The equivalence groups are $\{1,2,3\}, \{4,5\}, \{6,7\}, \{8,9\}, \{10,11,12\}$. For the 1 1 1 case... the configurations are 
$\mathbf{Y}\in\{(1,0,0,1,0), (0,1,0,0,1), (0,0,1,0,0)\}$, and
$\mathbb{P}(C_1):\mathbb{P}(C_2):\mathbb{P}(C_3) = 3\cdot2:2\cdot3:4\cdot2 = 3:3:4$

For the 1 1 2 case... the configurations are
$\mathbf{Y}\in\{(1,0,0,1,1), (0,1,0,0,2), (0,0,1,0,1)\}$, and
$\mathbb{P}(C_1):\mathbb{P}(C_2):\mathbb{P}(C_3) = 3\cdot2\cdot3:2\cdot3:4\cdot2\cdot3 = 3:1:4$

Working out how many mines result in each section with these configurations, we arrive at the following probabilities.
$$\begin{array}{*{9}c}
0.1 &amp;|&amp; 0.15       &amp;|&amp; 0.2        &amp;|&amp; 0.15       &amp;|&amp; 0.1\\
\hline
0.1 &amp;|&amp; \mathbf{1} &amp;|&amp; \mathbf{1} &amp;|&amp; \mathbf{1} &amp;|&amp; 0.1\\
\hline
0.1 &amp;|&amp; 0.15       &amp;|&amp; 0.2        &amp;|&amp; 0.15       &amp;|&amp; 0.1
\end{array}$$

$$\begin{array}{*{9}c}
0.13 &amp;|&amp; 0.06        &amp;|&amp; 0.25        &amp;|&amp; 0.19     &amp;|&amp; 0.38\\
\hline
0.13 &amp;|&amp; \mathbf{1} &amp;|&amp; \mathbf{1} &amp;|&amp; \mathbf{2} &amp;|&amp; 0.38\\
\hline
0.13 &amp;|&amp; 0.06        &amp;|&amp; 0.25        &amp;|&amp; 0.19     &amp;|&amp; 0.38
\end{array}$$

In summary:
A good opening strategy is as follows:


Click randomly in the middle of the grid (20% chance of losing).
If it was a 1, click an adjacent cell, say the one to the right (13% chance of losing).

If we now have a 1 1 configuration, click one of the six cells adjacent to only one of the revealed 1s, say the one directly to the right (12% chance of losing).
If we have a 1 2 configuration, click one of the 3 cells only next to the 1, say the one directly to the left (5% chance of losing)


If we now have a 1 1 1 configuration, click one of the 6 cells on the ends, next to only one of the 1s (10% chance of losing)
If we have a 1 1 2 configuration, click one of the two cells shared by only the two 1s (6% chance of losing), or maybe click one of the 3 cells on the far left for a higher chance of getting an opening?? (13% chance of losing)
For any tile in a MineSweeper game, the number revealed when clicked (if not a mine) tells the player the number of mines adjacent to that tile.  

For example, assuming your tile is not on the edge of the playing field, it will have 8 adjacent tiles- three above, one on the left, one on the right, and three below.

So, if our tile $T$ reveals some $x \in {1, 2, 3, 4, 5, 6, 7, 8}$ , then the probability a randomly-selected adjacent tile to $T$ is a mine would be $\frac{x}{8}$ ..

The probability calculations for the number of edge cases (on the playing field) is similar. 

EDIT

The key strategy of the game then, is to deduce locations of mines from the already-revealed values of neighboring tiles to T.  Then you can 'flag' correct tiles as mines.