A nonunique and yet unique solution
Author 
Message 
giulio
Posted on: Fri Nov 04, 2011 5:47 am
Posts: 54 Joined: Thu Nov 03, 2011 8:52 am

A nonunique and yet unique solution
I just solved the 12x12 puzzle of 20111103 and discovered that the solution is not unique. I confess that I don't like to solve the puzzles online. I always print a screen capture and solve it with pencil and rubber. Then, I enter the solution online row by row. After solving the puzzle, while entering row 5 (counting from 1), I typed by mistake a 5 in fourth place, while I should have typed a 12. BUT THE PAGE DIDN'T PROTEST! I checked the puzzle and noticed that there 12s in (5,4) and (12,9) and 5s in (5,9) and 12,4). Therefore, if you swap the 12s and the 5s, you obtain an alternative valid grid. In this limited sense, the solution is not unique. But of course the solution is in fact unique, because if you swap the pairs of values, the cages are no longer valid. It woudl have not been unique if it had been a Sudoku puzzle. Still, it means that at least the JavaScript (I haven't checked, but I believe it is a JavaScript) that does the error checking didn't get it. Strange. Now, what was the probability of stumbling on that by chance? Considering that since when I joined yesterday, I entered solutions for 261 cells and only mistyped twice, the probability of catching a grid ambiguity when mistyping must be very very (very!) low. Perhaps, my subconscious had seen the ambiguity and "told me" to choose a 5 instead of a 12 to make me aware of it... Do you believe in extrasensorial perceptions? Now of course this gives me the temptation to check all solutions. I do have a program that, with some minor changes, could easily check the unicity of the grids. MMmmm... One day, I might do it, but don't hold your breath!




pnm
Posted on: Fri Nov 04, 2011 12:07 pm
Posts: 2215 Joined: Thu May 12, 2011 11:58 pm

Re: A nonunique and yet unique solution
hi giulio, giulio wrote: I just solved the 12x12 puzzle of 20111103 and discovered that the solution is not unique. I confess that I don't like to solve the puzzles online. I always print a screen capture and solve it with pencil and rubber. Then, I enter the solution online row by row. After solving the puzzle, while entering row 5 (counting from 1), I typed by mistake a 5 in fourth place, while I should have typed a 12. BUT THE PAGE DIDN'T PROTEST! I checked the puzzle and noticed that there 12s in (5,4) and (12,9) and 5s in (5,9) and 12,4). Therefore, if you swap the 12s and the 5s, you obtain an alternative valid grid. In this limited sense, the solution is not unique. To make it easier to discuss specific cells/cages, you can enable the "Show coordinates" option (a checkbox below the puzzle). And to make it even clearer, you can add a screenshot of the relevant section (but if you do, please wait with this until Sunday, when the solution becomes available). Patrick




giulio
Posted on: Fri Nov 04, 2011 1:02 pm
Posts: 54 Joined: Thu Nov 03, 2011 8:52 am

Re: A nonunique and yet unique solution
OK. Sorry, I hadn't though that I was effectively giving away the solution of four cells. My apologies. It won't happen again. On Sunday, I will take a screenshot and change the colours of the cells I am referring to. At what time (CET) do you publish the solutions? I am in Canberra, Australia, which is currently 10 hours ahead of central Europe. If I posted the snapshot, say, at 09:00 my time, It would be visible in Europe on Saturday 23:00.




pnm
Posted on: Fri Nov 04, 2011 1:15 pm
Posts: 2215 Joined: Thu May 12, 2011 11:58 pm

Re: A nonunique and yet unique solution
giulio wrote: OK. Sorry, I hadn't though that I was effectively giving away the solution of four cells. My apologies. It won't happen again. On Sunday, I will take a screenshot and change the colours of the cells I am referring to. At what time (CET) do you publish the solutions? I am in Canberra, Australia, which is currently 10 hours ahead of central Europe. If I posted the snapshot, say, at 09:00 my time, It would be visible in Europe on Saturday 23:00. Don't worry about giving away the solution to a few cells, I only noted this in case you (or someone else) was planning to post a screenshot. Saturday 23.00 would be 1 hour too early. thanks, Patrick




sneaklyfox
Posted on: Fri Nov 04, 2011 5:40 pm
Posts: 422 Location: Canada Joined: Fri May 13, 2011 2:43 am

Re: A nonunique and yet unique solution
The solutions are certainly unique.
Well, first as you pointed out, this is not Sudoku but Calcudoku so the cages are no longer valid of you switch those 12's and 5's. And the page doesn't protest if you input an incorrect number because Patrick's "error checking" only checks two things: 1) When all the cells in a single cage have been filled and it doesn't match up mathematically then error. 2) If there are two of the same number in the same row or column then error.
giulio, on your webpage (which I checked out briefly yesterday), the page will tell you immediately if you input an incorrect number in any cell. This makes it very easy because for example, for a 3+ cage if I didn't know the exact placement, I could just be lazy and guess and the page would tell me if I did it wrong and then I'd switch the order. On Patrick's site, you can't just guess the whole solution to a puzzle with a constant checker.




giulio
Posted on: Sat Nov 05, 2011 2:49 am
Posts: 54 Joined: Thu Nov 03, 2011 8:52 am

Re: A nonunique and yet unique solution
Thanks sneaklyfox, You are the first one to comment on my page! You are correct that my web page makes it easier. Another help you get is the possibility of seeing the candidates of a cell. But I don't like the strategy of trying out cells, even if you only get an error message if the cage doesn't add up (or multiply up, or...) That's why I also give you the solution if you want it. In any case, while solving CalcuDokus on paper, I developed a notation to mark the candidates that is almost impossible to reproduce online. That's why I always print the puzzles and solve them on paper. Patrick's idea of requiring a login and giving points for solutions is great, but his application must save user IDs, points accumulated, etc. I wanted to make a very simple frontend to my daily CalcuDokus, without database on the backend. But you didn't tell me the [for me] most important thing: Did you like the puzzles? I know: they don't include the innovations introduced by Patrick, but I came to like them better than the original KenKens. Perhaps, I am just biased! Don't you find that they "feel" somewhat different from the original KenKens?




sneaklyfox
Posted on: Sat Nov 05, 2011 4:30 am
Posts: 422 Location: Canada Joined: Fri May 13, 2011 2:43 am

Re: A nonunique and yet unique solution
Of course there are those who don't want to guess. (What's the fun in solving a calcudoku by guessing?) I wouldn't like that either but since there is a ranking system in place on Patrick's site, I think it makes sense that those who do solve the puzzles and get points are those who actually solved the entire puzzle based on logic. But I mainly wanted to point out the difference between yours and Patrick's site and explain why the page didn't "protest" when you mistyped a cell.
Personally, I don't print out any puzzles because it wastes paper and wastes time (for me anyway because my computer isn't hooked up to a printer right now) and Patrick's site allows me to bold the cells that are absolutely correct. Usually for 8x8 and up, I use the bold function so if cells are in white it means that those numbers are in the cage but I don't necessarily know where in the cage. It's essentially like writing that number as a candidate for every cell in that cage. I'm pretty used to my method now and it lets me see things quickly. It's also less messy! I don't really like looking at a grid that has several numbers in every cell... but this is my own preference.
As for your site, I have to admit that I didn't do the 9x9 calcudoku. Few reasons:  I don't like using the mouse to input cells because it feels slow to me.  It doesn't allow me to input the candidates for a cell myself. (I don't want the page to tell me what the possibilities are because I want to figure that out too.)  I tried to do it online by setting a cell to a certain number even though I knew it may not be in that particular cell but is definitely somewhere in the cage but it automatically told me it wasn't correct and I couldn't turn the error checking off either.  I could do it traditionally by printing it out, but as I said earlier I don't like doing that.
That being said, I'm sure the puzzles themselves are fun. You could consider implementing some things implicitly stated above. But I did explore some of the rest of the site. Skimmed through a bit of your writing. Quirky about the flights (now everyone else has to go see what that's about!) And I'm also a Trekkie.




giulio
Posted on: Sat Nov 05, 2011 5:36 am
Posts: 54 Joined: Thu Nov 03, 2011 8:52 am

Re: A nonunique and yet unique solution
I added the possibility of displaying the candidates because: 1. I didn't find a good way of writing candidates as I can do on paper. 2. I wanted to make it easier for less experienced solvers. 3. I had fun writing the code to keep the candidates up to date as cells are solved.
One day, perhaps, I'll find a formegood way of entering candidates... There are so many things I could work on and so little time...




sneaklyfox
Posted on: Sat Nov 05, 2011 3:43 pm
Posts: 422 Location: Canada Joined: Fri May 13, 2011 2:43 am

Re: A nonunique and yet unique solution
I see that when you choose "show candidates", it shows all the numbers in the grid that are possible for the cell. If you implement use of the keyboard more to input numbers and things, you could have it so the user could input the candidates as well. Maybe they'd have to hold the Shift key for candidates or something. And they could also "delete" the candidates by pressing the same key again.
Anyway, I'm interested to know what your own notation is for marking candidates. Perhaps someone who prints out the puzzles and does them by hand could find it useful.




giulio
Posted on: Sun Nov 06, 2011 1:31 am
Posts: 54 Joined: Thu Nov 03, 2011 8:52 am

Re: A nonunique and yet unique solution
Good idea, sneaklyfox, although my notation is quite simple. Here is a snapshot of a partially solved puzzle:  For 2cell cages, I write the permutations in the cage, but not if they are more than 6.
 For multiplecell cages, I write the possible solving combinations in the cell with resop code, but only if they are 4 or less, Otherwise, I write them below the puzzle (but only if they are not more than a dozen or so; I first process cages that I believe to contain fewer combinations).
 When all the combinations include a digit and the digit is not possible in all cells, I write it inside an oval in the possible cells (e.g., cages 216x and 60x)
 When permutations or groups of permutations are mutually exclusive, I separate them with a line (e.g., the 105x cage or the two cages 6x and 6+).
 When a cell only admits certain candidates, sometimes I write them inside parentheses (e.g., the rightmost cells of cages 216x and 25+).
That's it. To calculate the possible combinations for multiplications, I first determine the prime factors (2, 3, 5, and 7) in increasing order, and then build the combinations with factors in decreasing order. For example, the prime factors of 216 are as follows: 216  2 108  2 ..54  2 ......  3 ......  3 ......  3 Can anybody tells me how to insert a (nonbreaking space) in the text? And the combinations for cage 216x are: 9831 / 9641 / 9622 / 9432 / 6632 I start from the highest possible factors because it is easier to decide what to do with what is left. In the example, 6632 is not possible because it would place a 6 in the rightmost cell, which is in the same column of cage 14+, which certainly contains a 6.






You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum

