Talk:Diophantine linear system solving: Difference between revisions

ps guessing
No edit summary
(ps guessing)
 
(4 intermediate revisions by 2 users not shown)
Line 69:
 
You can see that:
 
clue n.1 (danger 1) is responsable for perimeter tile 1, 2, 3, 4, 5 and 7
 
clue n.2 (danger 3) is responsable for perimeter tile 4, 5, 7, 9, 10 and 11
 
clue n.3 (danger 2) is responsable for perimeter tile 5, 6, 8, 10, 11 and 12
 
 
Now you have a list of perimeter tiles (unknowns) and a list of clue tiles (the B vector in the augmented matrix):
Line 89 ⟶ 93:
 
First of all, this algorithm returns bomb tiles tagged as -1 and safe tiles tagged as 0, but I don't know what to make of the +1s in the solution. What do those represent?
 
Secondly, a bomb is 100% correct if (and only if), on the solution matrix, the rest of the corresponding tile's column has ONLY 0s, which is not the case for any tile, in this example.
Same for the safe tiles: a tile is 100% safe is the rest of the column contains ONLY 0s. (in this example no perimeter's tile is 100% safe).
 
This means that, as to be expected, there is no 100% safe solution for this situation, not even a partial one.
[https://ibb.co/S5N1bvf (image 5)]
Line 120 ⟶ 126:
I hope it made some sense.
 
As sayed, I won't keep bothering you guys any further with this frivolous dilemma. I just wanted to clarify that I'm pretty sure THERE INIS a solution...
out there...
somewhere... :)
 
--[[User:Plinio|Plinio]] ([[User talk:Plinio|talk]]) 07:33, 27 February 2022 (UTC)
 
: Oh, don't worry at all about disturbing people, there's well over 5,000 talk pages on this site and most of us only pay attention to a tiny fraction of them. Anyway, here's a quick little ditty I knocked up to show a possible alternative approach, probably much saner and certainly exponentially easier to tweak and adjust.
<pre>
constant msprob = {{1,{},{1,2,3,4,5,7}},
{3,{4,5,7},{9,10,11}},
{2,{5,10,11},{6,8,12}}}
sequence field = repeat(0,12)
 
procedure solve(integer tdx=1)
if tdx>length(msprob) then
?{field,find_all(1,field,true)}
else
{integer tgt, sequence fixed, sequence play} = msprob[tdx]
tgt -= sum(extract(field,fixed))
if tgt<0 or tgt>length(play) then return end if
field = reinstate(field,play,repeat(0,length(play)-tgt)&repeat(1,tgt))
bool found = true
while found do
solve(tdx+1)
found = false
integer nxt = play[$]
for idx=length(play)-1 to 1 by -1 do
integer prv = play[idx]
if field[prv]=0 and field[nxt]!=0 then
field[prv] = 1
field[nxt] = 0
found = true
sequence slamright = play[idx+2..$]
field = reinstate(field,slamright,sort(extract(field,slamright)))
exit
end if
nxt = prv
end for
end while
end if
end procedure
solve()
</pre>
output
<pre>
{{0,0,0,0,0,0,1,0,0,1,1,0},{7,10,11}}
{{0,0,0,0,0,0,1,0,1,0,1,1},{7,9,11,12}}
{{0,0,0,0,0,0,1,1,1,0,1,0},{7,8,9,11}}
{{0,0,0,0,0,1,1,0,1,0,1,0},{6,7,9,11}}
{{0,0,0,0,0,0,1,0,1,1,0,1},{7,9,10,12}}
{{0,0,0,0,0,0,1,1,1,1,0,0},{7,8,9,10}}
{{0,0,0,0,0,1,1,0,1,1,0,0},{6,7,9,10}}
{{0,0,0,0,1,0,0,0,1,0,1,0},{5,9,11}}
{{0,0,0,0,1,0,0,0,1,1,0,0},{5,9,10}}
{{0,0,0,1,0,0,0,0,0,1,1,0},{4,10,11}}
{{0,0,0,1,0,0,0,0,1,0,1,1},{4,9,11,12}}
{{0,0,0,1,0,0,0,1,1,0,1,0},{4,8,9,11}}
{{0,0,0,1,0,1,0,0,1,0,1,0},{4,6,9,11}}
{{0,0,0,1,0,0,0,0,1,1,0,1},{4,9,10,12}}
{{0,0,0,1,0,0,0,1,1,1,0,0},{4,8,9,10}}
{{0,0,0,1,0,1,0,0,1,1,0,0},{4,6,9,10}}
{{0,0,1,0,0,0,0,0,1,1,1,0},{3,9,10,11}}
{{0,1,0,0,0,0,0,0,1,1,1,0},{2,9,10,11}}
{{1,0,0,0,0,0,0,0,1,1,1,0},{1,9,10,11}}
</pre>
:I don't think that misses any, but I could be wrong. Enjoy. --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 12:12, 27 February 2022 (UTC)
:PS There are of course many points in the game of minesweeper where you are forced to make a guess, the start screen being one, and this example being another.<br> The results suggest 9 is the most likely to be a mine and any of {1,2,3} your best gambol. --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 12:45, 27 February 2022 (UTC)
7,796

edits