4

This is a followup query to the following: Minesweeper odds for this scenario, 2 different calculations

I answered that query and now believe that my answer is wrong (explanation below). I ask professional mathematicians to respond.

In my answer, I assumed that each case was equally likely, and in my addendum-1, which endorsed the OP's identification of 104 cases, I assumed that each of the 104 cases was equally likely. I now question that assumption.

In Minesweeper, there are always a greater number of unmined cells than mined cells. Therefore, it seems to me that in the OP's query, a case that involved only 4 mines in the region is more likely than a case that involved 5 mines.

Specifically, suppose that the underlying diagram which this minesweeper region came from has $m$ mined cells and $t$ total cells with $\;p = m/t\;$ and $\;p < 1/2\;$ and $\;q = 1-p.\;$ In the OP's diagram there are 17 unknown cells, each of which may or may not contain a mine (i.e. cell Q could contain a mine). Consider the following two specific cases, each of which satisfy the original problem's constraints.

$\underline{\text{Case 1}}$
Mines only in cells A, B, F, H, and N. The chance of this case occuring is $p^5 \times q^{12}.$

$\underline{\text{Case 2}}$
Mines only in cells A, B, and G. The chance of this case occuring is $p^3 \times q^{14}.$

Therefore, case 2 above is $\;(q/p)^2\;$ times more likely than case 1.

Is my analysis correct?

user2661923
  • 35,619
  • 3
  • 17
  • 39

1 Answers1

4

Edit:

After seeing the new question Calculating odds of Minesweeper is this correct?, I realized that I'd made a significant mistake in this answer. See the edit at the end for the correction.


The question cannot be answered locally. The answer depends on the information you've gained in other parts of the board. That information may itself be complicated. In the easier case where that information takes the simpler form of a known number $m$ of remaining mines in $t$ remaining unidentified squares, a solution that assigns $n$ mines to $s$ of the unidentified squares has weight

$$ \binom{t-s}{m-n}\;. $$

The probability of this assignment for these $s$ squares being correct is this weight, normalized by the sum of the weights of all possible solutions for these $s$ squares.

If $t\gg s$ and $m\gg n$, this can be well approximated as

$$ \binom tm\left(\frac mt\right)^n\left(\frac{t-m}t\right)^{s-n}\;, $$

which corresponds to your calculation with $p=\frac mt$ and $q=\frac{t-m}t$.

Edit:

Since an explanation was requested, I'll do this for the example in Minesweeper odds for this scenario, 2 different calculations. Let's say we have a total of $t=27$ unidentified squares left, and we know there's a total of $m=11$ mines in them. The local patch that we're assigning solutions to has $s=15$ squares (which doesn't count the grey squares $M$ and $Q$, since we don't know anything about them and aren't assigning mines to them).

So each solution that assigns $n=3$ mines has weight $\binom{27-15}{11-3}=\binom{12}8=495$, every solution that assigns $n=4$ mines has weight $\binom{17-15}{11-4}=\binom{12}7=792$ and every solution that assigns $n=5$ mines has weight $\binom{17-15}{11-5}=\binom{12}6=924$. There are $2$, $3$ and $1$ such solutions, respectively, so the sum of the weights is $2\cdot495+3\cdot792+1\cdot924=4290$, so the probabilities for the solutions are $\frac{495}{4290}=\frac3{26}\approx11.5\%$, $\frac{792}{4290}=\frac{12}{65}\approx18.5\%$ and $\frac{924}{4290}=\frac{14}{65}\approx21.5\%$, respectively.

By comparison, with the approximation $p^nq^{s-n}$ given in the question, with $p=\frac mt=\frac{11}{27}$ and $q=1-p=\frac{16}{27}$, the approximate probabilities come out as $\left(\frac{11}{27}\right)^n\left(\frac{16}{27}\right)^{15-n}$. Here, too, we have to normalize them, so we can drop a common factor of $\left(\frac{11}{27}\right)^3\left(\frac{16}{27}\right)^{10}$, which leaves us with $\left(\frac{16}{27}\right)^2=\frac{256}{729}$ for $n=3$, $\frac{11}{27}\cdot\frac{16}{27}=\frac{176}{729}$ for $n=4$ and $\left(\frac{11}{27}\right)^2=\frac{121}{729}$ for $n=5$. Note that the conditions for the approximation to be good, $t\gg s$ and $m\gg n$, aren't fulfilled, and in fact the approximation gets the order of the weights wrong; it makes the $n=3$ case the most likely and the $n=5$ case the least likely, whereas for the correct weights it's the other way around. The sum (again including the counts of each type of solution) is $2\cdot\frac{256}{729}+3\cdot\frac{176}{729}+1\cdot\frac{121}{729}=\frac{1161}{729}=\frac{43}{27}$, so the probabilities would come out as $\frac{256}{1161}\approx22.0\%$ for $n=3$, $\frac{176}{1161}\approx15.2\%$ for $n=4$ and $\frac{121}{1161}\approx10.4\%$ for $n=5$. So in this case the approximation is in fact quite bad and we should use the exact calculation.


Edit:

The above calculation would be correct if each of the six scenarios were a single solution. I didn't take into account that each scenario actually stands for several solutions in which the mines are distributed within the groups of coloured squares. It's these $104$ individual solutions that need to be weighted.

So we have a total of $4+6=10$ solutions with $n=3$ mines, $18+24+4=46$ solutions with $n=4$ mines and $48$ solutions with $n=5$ mines.

Thus the sum of weights is $10\cdot495+46\cdot792+48\cdot924=85734$, and the probability of each individual solution with $3$ mines is $\frac{495}{85734}=\frac5{866}\approx0.58\%$, with $4$ mines $\frac{792}{85734}=\frac4{433}\approx0.92\%$ and with $5$ mines $\frac{924}{85734}=\frac{14}{1299}\approx1.08\%$.

joriki
  • 238,052
  • Interesting. I totally overlooked the need to assign a weight (i.e. $\binom{t-s}{m-n}$) to each case. – user2661923 Dec 02 '19 at 17:18
  • "The answer depends on the information you've gained in other parts of the board." I am trying to figure out how this would work, since the other parts of the board would depend on this part. What if the board contained a similar scenario in another area (both parts separated by 2+ rows of unknown squares)? – dustytrash Dec 02 '19 at 20:41
  • 1
    @dustytrash "What if the board contained a similar scenario in another area ...?" Then you would have to construe the two separate areas as one large region, and construe a case as a possible set of mine assignments for the entire region. Then you would need to choose an algorithm for assigning weights to each case. This touches on what the first part of joriki's answer was saying: "...The information may itself be complicated...". I refer you back to my earlier suggestion in the first part of my answer to your original query: write a computer program to determine the cases. – user2661923 Dec 02 '19 at 22:21
  • 1
    @dustytrash If you pursue the "...write a computer program..." path, I would have the computer program also assign weights to each case, determine the total number of cases and sum of all of the weights of these cases, and then assign a probability to each case. I would also have the computer program flag those cases that fulfill the auxiliary constraint (e.g. in your original query, whether any of cells N, O, or P have a mine), and then have the computer program compute the probability that the auxiliary constraint is satisfied. – user2661923 Dec 02 '19 at 22:27
  • @user2661923: Well, I called them weights; you calculated probabilities -- it's the same, really -- the a priori probability for $s$ of $t$ squares to contain $n$ of $m$ equidistributed mines in $n$ particular squares is

    $$ \frac{\binom{t-s}{m-n}}{\binom tm};, $$

    but since $\binom tm$ is the same for all solutions, it cancels in the normalization, so I omitted it and called these modified probabilities "weights".

    – joriki Dec 03 '19 at 09:06
  • 1
    @dustytrash: The calculation here is for the simple case where the rest of the board has only fully identified squares (which we can ignore, except for deducting their mine count) and fully unidentified squares. In the scenario you describe, if we have two separate local situations remaining plus unidentified squares elsewhere, you'd have to consider each pair of local solutions together as a possible solution and weight it accordingly. – joriki Dec 03 '19 at 09:11
  • Could you explain how to calculate this part?: "this weight, normalized by the sum of the weights of all possible solutions for these s squares." – dustytrash Dec 04 '19 at 03:03
  • 1
    @dustytrash: I added the calculation for your case to illustrate. – joriki Dec 04 '19 at 07:14
  • I've mentioned & credited a formula from this answer in my new question: https://math.stackexchange.com/questions/3463628/calculating-odds-of-minesweeper-is-this-correct – dustytrash Dec 05 '19 at 01:22