How rare is it to get a $8$ in minesweeper? (Bruh reputation requirments) I need help on this, ignore if its already answered.
Ok so today i was wondering, could you get a $8$ in minesweeper and how rare it is?
All i know is that it will be rare. Very rare indeed. I dont really know how to say it. Its so annoying to be honest (tbh). I also dont know what you'd need to answer, so its complicated, well, because of that. If your answering, it might be hard.
Oh, i probably dont know but heres a predicted formula of how rare it is
First, this variable.
p8 = How rare it is to get 8 mines forming a hole like below. X = empty / O = mine
O O O
O X O
O O O
Rc = How rare it is to randomly click inside a patch that has minesweepers all directions you look, using the same
example as the square mines forming a hole in the middle (This means there is no middle mine therefore)
And then, the predicted formula below. It isnt advanced so you could make a better formula. It would please  me.
p8 ÷ Rc = 8r
Forgot to mention. 8r = formula result

So yeah. Not much to explain because im new to stack exchange. Anyways, the end of this probably.
 A: It depends on the size of the grid and the number of mines. In the version of Minesweeper that comes with Windows, the options are:
Easy: $9\times9$ grid with $10$ mines ($\approx 12.3\%$ of the squares have mines)
Intermediate: $16\times16$ grid with $40$ mines ($\approx 15.6\%$ of the squares have mines)
Expert: $30\times16$ grid with $99$ mines ($\approx 20.6\%$ of the squares have mines)
In the easy grid, there are $\binom{81}{10}$, which is about $1.88$ trillion, ways to distribute the mines.
None of the border squares can be surrounded by $8$ mines, only squares in the middle $7\times7$ portion of the grid can possibly be an $8$.
Suppose the upper left square in the middle $7\times7$ grid is surrounded by $8$ mines. Then there are $81-9=72$ squares left to place the remaining $2$ mines. That can be done in $\binom{72}{2}=2556$ ways.
Thus each of the $7\times7=49$ non-border squares has $2556$ ways to be surrounded by $8$ mines. I don't think I double counted any arrangements, but maybe I am overlooking something.
We have $49\times2556=125244$ ways for an easy grid to have an $8$ somewhere. Out of the $1.88$ trillion total easy grids, this gives a probability of about $6\times10^{-8}$. So, very rare indeed!
Working out the probabilities for the bigger boards would be trickier due to the possibility of over-counting, though as the proportion of mines in the grid increases, the likeliness of an $8$ also increases. Also, people in the comments have pointed out other intricacies in the rules of the game on Microsoft that may change the true probability. Interesting question though!
A: We can estimate the probability by instead computing the expected value; this is much easier due to linearity of expectation, and it's going to be close to the probability (but a slight overestimate) because the error between the two scales roughly like the probability of getting at least two $8$s, which is even smaller.
Here is how the calculation goes. If we distribute $k$ mines on an $m \times n$ grid, there are $(m-2)(n-2)$ possible $3 \times 3$ blocks, and the probability that any particular $3 \times 3$ block has an $8$ in the center is
$$\frac{ {mn-9 \choose k-8} }{ {mn \choose k} } = \frac{(mn-k)k(k-1) \dots (k-7)}{mn(mn-1)\dots(mn-8)}$$
(the numerator counts the number of ways to distribute $k-8$ mines among the squares not in the $3 \times 3$ block, and the denominator is the total number of ways to distribute $k$ mines among all the squares in the grid), so the expected number of $8$s on the grid is
$$\boxed{ (m-2)(n-2) \frac{ {mn-9 \choose k-8} }{ {mn \choose k} } }.$$
This is a slight overestimate of the probability of getting an $8$. It may be a little hard to tell how big this is, but as long as $m, n, k$ are not too small it is approximately $(m-2)(n-2) (1 - p) p^8$ where $p = \frac{k}{mn}$ is the density of mines, or equivalently the probability that any given square contains a mine. This is the expected value we would calculate if mines were distributed independently with probability $p$: this gives almost the same distribution over mine locations as distributing a fixed number of mines in general, although the two will differ more the smaller $m, n, k$ are.
Now let's calculate:

*

*On easy we have $m = n = 9, k = 10$, which gives $7^2 \frac{ {9^2 - 9 \choose 2} }{ {9^2 \choose 10} } = \boxed{ 6.7 \times 10^{-8} }$ expected $8$s. This is very close to DreiCleaner's answer but slightly bigger, as it would have to be.


*On intermediate we have $m = n = 16, k = 40$, which gives $14^2 \frac{ {16^2 - 9 \choose 32} }{ {16^2 \choose 40} } = \boxed{ 3.2 \times 10^{-5} }$ expected $8$s. The expected number has gotten bigger, both because the grid is bigger and because the density of mines is higher.


*On expert we have $m = 30, n = 16, k = 99$, which gives $28 \times 14 \frac{ {30 \times 16 - 9 \choose 91} }{ {30 \times 16 \choose 99}} = \boxed{ 8.2 \times 10^{-4} }$ expected $8$s. So it's gotten bigger again.
So $8$s are rare but not astronomically rare. The expected number on expert is a bit less than one in a thousand, so if you played one game of expert a day you'd expect to get one every $3$ years or so. That's assuming you actually get to see it, since $8$s are not exactly easy to find even if they are on the grid!
Generally speaking, for rare events like this which can happen in many different ways which are almost but not quite independent, the distribution of the number of events is asymptotically Poisson. What this means is that if $\lambda$ is the expected number of events, which we calculated exactly above, then the probability that at least one event occurs is
$$1 - e^{-\lambda} \approx \lambda - \frac{\lambda^2}{2} + O(\lambda^3).$$
This is a way to make more precise the claim I made above that the error between the probability and the expected value scales roughly like the probability of getting at least two $8$s; in other words all of the above estimates are quite close, with errors roughly half their square.
Edit: These calculations are verified via simulation in this Youtube video, starting around 9:33. He gives $\frac{1}{p}$ instead of the probability and uses $8 \times 8$ for the size of the beginner board but it's easy to adjust for these changes.
