13.07.2015 Views

a pdf version - cs4fn

a pdf version - cs4fn

a pdf version - cs4fn

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Tantrix: P=NPYou can find computer science everywhere –even in popular Solitaire games andpuzzles. Most people play games likeTetris, Battleships, Mastermind, Tantrix andMinesweeper at some point. In fact all thesegames have a link to one of the deepest,fundamental problems remaining inComputer Science. They are all linked toa famous equation that is to do with theultimate limitations of computers.The sciences have many iconic equationsthat represent something fundamentalabout the world. The most famous is ofcourse Einstein's E=mc 2 , which even nonscientistshave heard of. The most famousequation in computer science is “P=NP”.The only trouble is no one has yet provedwhether it is true or not! There is even amillion dollar prize up for grabs for anyonewho does, not to mention great fame!P=NP boils down to the difference betweenchecking if someone's answer to a puzzle iscorrect, as against having to come up withthe answer in the first place.You are so NP!Computer Scientists call problems whereit is easy to check answers “NP problems”.Ones where it's also easy to come up withsolutions are “P problems”.Easy to check?A solution is in the <strong>cs4fn</strong> webzine if youwant to check it. In fact you can quicklycheck any claimed rotation puzzle‘solution’. All you do (the checking‘algorithm’) is look at each tile in turn andcheck each of its edges does match theedge of the tile it touches, if any. If you finda tile edge that doesn't match then the‘solution’ isn't a solution after all. How longwould that take to check? With say a 10piece puzzle there are 10 pieces to checkeach with 6 edges so in total that is 10x6 =60 things to check. That wouldn’t take toolong. Even with 100 pieces it would be only600 things to check – 10 minutes if youcould check an edge a second. So Tantrixrotation puzzles are NP puzzles – they canbe checked quickly.But can you solve it?The question is: “Are rotation puzzles Ppuzzles too?” Can they always be solvedquickly if you or a computer were cleverenough? You may have found that puzzleeasy to solve. It is much harder to come upwith a quick way that is guaranteed to solveany rotation puzzle I give you. One waywould be to methodically work throughevery combination of tile rotations to seeif it worked. That would take a long timethough.There are 6 positions for the first piece(ways to rotate it), but for each of those 6positions the second piece could be in 6positions too ... and so on for each otherpiece. Altogether for a 10-tile puzzle thereare 6x6x6x6x6x6x6x6x6x6 (i.e., over 60million) positions to check looking for asolution (and we might have to check themall). If you could check one position asecond, it would take you around 700days non-stop (no eating or sleeping). Thatis just for a 10-tile puzzle...now for a 100-tile puzzle – I'll leave you to work that out.It is not what computer scientists call“quick”.How clever do youhave to be?If P=NP is true it would mean there is aquick way of solving all Tantrix rotationpuzzles out there, if only someone wereclever enough to think of it. If P=NP is falsethen it might just not be possible howeverclever you are. Trouble is no-one knows if itis true or not…To find out more about Tantrix links tocomputer science and what are knownas NP-complete problems, go tothe <strong>cs4fn</strong> webzine Magazine+.So P=NP, if it were true, would just meanthat all problems that are easy to check arealso easy to solve.Let’s take Tantrix rotation puzzles to seewhat it is all about. Tantrix is a populardomino-type game using colouredhexagonal pieces like the ones here. Theidea of a Tantrix rotation puzzle is that youplace some tiles randomly on the table ina connected pattern. You are then notallowed to move the position of any piece.All you can do is rotate them on the spot.The problem is to rotate the pieces so thatall the coloured lines match where tilesmeet – red to red lines, blue to blue linesand so on.Have a go at the Tantrix rotation puzzlehere before you read on.Optimization isone way to getgood, if notperfect, solutionsto hard problems14Passionate about computer science?www.<strong>cs4fn</strong>.org

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!