How many possible starting positions are uniquely solvable for a nonogram puzzle?Alphametic (Verbal Arithmetic) general strategyHow many digits can be removed from a multiplication puzzle and still give only one answer?Is there a algorithm to decide that the nonogram puzzle is uniqueSum, Product and DifferenceA man possesses a large quantity of stampsPheno Menon's number challengeCan you solve the 7x7 (sudoku-ish) centered sums puzzleIs solving a puzzle using uniqueness invalid?A Guide to the Number Rotation PuzzleSolve the pattern! (game)
Leveraging cash for buying car
How many possible starting positions are uniquely solvable for a nonogram puzzle?
Someone who is granted access to information but not expected to read it
What does the output current rating from an H-Bridge's datasheet really mean?
My parents claim they cannot pay for my college education; what are my options?
What should I be aware of in buying second-hand sinks and toilets?
How many times to repeat an event with known probability before it has occurred a number of times
How can this shape perfectly cover a cube?
The title "Mord mit Aussicht" explained
Is fission/fusion to iron the most efficient way to convert mass to energy?
Can I appeal credit ding if ex-wife is responsible for paying mortgage?
Does an African-American baby born in Youngstown, Ohio have a higher infant mortality rate than a baby born in Iran?
Can an escape pod land on Earth from orbit and not be immediately detected?
Co-worker is now managing my team. Does this mean that I'm being demoted?
How to know whether to write accidentals as sharps or flats?
Boss making me feel guilty for leaving the company at the end of my internship
How to test soql with For Update statement
What is the color associated with lukewarm?
Does WiFi affect the quality of images downloaded from the internet?
How long would it take for sucrose to undergo hydrolysis in boiling water?
SQL Server has encountered occurences of I/O requests taking longer than 15 seconds
Digital signature that is only verifiable by one specific person
Is it a good security practice to force employees hide their employer to avoid being targeted?
Cant bend fingertip when finger is straight
How many possible starting positions are uniquely solvable for a nonogram puzzle?
Alphametic (Verbal Arithmetic) general strategyHow many digits can be removed from a multiplication puzzle and still give only one answer?Is there a algorithm to decide that the nonogram puzzle is uniqueSum, Product and DifferenceA man possesses a large quantity of stampsPheno Menon's number challengeCan you solve the 7x7 (sudoku-ish) centered sums puzzleIs solving a puzzle using uniqueness invalid?A Guide to the Number Rotation PuzzleSolve the pattern! (game)
$begingroup$
This type of puzzle goes by many names: Nonogram, Picross, and Griddlers are all mentioned on the Wikipedia page, Simon Tatham calls it Pattern, I was introduced to it as Descartes Rainbow, ...
The puzzle starts with a given arrangement of numbers around a grid. Let's assume it's a square, $ntimes n$ grid, and that the pattern is a simple black and white one, no colours. Every possible pattern of black cells in the $ntimes n$ grid gives some arrangement of numbers, but there are some different patterns which give the same arrangement of numbers. A good puzzle starts with an arrangement of numbers which has one unique solution. But if I choose a random (solvable) starting problem, what's the probability that it will have a unique solution?
Among all possible starting positions, how many have a unique solution?
Important note: I don't know the answer to this question. I don't even know if anyone knows: it could be an open mathematical problem. I'm also not expecting it to be an easy thing to answer off the cuff: it's more likely to be something found in a mathematical paper or so. But we have a good subcommunity of maths puzzle gurus here, and maybe someone will be better able to find the answer than I.
mathematics combinatorics solvability nonogram
$endgroup$
add a comment |
$begingroup$
This type of puzzle goes by many names: Nonogram, Picross, and Griddlers are all mentioned on the Wikipedia page, Simon Tatham calls it Pattern, I was introduced to it as Descartes Rainbow, ...
The puzzle starts with a given arrangement of numbers around a grid. Let's assume it's a square, $ntimes n$ grid, and that the pattern is a simple black and white one, no colours. Every possible pattern of black cells in the $ntimes n$ grid gives some arrangement of numbers, but there are some different patterns which give the same arrangement of numbers. A good puzzle starts with an arrangement of numbers which has one unique solution. But if I choose a random (solvable) starting problem, what's the probability that it will have a unique solution?
Among all possible starting positions, how many have a unique solution?
Important note: I don't know the answer to this question. I don't even know if anyone knows: it could be an open mathematical problem. I'm also not expecting it to be an easy thing to answer off the cuff: it's more likely to be something found in a mathematical paper or so. But we have a good subcommunity of maths puzzle gurus here, and maybe someone will be better able to find the answer than I.
mathematics combinatorics solvability nonogram
$endgroup$
$begingroup$
Just to check I understand: you're looking at numbers-around-the-outside that correspond to some configuration within the grid, and asking what fraction of those correspond to exactly one configuration? I wonder whether the following related question might be more approachable: consider all within-the-grid configurations; what fraction of those have around-the-grid numbers that correspond to just one within-the-grid configuration? (Probably both are very tough, though.)
$endgroup$
– Gareth McCaughan♦
11 hours ago
$begingroup$
@Gareth Yes, but both problems are interesting, and potentially mutually entangled (a solution to one, or its proof, might quickly yield a solution to the other). I'd consider an answer to the second question at least a partial answer to this one.
$endgroup$
– Rand al'Thor
11 hours ago
$begingroup$
I don't even have a confident guess at whether either Rand's fraction or mine (1) -> 0 as n->oo, (2) -> 1 as n->oo, (3) -> something else as n->oo, (4) doesn't converge but is bounded away from 0 and 1, or (5) doesn't converge and is sometimes close to 0 or 1 for large n. I'd guess either 1 or 3.
$endgroup$
– Gareth McCaughan♦
11 hours ago
1
$begingroup$
This is a very great question, I hope there would be progress on this. (And if your colleague does find a solution, please update us here, too!)
$endgroup$
– justhalf
11 hours ago
add a comment |
$begingroup$
This type of puzzle goes by many names: Nonogram, Picross, and Griddlers are all mentioned on the Wikipedia page, Simon Tatham calls it Pattern, I was introduced to it as Descartes Rainbow, ...
The puzzle starts with a given arrangement of numbers around a grid. Let's assume it's a square, $ntimes n$ grid, and that the pattern is a simple black and white one, no colours. Every possible pattern of black cells in the $ntimes n$ grid gives some arrangement of numbers, but there are some different patterns which give the same arrangement of numbers. A good puzzle starts with an arrangement of numbers which has one unique solution. But if I choose a random (solvable) starting problem, what's the probability that it will have a unique solution?
Among all possible starting positions, how many have a unique solution?
Important note: I don't know the answer to this question. I don't even know if anyone knows: it could be an open mathematical problem. I'm also not expecting it to be an easy thing to answer off the cuff: it's more likely to be something found in a mathematical paper or so. But we have a good subcommunity of maths puzzle gurus here, and maybe someone will be better able to find the answer than I.
mathematics combinatorics solvability nonogram
$endgroup$
This type of puzzle goes by many names: Nonogram, Picross, and Griddlers are all mentioned on the Wikipedia page, Simon Tatham calls it Pattern, I was introduced to it as Descartes Rainbow, ...
The puzzle starts with a given arrangement of numbers around a grid. Let's assume it's a square, $ntimes n$ grid, and that the pattern is a simple black and white one, no colours. Every possible pattern of black cells in the $ntimes n$ grid gives some arrangement of numbers, but there are some different patterns which give the same arrangement of numbers. A good puzzle starts with an arrangement of numbers which has one unique solution. But if I choose a random (solvable) starting problem, what's the probability that it will have a unique solution?
Among all possible starting positions, how many have a unique solution?
Important note: I don't know the answer to this question. I don't even know if anyone knows: it could be an open mathematical problem. I'm also not expecting it to be an easy thing to answer off the cuff: it's more likely to be something found in a mathematical paper or so. But we have a good subcommunity of maths puzzle gurus here, and maybe someone will be better able to find the answer than I.
mathematics combinatorics solvability nonogram
mathematics combinatorics solvability nonogram
asked 12 hours ago
Rand al'ThorRand al'Thor
73.4k15240485
73.4k15240485
$begingroup$
Just to check I understand: you're looking at numbers-around-the-outside that correspond to some configuration within the grid, and asking what fraction of those correspond to exactly one configuration? I wonder whether the following related question might be more approachable: consider all within-the-grid configurations; what fraction of those have around-the-grid numbers that correspond to just one within-the-grid configuration? (Probably both are very tough, though.)
$endgroup$
– Gareth McCaughan♦
11 hours ago
$begingroup$
@Gareth Yes, but both problems are interesting, and potentially mutually entangled (a solution to one, or its proof, might quickly yield a solution to the other). I'd consider an answer to the second question at least a partial answer to this one.
$endgroup$
– Rand al'Thor
11 hours ago
$begingroup$
I don't even have a confident guess at whether either Rand's fraction or mine (1) -> 0 as n->oo, (2) -> 1 as n->oo, (3) -> something else as n->oo, (4) doesn't converge but is bounded away from 0 and 1, or (5) doesn't converge and is sometimes close to 0 or 1 for large n. I'd guess either 1 or 3.
$endgroup$
– Gareth McCaughan♦
11 hours ago
1
$begingroup$
This is a very great question, I hope there would be progress on this. (And if your colleague does find a solution, please update us here, too!)
$endgroup$
– justhalf
11 hours ago
add a comment |
$begingroup$
Just to check I understand: you're looking at numbers-around-the-outside that correspond to some configuration within the grid, and asking what fraction of those correspond to exactly one configuration? I wonder whether the following related question might be more approachable: consider all within-the-grid configurations; what fraction of those have around-the-grid numbers that correspond to just one within-the-grid configuration? (Probably both are very tough, though.)
$endgroup$
– Gareth McCaughan♦
11 hours ago
$begingroup$
@Gareth Yes, but both problems are interesting, and potentially mutually entangled (a solution to one, or its proof, might quickly yield a solution to the other). I'd consider an answer to the second question at least a partial answer to this one.
$endgroup$
– Rand al'Thor
11 hours ago
$begingroup$
I don't even have a confident guess at whether either Rand's fraction or mine (1) -> 0 as n->oo, (2) -> 1 as n->oo, (3) -> something else as n->oo, (4) doesn't converge but is bounded away from 0 and 1, or (5) doesn't converge and is sometimes close to 0 or 1 for large n. I'd guess either 1 or 3.
$endgroup$
– Gareth McCaughan♦
11 hours ago
1
$begingroup$
This is a very great question, I hope there would be progress on this. (And if your colleague does find a solution, please update us here, too!)
$endgroup$
– justhalf
11 hours ago
$begingroup$
Just to check I understand: you're looking at numbers-around-the-outside that correspond to some configuration within the grid, and asking what fraction of those correspond to exactly one configuration? I wonder whether the following related question might be more approachable: consider all within-the-grid configurations; what fraction of those have around-the-grid numbers that correspond to just one within-the-grid configuration? (Probably both are very tough, though.)
$endgroup$
– Gareth McCaughan♦
11 hours ago
$begingroup$
Just to check I understand: you're looking at numbers-around-the-outside that correspond to some configuration within the grid, and asking what fraction of those correspond to exactly one configuration? I wonder whether the following related question might be more approachable: consider all within-the-grid configurations; what fraction of those have around-the-grid numbers that correspond to just one within-the-grid configuration? (Probably both are very tough, though.)
$endgroup$
– Gareth McCaughan♦
11 hours ago
$begingroup$
@Gareth Yes, but both problems are interesting, and potentially mutually entangled (a solution to one, or its proof, might quickly yield a solution to the other). I'd consider an answer to the second question at least a partial answer to this one.
$endgroup$
– Rand al'Thor
11 hours ago
$begingroup$
@Gareth Yes, but both problems are interesting, and potentially mutually entangled (a solution to one, or its proof, might quickly yield a solution to the other). I'd consider an answer to the second question at least a partial answer to this one.
$endgroup$
– Rand al'Thor
11 hours ago
$begingroup$
I don't even have a confident guess at whether either Rand's fraction or mine (1) -> 0 as n->oo, (2) -> 1 as n->oo, (3) -> something else as n->oo, (4) doesn't converge but is bounded away from 0 and 1, or (5) doesn't converge and is sometimes close to 0 or 1 for large n. I'd guess either 1 or 3.
$endgroup$
– Gareth McCaughan♦
11 hours ago
$begingroup$
I don't even have a confident guess at whether either Rand's fraction or mine (1) -> 0 as n->oo, (2) -> 1 as n->oo, (3) -> something else as n->oo, (4) doesn't converge but is bounded away from 0 and 1, or (5) doesn't converge and is sometimes close to 0 or 1 for large n. I'd guess either 1 or 3.
$endgroup$
– Gareth McCaughan♦
11 hours ago
1
1
$begingroup$
This is a very great question, I hope there would be progress on this. (And if your colleague does find a solution, please update us here, too!)
$endgroup$
– justhalf
11 hours ago
$begingroup$
This is a very great question, I hope there would be progress on this. (And if your colleague does find a solution, please update us here, too!)
$endgroup$
– justhalf
11 hours ago
add a comment |
3 Answers
3
active
oldest
votes
$begingroup$
Absurdly partial answer
Terminology: an "inner configuration" is an arrangement of filled and empty cells in our $ntimes n$ grid; an "outer configuration" is the corresponding arrangement of run-lengths displayed outside the grid. Let $I_n=2^n^2$ be the number of possible inner configurations, $O_n$ be the number of distinct outer configurations arising from these, and $U_n$ be the number of these corresponding to a unique inner configuration. The question asks for $p_n:=U_n/O_n$; I suspect $q_n:=U_n/I_n$ may be less impossible to find, though probably both are hard. Obviously $O_nleq I_n$ and so $q_nleq p_n$.
For $n=0$: obviously $I_0=O_0=U_0=1$ so $p_0=q_0=1$.
For $n=1$: there are just two inner configurations, and each corresponds to a different outer configuration. So $I_1=O_1=U_1=2$ and $p_1=q_1=1$.
For $n=2$: there are two "bad" configurations, the ones with two diagonally-opposite empty cells. All other configurations either have an asymmetry making them easily solvable, or have all cells in the same state which is also easy. So $I_2=16,O_2=15,U_2=14$ and therefore $p_1=frac1415,q_1=frac78$.
The sequence of $U_n$ is A242876 in OEIS. Not very many terms are computed there, which suggests (at least) that others agree with my feeling that this is a hard problem.
$endgroup$
$begingroup$
The way I read the question, it seems to be asking for $U_n$ instead of $p_n$. (And did you mean $O_n leq I_n$ instead of $U_n leq I_n$?)
$endgroup$
– justhalf
11 hours ago
$begingroup$
And thanks for posting the OEIS number. Seems like a hard problem indeed.
$endgroup$
– justhalf
11 hours ago
1
$begingroup$
@justhalf It asks for both $U_n$ ("how many have ...") and $p_n$ ("what's the probability ..."). But you're right that I meant O not U when comparing the fractions; I'll fix that. [EDITED to add:] Done now.
$endgroup$
– Gareth McCaughan♦
10 hours ago
$begingroup$
Is there OEIS for $O_n$? Maybe that is easier.
$endgroup$
– justhalf
10 hours ago
add a comment |
$begingroup$
I doubt it could be calculated exactly except for very small grids, but it should be possible to Monte Carlo it.
One has to be careful about bias. I don't think there is any way to choose the numbers directly such that all solvable number patterns are equally likely.
Instead you could choose a random grid picture such that every picture is equally likely (i.e. each cell 50% probability of black). Take the corresponding number pattern, and see how many solutions it has by running it through a solver. Of course this selection method will be biased towards number patterns with multiple solutions, so to compensate you can give this a weight of $1/k$, where $k$ is the number of solutions.
Then you just generate lots of random bit grid patterns. Let $t$ be the total weight of all the patterns produced, and $u$ the total weight of the uniquely solvable patterns encountered. Then $u/t$ should approach the probability you are looking for if you go on long enough.
$endgroup$
1
$begingroup$
"I doubt it could be calculated exactly except for very small grids" - why? This seems like exactly the type of problem that could potentially be approached using mathematical techniques of combinatorics. (If an answer doesn't exist in the literature and nobody on PSE can find it, I will literally ask a colleague mathematician who may be able to solve it and publish the result.)
$endgroup$
– Rand al'Thor
11 hours ago
1
$begingroup$
It feels hard to me too. The unique-solution constraint is a complicated one. Compare with the problem of enumerating partitions, which seems kinda related but much much easier; there's an explicit formula for that but it took Hardy and Ramanujan to find it. (In fact they didn't quite find the explicit formula; Rademacher found that by improving on their work.)
$endgroup$
– Gareth McCaughan♦
11 hours ago
add a comment |
$begingroup$
Answer in construction
From an algorithm point of view, the ways you can attempt to crack the problem are either too strenuous for decent results in an amount of time or redundant in comparison to a decent mathematician... so I don't expect anything useful to be yielded from using a computer algorithm.
That said, I have a simple starting point that may or may not be useful in the long run
Lets consider that a Nonagram can be represented as bits where $1=coloured$ etc. Nonagrams contain numbers outside the grid (lets casually call this $A_x$, where $A_x$ is an array of $S$ length) which validly represent the bits in the respective row or column. It is possible to determine if a Nonagram is unique by finding if there are other solutions that have the exact same $A_x$. Obviously, it is difficult to do this mathematically, lets break the problem down and see if it gets us anywhere I intend for my answer to help others reach a final, accepted answer (if that even exists). I probably won't be able to continue past a certain level of maths
Lets start by just thinking of a single trail of bits (called $B_i$). This trail is of length $N$ and can be represented by $A_x$. How many combinations of $B_i$ share $A_x$? It is easy to see that for $A_x$ with $S = 1$ there are $N-A_1+1$ of $B_i$. For $S>1$ it gets complicated since there can be a variable number of $0$ bits padding between $1$ clusters. What is certain is that there is always at least one $0$ bit between clusters. Consider a strategy where the padding can be distributed in many combinations. Let $T = sumlimits_r=1^SA_r$ and $D=N-T$. The difference $D$ represents the total padding between clusters, it can be distributed for the $S+1$ paddings in between clusters in different ways. There are $S-1$ paddings that must be a size of at least one. This leaves $D-S+1$ to be distributed between all $S+1$ padding. The formula for this would then be $D+1 choose S$
So $A_x$ has $N+1-sumlimits_r=1^SA_r choose S$ corresponding $B_i$ of length $N$.
This also implies that $N+1-sumlimits_r=1^SA_r=S$ when there is only one unique $B_i$. This tells us that ALL valid nonograms, where all of the rows and columns satisfy this rule, have a unique solution!
$endgroup$
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "559"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fpuzzling.stackexchange.com%2fquestions%2f85031%2fhow-many-possible-starting-positions-are-uniquely-solvable-for-a-nonogram-puzzle%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Absurdly partial answer
Terminology: an "inner configuration" is an arrangement of filled and empty cells in our $ntimes n$ grid; an "outer configuration" is the corresponding arrangement of run-lengths displayed outside the grid. Let $I_n=2^n^2$ be the number of possible inner configurations, $O_n$ be the number of distinct outer configurations arising from these, and $U_n$ be the number of these corresponding to a unique inner configuration. The question asks for $p_n:=U_n/O_n$; I suspect $q_n:=U_n/I_n$ may be less impossible to find, though probably both are hard. Obviously $O_nleq I_n$ and so $q_nleq p_n$.
For $n=0$: obviously $I_0=O_0=U_0=1$ so $p_0=q_0=1$.
For $n=1$: there are just two inner configurations, and each corresponds to a different outer configuration. So $I_1=O_1=U_1=2$ and $p_1=q_1=1$.
For $n=2$: there are two "bad" configurations, the ones with two diagonally-opposite empty cells. All other configurations either have an asymmetry making them easily solvable, or have all cells in the same state which is also easy. So $I_2=16,O_2=15,U_2=14$ and therefore $p_1=frac1415,q_1=frac78$.
The sequence of $U_n$ is A242876 in OEIS. Not very many terms are computed there, which suggests (at least) that others agree with my feeling that this is a hard problem.
$endgroup$
$begingroup$
The way I read the question, it seems to be asking for $U_n$ instead of $p_n$. (And did you mean $O_n leq I_n$ instead of $U_n leq I_n$?)
$endgroup$
– justhalf
11 hours ago
$begingroup$
And thanks for posting the OEIS number. Seems like a hard problem indeed.
$endgroup$
– justhalf
11 hours ago
1
$begingroup$
@justhalf It asks for both $U_n$ ("how many have ...") and $p_n$ ("what's the probability ..."). But you're right that I meant O not U when comparing the fractions; I'll fix that. [EDITED to add:] Done now.
$endgroup$
– Gareth McCaughan♦
10 hours ago
$begingroup$
Is there OEIS for $O_n$? Maybe that is easier.
$endgroup$
– justhalf
10 hours ago
add a comment |
$begingroup$
Absurdly partial answer
Terminology: an "inner configuration" is an arrangement of filled and empty cells in our $ntimes n$ grid; an "outer configuration" is the corresponding arrangement of run-lengths displayed outside the grid. Let $I_n=2^n^2$ be the number of possible inner configurations, $O_n$ be the number of distinct outer configurations arising from these, and $U_n$ be the number of these corresponding to a unique inner configuration. The question asks for $p_n:=U_n/O_n$; I suspect $q_n:=U_n/I_n$ may be less impossible to find, though probably both are hard. Obviously $O_nleq I_n$ and so $q_nleq p_n$.
For $n=0$: obviously $I_0=O_0=U_0=1$ so $p_0=q_0=1$.
For $n=1$: there are just two inner configurations, and each corresponds to a different outer configuration. So $I_1=O_1=U_1=2$ and $p_1=q_1=1$.
For $n=2$: there are two "bad" configurations, the ones with two diagonally-opposite empty cells. All other configurations either have an asymmetry making them easily solvable, or have all cells in the same state which is also easy. So $I_2=16,O_2=15,U_2=14$ and therefore $p_1=frac1415,q_1=frac78$.
The sequence of $U_n$ is A242876 in OEIS. Not very many terms are computed there, which suggests (at least) that others agree with my feeling that this is a hard problem.
$endgroup$
$begingroup$
The way I read the question, it seems to be asking for $U_n$ instead of $p_n$. (And did you mean $O_n leq I_n$ instead of $U_n leq I_n$?)
$endgroup$
– justhalf
11 hours ago
$begingroup$
And thanks for posting the OEIS number. Seems like a hard problem indeed.
$endgroup$
– justhalf
11 hours ago
1
$begingroup$
@justhalf It asks for both $U_n$ ("how many have ...") and $p_n$ ("what's the probability ..."). But you're right that I meant O not U when comparing the fractions; I'll fix that. [EDITED to add:] Done now.
$endgroup$
– Gareth McCaughan♦
10 hours ago
$begingroup$
Is there OEIS for $O_n$? Maybe that is easier.
$endgroup$
– justhalf
10 hours ago
add a comment |
$begingroup$
Absurdly partial answer
Terminology: an "inner configuration" is an arrangement of filled and empty cells in our $ntimes n$ grid; an "outer configuration" is the corresponding arrangement of run-lengths displayed outside the grid. Let $I_n=2^n^2$ be the number of possible inner configurations, $O_n$ be the number of distinct outer configurations arising from these, and $U_n$ be the number of these corresponding to a unique inner configuration. The question asks for $p_n:=U_n/O_n$; I suspect $q_n:=U_n/I_n$ may be less impossible to find, though probably both are hard. Obviously $O_nleq I_n$ and so $q_nleq p_n$.
For $n=0$: obviously $I_0=O_0=U_0=1$ so $p_0=q_0=1$.
For $n=1$: there are just two inner configurations, and each corresponds to a different outer configuration. So $I_1=O_1=U_1=2$ and $p_1=q_1=1$.
For $n=2$: there are two "bad" configurations, the ones with two diagonally-opposite empty cells. All other configurations either have an asymmetry making them easily solvable, or have all cells in the same state which is also easy. So $I_2=16,O_2=15,U_2=14$ and therefore $p_1=frac1415,q_1=frac78$.
The sequence of $U_n$ is A242876 in OEIS. Not very many terms are computed there, which suggests (at least) that others agree with my feeling that this is a hard problem.
$endgroup$
Absurdly partial answer
Terminology: an "inner configuration" is an arrangement of filled and empty cells in our $ntimes n$ grid; an "outer configuration" is the corresponding arrangement of run-lengths displayed outside the grid. Let $I_n=2^n^2$ be the number of possible inner configurations, $O_n$ be the number of distinct outer configurations arising from these, and $U_n$ be the number of these corresponding to a unique inner configuration. The question asks for $p_n:=U_n/O_n$; I suspect $q_n:=U_n/I_n$ may be less impossible to find, though probably both are hard. Obviously $O_nleq I_n$ and so $q_nleq p_n$.
For $n=0$: obviously $I_0=O_0=U_0=1$ so $p_0=q_0=1$.
For $n=1$: there are just two inner configurations, and each corresponds to a different outer configuration. So $I_1=O_1=U_1=2$ and $p_1=q_1=1$.
For $n=2$: there are two "bad" configurations, the ones with two diagonally-opposite empty cells. All other configurations either have an asymmetry making them easily solvable, or have all cells in the same state which is also easy. So $I_2=16,O_2=15,U_2=14$ and therefore $p_1=frac1415,q_1=frac78$.
The sequence of $U_n$ is A242876 in OEIS. Not very many terms are computed there, which suggests (at least) that others agree with my feeling that this is a hard problem.
edited 10 hours ago
answered 11 hours ago
Gareth McCaughan♦Gareth McCaughan
74.3k3186286
74.3k3186286
$begingroup$
The way I read the question, it seems to be asking for $U_n$ instead of $p_n$. (And did you mean $O_n leq I_n$ instead of $U_n leq I_n$?)
$endgroup$
– justhalf
11 hours ago
$begingroup$
And thanks for posting the OEIS number. Seems like a hard problem indeed.
$endgroup$
– justhalf
11 hours ago
1
$begingroup$
@justhalf It asks for both $U_n$ ("how many have ...") and $p_n$ ("what's the probability ..."). But you're right that I meant O not U when comparing the fractions; I'll fix that. [EDITED to add:] Done now.
$endgroup$
– Gareth McCaughan♦
10 hours ago
$begingroup$
Is there OEIS for $O_n$? Maybe that is easier.
$endgroup$
– justhalf
10 hours ago
add a comment |
$begingroup$
The way I read the question, it seems to be asking for $U_n$ instead of $p_n$. (And did you mean $O_n leq I_n$ instead of $U_n leq I_n$?)
$endgroup$
– justhalf
11 hours ago
$begingroup$
And thanks for posting the OEIS number. Seems like a hard problem indeed.
$endgroup$
– justhalf
11 hours ago
1
$begingroup$
@justhalf It asks for both $U_n$ ("how many have ...") and $p_n$ ("what's the probability ..."). But you're right that I meant O not U when comparing the fractions; I'll fix that. [EDITED to add:] Done now.
$endgroup$
– Gareth McCaughan♦
10 hours ago
$begingroup$
Is there OEIS for $O_n$? Maybe that is easier.
$endgroup$
– justhalf
10 hours ago
$begingroup$
The way I read the question, it seems to be asking for $U_n$ instead of $p_n$. (And did you mean $O_n leq I_n$ instead of $U_n leq I_n$?)
$endgroup$
– justhalf
11 hours ago
$begingroup$
The way I read the question, it seems to be asking for $U_n$ instead of $p_n$. (And did you mean $O_n leq I_n$ instead of $U_n leq I_n$?)
$endgroup$
– justhalf
11 hours ago
$begingroup$
And thanks for posting the OEIS number. Seems like a hard problem indeed.
$endgroup$
– justhalf
11 hours ago
$begingroup$
And thanks for posting the OEIS number. Seems like a hard problem indeed.
$endgroup$
– justhalf
11 hours ago
1
1
$begingroup$
@justhalf It asks for both $U_n$ ("how many have ...") and $p_n$ ("what's the probability ..."). But you're right that I meant O not U when comparing the fractions; I'll fix that. [EDITED to add:] Done now.
$endgroup$
– Gareth McCaughan♦
10 hours ago
$begingroup$
@justhalf It asks for both $U_n$ ("how many have ...") and $p_n$ ("what's the probability ..."). But you're right that I meant O not U when comparing the fractions; I'll fix that. [EDITED to add:] Done now.
$endgroup$
– Gareth McCaughan♦
10 hours ago
$begingroup$
Is there OEIS for $O_n$? Maybe that is easier.
$endgroup$
– justhalf
10 hours ago
$begingroup$
Is there OEIS for $O_n$? Maybe that is easier.
$endgroup$
– justhalf
10 hours ago
add a comment |
$begingroup$
I doubt it could be calculated exactly except for very small grids, but it should be possible to Monte Carlo it.
One has to be careful about bias. I don't think there is any way to choose the numbers directly such that all solvable number patterns are equally likely.
Instead you could choose a random grid picture such that every picture is equally likely (i.e. each cell 50% probability of black). Take the corresponding number pattern, and see how many solutions it has by running it through a solver. Of course this selection method will be biased towards number patterns with multiple solutions, so to compensate you can give this a weight of $1/k$, where $k$ is the number of solutions.
Then you just generate lots of random bit grid patterns. Let $t$ be the total weight of all the patterns produced, and $u$ the total weight of the uniquely solvable patterns encountered. Then $u/t$ should approach the probability you are looking for if you go on long enough.
$endgroup$
1
$begingroup$
"I doubt it could be calculated exactly except for very small grids" - why? This seems like exactly the type of problem that could potentially be approached using mathematical techniques of combinatorics. (If an answer doesn't exist in the literature and nobody on PSE can find it, I will literally ask a colleague mathematician who may be able to solve it and publish the result.)
$endgroup$
– Rand al'Thor
11 hours ago
1
$begingroup$
It feels hard to me too. The unique-solution constraint is a complicated one. Compare with the problem of enumerating partitions, which seems kinda related but much much easier; there's an explicit formula for that but it took Hardy and Ramanujan to find it. (In fact they didn't quite find the explicit formula; Rademacher found that by improving on their work.)
$endgroup$
– Gareth McCaughan♦
11 hours ago
add a comment |
$begingroup$
I doubt it could be calculated exactly except for very small grids, but it should be possible to Monte Carlo it.
One has to be careful about bias. I don't think there is any way to choose the numbers directly such that all solvable number patterns are equally likely.
Instead you could choose a random grid picture such that every picture is equally likely (i.e. each cell 50% probability of black). Take the corresponding number pattern, and see how many solutions it has by running it through a solver. Of course this selection method will be biased towards number patterns with multiple solutions, so to compensate you can give this a weight of $1/k$, where $k$ is the number of solutions.
Then you just generate lots of random bit grid patterns. Let $t$ be the total weight of all the patterns produced, and $u$ the total weight of the uniquely solvable patterns encountered. Then $u/t$ should approach the probability you are looking for if you go on long enough.
$endgroup$
1
$begingroup$
"I doubt it could be calculated exactly except for very small grids" - why? This seems like exactly the type of problem that could potentially be approached using mathematical techniques of combinatorics. (If an answer doesn't exist in the literature and nobody on PSE can find it, I will literally ask a colleague mathematician who may be able to solve it and publish the result.)
$endgroup$
– Rand al'Thor
11 hours ago
1
$begingroup$
It feels hard to me too. The unique-solution constraint is a complicated one. Compare with the problem of enumerating partitions, which seems kinda related but much much easier; there's an explicit formula for that but it took Hardy and Ramanujan to find it. (In fact they didn't quite find the explicit formula; Rademacher found that by improving on their work.)
$endgroup$
– Gareth McCaughan♦
11 hours ago
add a comment |
$begingroup$
I doubt it could be calculated exactly except for very small grids, but it should be possible to Monte Carlo it.
One has to be careful about bias. I don't think there is any way to choose the numbers directly such that all solvable number patterns are equally likely.
Instead you could choose a random grid picture such that every picture is equally likely (i.e. each cell 50% probability of black). Take the corresponding number pattern, and see how many solutions it has by running it through a solver. Of course this selection method will be biased towards number patterns with multiple solutions, so to compensate you can give this a weight of $1/k$, where $k$ is the number of solutions.
Then you just generate lots of random bit grid patterns. Let $t$ be the total weight of all the patterns produced, and $u$ the total weight of the uniquely solvable patterns encountered. Then $u/t$ should approach the probability you are looking for if you go on long enough.
$endgroup$
I doubt it could be calculated exactly except for very small grids, but it should be possible to Monte Carlo it.
One has to be careful about bias. I don't think there is any way to choose the numbers directly such that all solvable number patterns are equally likely.
Instead you could choose a random grid picture such that every picture is equally likely (i.e. each cell 50% probability of black). Take the corresponding number pattern, and see how many solutions it has by running it through a solver. Of course this selection method will be biased towards number patterns with multiple solutions, so to compensate you can give this a weight of $1/k$, where $k$ is the number of solutions.
Then you just generate lots of random bit grid patterns. Let $t$ be the total weight of all the patterns produced, and $u$ the total weight of the uniquely solvable patterns encountered. Then $u/t$ should approach the probability you are looking for if you go on long enough.
answered 11 hours ago
Jaap ScherphuisJaap Scherphuis
17.6k13176
17.6k13176
1
$begingroup$
"I doubt it could be calculated exactly except for very small grids" - why? This seems like exactly the type of problem that could potentially be approached using mathematical techniques of combinatorics. (If an answer doesn't exist in the literature and nobody on PSE can find it, I will literally ask a colleague mathematician who may be able to solve it and publish the result.)
$endgroup$
– Rand al'Thor
11 hours ago
1
$begingroup$
It feels hard to me too. The unique-solution constraint is a complicated one. Compare with the problem of enumerating partitions, which seems kinda related but much much easier; there's an explicit formula for that but it took Hardy and Ramanujan to find it. (In fact they didn't quite find the explicit formula; Rademacher found that by improving on their work.)
$endgroup$
– Gareth McCaughan♦
11 hours ago
add a comment |
1
$begingroup$
"I doubt it could be calculated exactly except for very small grids" - why? This seems like exactly the type of problem that could potentially be approached using mathematical techniques of combinatorics. (If an answer doesn't exist in the literature and nobody on PSE can find it, I will literally ask a colleague mathematician who may be able to solve it and publish the result.)
$endgroup$
– Rand al'Thor
11 hours ago
1
$begingroup$
It feels hard to me too. The unique-solution constraint is a complicated one. Compare with the problem of enumerating partitions, which seems kinda related but much much easier; there's an explicit formula for that but it took Hardy and Ramanujan to find it. (In fact they didn't quite find the explicit formula; Rademacher found that by improving on their work.)
$endgroup$
– Gareth McCaughan♦
11 hours ago
1
1
$begingroup$
"I doubt it could be calculated exactly except for very small grids" - why? This seems like exactly the type of problem that could potentially be approached using mathematical techniques of combinatorics. (If an answer doesn't exist in the literature and nobody on PSE can find it, I will literally ask a colleague mathematician who may be able to solve it and publish the result.)
$endgroup$
– Rand al'Thor
11 hours ago
$begingroup$
"I doubt it could be calculated exactly except for very small grids" - why? This seems like exactly the type of problem that could potentially be approached using mathematical techniques of combinatorics. (If an answer doesn't exist in the literature and nobody on PSE can find it, I will literally ask a colleague mathematician who may be able to solve it and publish the result.)
$endgroup$
– Rand al'Thor
11 hours ago
1
1
$begingroup$
It feels hard to me too. The unique-solution constraint is a complicated one. Compare with the problem of enumerating partitions, which seems kinda related but much much easier; there's an explicit formula for that but it took Hardy and Ramanujan to find it. (In fact they didn't quite find the explicit formula; Rademacher found that by improving on their work.)
$endgroup$
– Gareth McCaughan♦
11 hours ago
$begingroup$
It feels hard to me too. The unique-solution constraint is a complicated one. Compare with the problem of enumerating partitions, which seems kinda related but much much easier; there's an explicit formula for that but it took Hardy and Ramanujan to find it. (In fact they didn't quite find the explicit formula; Rademacher found that by improving on their work.)
$endgroup$
– Gareth McCaughan♦
11 hours ago
add a comment |
$begingroup$
Answer in construction
From an algorithm point of view, the ways you can attempt to crack the problem are either too strenuous for decent results in an amount of time or redundant in comparison to a decent mathematician... so I don't expect anything useful to be yielded from using a computer algorithm.
That said, I have a simple starting point that may or may not be useful in the long run
Lets consider that a Nonagram can be represented as bits where $1=coloured$ etc. Nonagrams contain numbers outside the grid (lets casually call this $A_x$, where $A_x$ is an array of $S$ length) which validly represent the bits in the respective row or column. It is possible to determine if a Nonagram is unique by finding if there are other solutions that have the exact same $A_x$. Obviously, it is difficult to do this mathematically, lets break the problem down and see if it gets us anywhere I intend for my answer to help others reach a final, accepted answer (if that even exists). I probably won't be able to continue past a certain level of maths
Lets start by just thinking of a single trail of bits (called $B_i$). This trail is of length $N$ and can be represented by $A_x$. How many combinations of $B_i$ share $A_x$? It is easy to see that for $A_x$ with $S = 1$ there are $N-A_1+1$ of $B_i$. For $S>1$ it gets complicated since there can be a variable number of $0$ bits padding between $1$ clusters. What is certain is that there is always at least one $0$ bit between clusters. Consider a strategy where the padding can be distributed in many combinations. Let $T = sumlimits_r=1^SA_r$ and $D=N-T$. The difference $D$ represents the total padding between clusters, it can be distributed for the $S+1$ paddings in between clusters in different ways. There are $S-1$ paddings that must be a size of at least one. This leaves $D-S+1$ to be distributed between all $S+1$ padding. The formula for this would then be $D+1 choose S$
So $A_x$ has $N+1-sumlimits_r=1^SA_r choose S$ corresponding $B_i$ of length $N$.
This also implies that $N+1-sumlimits_r=1^SA_r=S$ when there is only one unique $B_i$. This tells us that ALL valid nonograms, where all of the rows and columns satisfy this rule, have a unique solution!
$endgroup$
add a comment |
$begingroup$
Answer in construction
From an algorithm point of view, the ways you can attempt to crack the problem are either too strenuous for decent results in an amount of time or redundant in comparison to a decent mathematician... so I don't expect anything useful to be yielded from using a computer algorithm.
That said, I have a simple starting point that may or may not be useful in the long run
Lets consider that a Nonagram can be represented as bits where $1=coloured$ etc. Nonagrams contain numbers outside the grid (lets casually call this $A_x$, where $A_x$ is an array of $S$ length) which validly represent the bits in the respective row or column. It is possible to determine if a Nonagram is unique by finding if there are other solutions that have the exact same $A_x$. Obviously, it is difficult to do this mathematically, lets break the problem down and see if it gets us anywhere I intend for my answer to help others reach a final, accepted answer (if that even exists). I probably won't be able to continue past a certain level of maths
Lets start by just thinking of a single trail of bits (called $B_i$). This trail is of length $N$ and can be represented by $A_x$. How many combinations of $B_i$ share $A_x$? It is easy to see that for $A_x$ with $S = 1$ there are $N-A_1+1$ of $B_i$. For $S>1$ it gets complicated since there can be a variable number of $0$ bits padding between $1$ clusters. What is certain is that there is always at least one $0$ bit between clusters. Consider a strategy where the padding can be distributed in many combinations. Let $T = sumlimits_r=1^SA_r$ and $D=N-T$. The difference $D$ represents the total padding between clusters, it can be distributed for the $S+1$ paddings in between clusters in different ways. There are $S-1$ paddings that must be a size of at least one. This leaves $D-S+1$ to be distributed between all $S+1$ padding. The formula for this would then be $D+1 choose S$
So $A_x$ has $N+1-sumlimits_r=1^SA_r choose S$ corresponding $B_i$ of length $N$.
This also implies that $N+1-sumlimits_r=1^SA_r=S$ when there is only one unique $B_i$. This tells us that ALL valid nonograms, where all of the rows and columns satisfy this rule, have a unique solution!
$endgroup$
add a comment |
$begingroup$
Answer in construction
From an algorithm point of view, the ways you can attempt to crack the problem are either too strenuous for decent results in an amount of time or redundant in comparison to a decent mathematician... so I don't expect anything useful to be yielded from using a computer algorithm.
That said, I have a simple starting point that may or may not be useful in the long run
Lets consider that a Nonagram can be represented as bits where $1=coloured$ etc. Nonagrams contain numbers outside the grid (lets casually call this $A_x$, where $A_x$ is an array of $S$ length) which validly represent the bits in the respective row or column. It is possible to determine if a Nonagram is unique by finding if there are other solutions that have the exact same $A_x$. Obviously, it is difficult to do this mathematically, lets break the problem down and see if it gets us anywhere I intend for my answer to help others reach a final, accepted answer (if that even exists). I probably won't be able to continue past a certain level of maths
Lets start by just thinking of a single trail of bits (called $B_i$). This trail is of length $N$ and can be represented by $A_x$. How many combinations of $B_i$ share $A_x$? It is easy to see that for $A_x$ with $S = 1$ there are $N-A_1+1$ of $B_i$. For $S>1$ it gets complicated since there can be a variable number of $0$ bits padding between $1$ clusters. What is certain is that there is always at least one $0$ bit between clusters. Consider a strategy where the padding can be distributed in many combinations. Let $T = sumlimits_r=1^SA_r$ and $D=N-T$. The difference $D$ represents the total padding between clusters, it can be distributed for the $S+1$ paddings in between clusters in different ways. There are $S-1$ paddings that must be a size of at least one. This leaves $D-S+1$ to be distributed between all $S+1$ padding. The formula for this would then be $D+1 choose S$
So $A_x$ has $N+1-sumlimits_r=1^SA_r choose S$ corresponding $B_i$ of length $N$.
This also implies that $N+1-sumlimits_r=1^SA_r=S$ when there is only one unique $B_i$. This tells us that ALL valid nonograms, where all of the rows and columns satisfy this rule, have a unique solution!
$endgroup$
Answer in construction
From an algorithm point of view, the ways you can attempt to crack the problem are either too strenuous for decent results in an amount of time or redundant in comparison to a decent mathematician... so I don't expect anything useful to be yielded from using a computer algorithm.
That said, I have a simple starting point that may or may not be useful in the long run
Lets consider that a Nonagram can be represented as bits where $1=coloured$ etc. Nonagrams contain numbers outside the grid (lets casually call this $A_x$, where $A_x$ is an array of $S$ length) which validly represent the bits in the respective row or column. It is possible to determine if a Nonagram is unique by finding if there are other solutions that have the exact same $A_x$. Obviously, it is difficult to do this mathematically, lets break the problem down and see if it gets us anywhere I intend for my answer to help others reach a final, accepted answer (if that even exists). I probably won't be able to continue past a certain level of maths
Lets start by just thinking of a single trail of bits (called $B_i$). This trail is of length $N$ and can be represented by $A_x$. How many combinations of $B_i$ share $A_x$? It is easy to see that for $A_x$ with $S = 1$ there are $N-A_1+1$ of $B_i$. For $S>1$ it gets complicated since there can be a variable number of $0$ bits padding between $1$ clusters. What is certain is that there is always at least one $0$ bit between clusters. Consider a strategy where the padding can be distributed in many combinations. Let $T = sumlimits_r=1^SA_r$ and $D=N-T$. The difference $D$ represents the total padding between clusters, it can be distributed for the $S+1$ paddings in between clusters in different ways. There are $S-1$ paddings that must be a size of at least one. This leaves $D-S+1$ to be distributed between all $S+1$ padding. The formula for this would then be $D+1 choose S$
So $A_x$ has $N+1-sumlimits_r=1^SA_r choose S$ corresponding $B_i$ of length $N$.
This also implies that $N+1-sumlimits_r=1^SA_r=S$ when there is only one unique $B_i$. This tells us that ALL valid nonograms, where all of the rows and columns satisfy this rule, have a unique solution!
edited 1 hour ago
answered 8 hours ago
AdamAdam
4461221
4461221
add a comment |
add a comment |
Thanks for contributing an answer to Puzzling Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fpuzzling.stackexchange.com%2fquestions%2f85031%2fhow-many-possible-starting-positions-are-uniquely-solvable-for-a-nonogram-puzzle%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
Just to check I understand: you're looking at numbers-around-the-outside that correspond to some configuration within the grid, and asking what fraction of those correspond to exactly one configuration? I wonder whether the following related question might be more approachable: consider all within-the-grid configurations; what fraction of those have around-the-grid numbers that correspond to just one within-the-grid configuration? (Probably both are very tough, though.)
$endgroup$
– Gareth McCaughan♦
11 hours ago
$begingroup$
@Gareth Yes, but both problems are interesting, and potentially mutually entangled (a solution to one, or its proof, might quickly yield a solution to the other). I'd consider an answer to the second question at least a partial answer to this one.
$endgroup$
– Rand al'Thor
11 hours ago
$begingroup$
I don't even have a confident guess at whether either Rand's fraction or mine (1) -> 0 as n->oo, (2) -> 1 as n->oo, (3) -> something else as n->oo, (4) doesn't converge but is bounded away from 0 and 1, or (5) doesn't converge and is sometimes close to 0 or 1 for large n. I'd guess either 1 or 3.
$endgroup$
– Gareth McCaughan♦
11 hours ago
1
$begingroup$
This is a very great question, I hope there would be progress on this. (And if your colleague does find a solution, please update us here, too!)
$endgroup$
– justhalf
11 hours ago