{"id":20,"date":"2005-05-21T16:30:49","date_gmt":"2005-05-21T06:30:49","guid":{"rendered":"http:\/\/somethinkodd.com\/oddthinking\/?p=20"},"modified":"2007-10-07T20:58:05","modified_gmt":"2007-10-07T10:58:05","slug":"puzzling-over-puzzles","status":"publish","type":"post","link":"https:\/\/www.somethinkodd.com\/oddthinking\/2005\/05\/21\/puzzling-over-puzzles\/","title":{"rendered":"Puzzling over Puzzles"},"content":{"rendered":"<p><!-- UnMarkedDown_2_01132526274--><\/p>\n<p>Let&#8217;s divide the world of puzzles into the type that are real dilemmas versus the type people do for fun, and look at the latter for a while.<\/p>\n<p><!--more--><\/p>\n<p>Let&#8217;s divide the fun puzzles into the type they put in newspapers each day versus the type they don&#8217;t. The distinction is important &#8211; the type they put into newspapers each day can&#8217;t be the sort of puzzle like &#8220;Estimate the number of grooves on an vinyl 33 1\/3 rpm LP album.&#8221;  They have to be the sort where they can generate new ones each day following the standard structure.<\/p>\n<p>These newspaper style puzzles can be divided up again along a spectrum from the type that require general knowledge (like trivia quizzes) to the type that require the ability to solve logic problems. Crosswords and Target words fit somewhere in the middle.<\/p>\n<p>I only attempt the trivia type puzzles occasionally. I feel little sense of failure for being ignorant of a useless fact or an unusual word, so I have limited motivation to finish a crossword.<\/p>\n<p>So let&#8217;s look at the logic puzzles at the other end of the spectrum.<\/p>\n<p>To open up a newspaper and to solve a puzzle in it is an achievement&#8230; in a way&#8230; I guess.<\/p>\n<p>However, being a algorithm geek, I don&#8217;t think you haven&#8217;t really solved a puzzle until you constructed a repeatable process to solve the <em>class<\/em> of puzzles&#8230;<\/p>\n<p>&#8230;and being a software geek, I don&#8217;t think you have really, truly beaten the puzzle until there is some software to completely automate the process finding the solution.<\/p>\n<p>I have annoyed people with this approach before &#8211; it tends to kill dead any amusement from the puzzle in the future.<\/p>\n<p>I was given a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Tiling_puzzle\" title=\"Wikipedia definition of Tiling_puzzle\" class=\"wikipedia\">tiling puzzle<\/a> as a gift once, and while I was grateful for the thought behind the gift, I never actually took it out of its packaging. I read the rules, and suspected that the puzzle was <a href=\"http:\/\/en.wikipedia.org\/wiki\/NP-complete\" title=\"Wikipedia definition of NP-complete\" class=\"wikipedia\">NP-complete<\/a> [<a href=\"http:\/\/www.csc.liv.ac.uk\/~ped\/teachadmin\/COMP202\/annotated_np.html\">Ref<\/a>]; I didn&#8217;t see any point in playing with it, if I couldn&#8217;t solve it algorithmically.  <\/p>\n<p>Perhaps I was too hasty &#8211; I have whiled away some time with Microsoft&#8217;s Minesweeper, in the past, but now I have learnt that <a href=\"http:\/\/web.mat.bham.ac.uk\/R.W.Kaye\/minesw\/ordmsw.htm\">Minesweeper is NP-complete<\/a>. I currently find myself with no urge to play it ever again &#8211; I wonder if that feeling will pass.<\/p>\n<p>A good compromise is to write some software to assist you in solving the puzzle &#8211; performing the drudgery of mundane calculations without actually stepping over the mark and simply searching through the solution space for an answer.<\/p>\n<p>It has been an approach I have used in the past for puzzles like <a href=\"http:\/\/www.pennypress.com\/samplepuzzles\/srwoo21.pdf\">Codewords<\/a> and <a href=\"http:\/\/www.powells.com\/cgi-bin\/biblio?inkey=17-0806959568-0\">Solitaire Battleships<\/a>. [To my horror, <a href=\"http:\/\/www.reed.edu\/~mcphailb\/applets\/battleships\/\">Solitaire Battleships is probably NP-complete too<\/a>. Oooops.]<\/p>\n<p><a href=\"http:\/\/www.caseyporn.com\/\">Casey<\/a> once made a similar point about some software he was writing to solve a puzzle. He simply refused to use &#8220;backtracking&#8221; in his algorithm. <\/p>\n<p>Backtracking is a term to describe letting your computer play a trial-and-error guessing game. The computer can guess a a solution first and then check to see if the result is right. If not, it &#8220;backtracks&#8221; and guesses again. If a computer can make thousands of semi-educated guesses a minute, it may not take that long to find a solution to a particular puzzle.<\/p>\n<p>If you use backtracking, then you have given up trying to skillfully pick the lock to the door that separates you from a general solution, and are instead are using the sheer weight of your computer as a battering ram.<\/p>\n<p>So to summarize:<\/p>\n<p>If you can automate the process without backtracking, you have solved it, and and the puzzle is probably no longer interesting.<\/p>\n<p>If you can automate half of the process without backtracking, you may have a useful tool to assist you in solving some of the more challenging problems.<\/p>\n<p>Alternatively, it may just be NP-complete. While it might be amusing to solve particular instances, you are never going to really beat it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To solve a puzzle from a newspaper is to win a battle. But can you win the war?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"","footnotes":""},"categories":[33,34,26],"tags":[118,91],"class_list":["post-20","post","type-post","status-publish","format-standard","hentry","category-puzzle-solving","category-software-development","category-tribal-affiliation","tag-philosophy","tag-puzzles"],"_links":{"self":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts\/20","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/comments?post=20"}],"version-history":[{"count":0,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/posts\/20\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/media?parent=20"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/categories?post=20"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.somethinkodd.com\/oddthinking\/wp-json\/wp\/v2\/tags?post=20"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}