LikeLike

]]>Testing medium puzzles gives us the following results with each set being

5000 puzzles using 10 seeds each (and endPlay=30, Guess1Offset=-0.03):

Pos Set1 Set2 Totals Percent Std. Dev.

————————————————————————————————————–

1,1 4358 4297 8655 86.55% 0.87%

2,2 4413 4359 8772 87.72% 0.88%

2,1 4376 4352 8728 87.28% 0.87%

1,2 4369 4339 8708 87.08% 0.87%

3,3 4400 4330 8730 87.30% 0.87%

3,2 4432 4337 8769 87.69% 0.88%

2,3 4393 4345 8738 87.38% 0.87%

4,4 4384 4313 8697 86.97% 0.87%

Using start=3,2, endPlay=30, guess1Offset=-.03 we get the following

using 1000 samples:

Percent 87.6% deviation = 2.77%

Guess1 used= 100

Guess2 used= 309

Guess 1 failed=17.0%

Guess 2 failed=34.6%

Average guesses per win=0.26

Average guesses per loss=1.43

Average Win Prob= 94.0%

Average Loss Prob= 59.0%

Average Guess 1 Prob= 89.7%

Average Guess 2 Prob= 67.5%

Wins with guesses

0 1 2 3 4 5 6 7 8+

730 99 30 6 6 1 3 0 1

Testing SMALL puzzles gives us the following results with each set being

5000 puzzles using 10 seeds each (and endPlay=30, Guess1Offset=-0.03):

Pos Set1 Set2 Totals Percent Std. Dev.

————————————————————————————————————–

1,1 4816 4817 96.33 96.33% 0.96%

2,2 4844 4858 9702 97.02% 0.97%

2,1 4836 4835 9671 96.71% 0.97%

1,2 4846 4843 9689 96.89% 0.97%

3,3 4849 4840 9689 96.89% 0.97%

3,2 4840 4849 9689 96.89% 0.97%

2,3 4812 4823 9635 96.35% 0.96%

4,4 4813 4813 9626 96.26% 0.96%

Using start=3,2, endPlay=30, guess1Offset=-.03 we get the following

using 1000 samples:

Percent 96.7% deviation = 3.06%

Guess1 used= 35

Guess2 used= 73

Guess 1 failed=5.7%

Guess 2 failed=42.5%

Average guesses per win=0.07

Average guesses per loss=1.21

Average Win Prob= 98.4%

Average Loss Prob= 50.8%

Average Guess 1 Prob= 95.6%

Average Guess 2 Prob= 57.3%

Wins with guesses

0 1 2 3 4 5 6 7 8+

909 48 10 0 0 0 0 0 0

LikeLike

]]>LikeLike

]]>Start Win w/o Guess1

———————

0,0 38.6% 33.4%

1,1 44.7% 41.0%

2,2 47.2% 45.3%

2,1 45.5% 43.1%

1,2 46.2% 43.6%

3,3 47.5% 45.8%

3,2 47.7% 45.5%

2,3 47.0% 45.1%

3,1 45.0% 43.4%

1,3 45.4% 43.7%

4,4 45.9% 44.7%

4,3 47.4% 45.8%

3,4 47.2% 45.2%

4,2 46.0% 44.7%

2,4 46.7% 45.6%

4,1 45.4% 43.6%

1,4 45.7% 44.0%

0,7 44.6% 41.6%

1,7 45.7% 44.3%

2,7 47.0% 45.2%

3,7 46.4% 45.1%

4,7 46.0% 44.2%

As you can see Guess1 helps a few percent.

LikeLike

]]>need explanations or is of some interest.

* Guess1 failed is less than Guess2 failed is always a good sign because it

means we are doing the right thing picking Guess1 first.

* Average Guess1 probability is higher than Guess2 also means we are making

the right choice to use Guess1 instead of Guess2. Notice the high probability

of success for both Guess1 and Guess2. This is good.

* The average number of guesses per win is close to two means we generally

need to guess twice before winning.

* The average number of guesses per loss is often close to one more than

a win which is what I would expect.

* Notice we can win less 16% of games without guessing and only another 10%

guessing only once. In general we win 33% of games guessing twice or less.

* The average win/loss probability is the product of all guesses so far up

until we win or lose.

So putting this all together using start=3,2, endPlay=15, guess1Offset=-.03 we get

the following using results using 10,000 puzzles:

Wins 4696

Percent 46.96% deviation = .47%

Guess1 used = 9395

Guess2 used = 14159

Guess 1 failed=17.7%

Guess 2 failed=25.0%

Average guesses per win= 1.806

Average guesses per loss= 2.804

Average Loss Prob= 56.9%

Average Win Prob= 71.67%

Average Loss Prob= 56.48%

Average Guess 1 Prob= 85.13%

Average Guess 2 Prob= 76.65%

Wins with guesses

0 1 2 3 4 5 6 7 8+

1633 1025 707 490 312 191 119 87 132

LikeLike

]]>of 500 puzzles. As I mentioned in my early post there are some strange numbers here which I do not understand. If anyone has any idea why, please let me know. As best as I can tell starting at 3,2 is better than anything else in the upper left quadrant. There are some other good choices marked.

Pos Set1 Set2 Set3 Totals Percent Std. Dev.

————————————————————————————————————–

0,0 1938 1990 1928 5856 39.04% .32%

1,1 2154 2207 2233 6594 43.96% .36%

2,2 2276 2353 2359 6988 46.59% .38% good

2,1 2243 2311 2274 6828 45.52% .37%

1,2 2226 2277 2309 6812 45.41% .37%

3,3 2279 2350 2373 7002 46.68% .38% good

3,2 2341 2369 2383 7093 47.29% .39% best

2,3 2322 2321 2351 6994 46.63% .38% good

3,1 2184 2278 2251 6713 44.74% .37%

1,3 2283 2329 2270 6882 45.88% .37%

4,4 2161 2313 2296 6770 45.13% .37%

4,3 2204 2333 2369 6906 46.04% .38%

3,4 2261 2302 2360 6923 46.15% .38%

4,2 2178 2358 2300 6836 45.57% .37%

2,4 2284 2247 2337 6868 45.79% .37%

4,1 2174 2283 2271 6728 44.85% .37%

1,4 2176 2275 2287 6738 44.92% .37%

0,7 2191 2236 2232 6659 44.39% .36%

1,7 2241 2284 2287 6812 45.41% .37%

2,7 2312 2334 2352 6998 46.65% .38% good

3,7 2297 2318 2322 6937 46.25% .38%

4,7 2259 2301 2300 6860 45.73% .37%

LikeLike

]]>to calculate all solutions with unconnected sequences of length greater than this.

Here is some sample results using 10 different random seeds and 4000 samples:

endPlay Wins Percent Std. Dev.

————————————————————————————————————–

6 1825 45.6% 0.72%

8 1831 45.8% 0.72%

10 1847 46.2% 0.73%

12 1851 46.3% 0.73%

13 1852 46.3% 0.73%

14 1856 46.4% 0.73%

15 1857 46.4% 0.73%

16 1858 46.5% 0.73%

17 1858 46.5% 0.73%

18 1859 46.5% 0.73%

19 1859 46.5% 0.73%

20 1858 46.5% 0.73%

21 1858 46.5% 0.73%

22 1861 46.5% 0.74%

23 1862 46.6% 0.74%

24 1858 46.5% 0.73%

25 1861 46.5% 0.74%

26 1862 46.6% 0.74%

27 1866 46.7% 0.74%

28 1870 46.8% 0.74%

29 1874 46.9% 0.74%

30 1874 46.9% 0.74%

Next I will post the results of my starting position analysis.

LikeLike

]]>If you do use guess1 there are two different ways you can go. You can pick an entry next to a sequences to help support any sequence. This the first choice because you are likely to get some help that will hep solve more of the puzzle. I look for situations that look like this:

XXX

– – –

?

I will pick the ? entry even if one of the X positions are off the edge. Actually my method is a little more complicated that this but I will skip the details. If I cannot find one these situations I will try to find a free entry with the fewest number of free entries around it. The goal is to expose an area with no mines around it. This is almost always a corner but if they are taken an edge will do too. I will not fill an entry surrounded by mines unless there is 100% chance it is not a mine.

Because the odds for guess1 are just an estimate I added an offset to the odds to try to optimize the best time to use it. I call this my guess1 off and after running 12,000 samples the results are shown in following table. So I have decided to use -3%. This means if the odds of a mine in the free area minus 3% is less than the odds using guess2, then we use guess1.

Average Percent Std. Dev.

———————————–

-0.06 46.50% .42%

-0.05 46.70% .43%

-0.04 46.70% .43%

-0.03 46.77% .43%

-0.02 46.57% .43%

Next I will provide information on the best value of “end play” which is the number of remaining entries before we invoke the end play method.

BTW the 50% quoted by the author has a standard deviation of 6.2% for the 67 samples he used. So yes he got lucky.

LikeLike

]]>Now for the second more interesting part. If the sum of the max mines used for all sequences exceeds the mine count you can go back and recheck the possible solutions reducing the max limit. For example suppose we find three sequences with min and max mine counts of (2,2), (11,13), and (2,2) but only 15 mines left. So we recheck solutions for the second sequence limiting it to 11 mines. Or suppose you find four sequences with min and max mine counts of: (1,1), (4,6), (6,8), and (1,1) but only 13 mines remaining. This means that we cannot have the second sequence use 6 mines nor have the third sequence use 8 mines. So now we can go back and retest these two sequences using a max of 5 and 7 respectively.

A third optimization occurs when we have situations where the sequences take up all the remaining unexposed entries in the puzzle and yet end play is not yet invoked and there is more than one sequence and min != max. For example, we have two sequences with min and max mine counts of (5,6) and (2,3) with 8 mines remaining. The first sequence has 4 solutions and the second 3 solutions and there is no obvious choice where to play. However if we combine the two sequences into one and invoke end play we find there are 8 solutions but one location has 0% chance of a mine!

This leads to the obvious rule that is not mentioned above. After using the tank method, if you have any entry with 100% chance of a mine or 0% chance of a mine, then make the obvious choice.

However, if you have equal choices between two or more locations there are reasons to pick one over another. In the author’s example above where there are several places with a count of two, I can see two places where I would play over the others. Any time you have three tiles in a row or column it is often better to play in the middle adjacent to them so that if a one is exposed then we can make some obvious selection to expose as many as three other tiles. However, if you picked the diagonal positions there are few values that will help. So my fourth optimization I have an evaluation method which I will not go into here but it does pick these more likely spots.

One optimization I have not done is to expose a mine where it is more likely than exposing a non-mine entry. Nor have I done any look ahead (if I place a mine here will that help make an obvious choice). I will look into those later.

I also have a second method for guessing that does not use the tank method and I will describe at some point in the future.

I forgot to mention that the original 6000 sample runs use some starting parameters that may not be optimal (start=3,3 endplay=14, offset=-.03). I will explain these numbers later.

I am working on this program and I find bugs or improvements every day I work on this. When I get done I will post better numbers. As for now I am trying to find out why some starting positions have better results than others.

LikeLike

]]>These all use (3,3) as the starting position. All tests use 100 sample puzzles. As you can see it makes little difference.

endPlay 6 8 10 12 13 14 15 16 17 18 20 22 24

seed ————————————————————————————–

123 47 47 47 47 47 47 47 47 47 47 47 47 46

234 44 44 45 45 45 46 46 46 46 46 48 47 48

345 47 47 48 48 48 49 49 49 49 49 48 49 49

456 52 52 52 52 52 52 53 52 52 52 51 51 51

1234 37 37 37 37 38 38 38 38 38 38 38 37 36

———————————————————————————————-

Totals 227 227 229 229 230 232 233 232 232 232 232 231 230

LikeLike

]]>