No Magic In A Knight's Tour
morgothan writes "As reported in an article on Math World the solution, or rather lack of solution has been found to the over one hundred fifty year old math problem of how many numbers of magic tours a knight can make on a standard 8x8 chessboard. It turn out that there exist one hundred forty distinct semimagic tours, but no magic tour. The solution came after 61.40 CPU-days, corresponding to 138.25 days of computation at 1 GHz, the project was completed on August 5, 2003 in which every possible enumeration was tried out. The author of the software that finally solved the problem has also put up a webpage in which he further explains the problem and his method of solving it." Thanks to Mig for pointing out a great background page on Chessbase.com.
Now we're going to examine how many routes there are through all the bars in Amsterdam, and see if there are any "magic" routes that will let us complete the circuit without falling drunk in a bed of tulips.
Sheesh, evil *and* a jerk. -- Jade
Whatever happened to the classic style of problem-solving, whereby an actual proof was deduced, rather than simply employing brute-force to "count them all?" I mean, don't get me wrong, I'm glad that we finally have an answer to this pressing question (which I'm sure 95% of us had never heard of prior to reading this article), but does anyone else feel that these "brute-force" solutions are kind of cheating?
Like woodworking? Build your own picture frames.
There is an interesting [related] article on chessbase here about knight's tours. On the main chessbase page, they reference the main article involving magic tours.
Be excellent to each other. And... PARTY ON, DUDES!
You're wrong...but don't feel bad. Lots of people make this mistake. Assuming the 'host' always opens one of the remaining doors and the remaining door never has a prize behind it, you should always switch. Why? On your first pick you have a 1 in 3 chance of getting the prize. If you always switch, your chance of getting the prize becomes 2 in 3. Prize -> Goat Goat1 -> Prize Goat2 -> Prize Thus, you win. or, to put it another way... Imagine there are 1000 doors and after picking a single door (1/1000 chance of getting the prize) the host opens all but 1 door. Would you switch? Of course! At that point there's a 9999/1000 chance you will win!
If it turns out 1/3 to 1/3 no matter if you switch, then your program sometimes opens the door with the big prize in it, I guess.
It really works like this:
Assuming you picked door A, then there are three possible situations:
-The prize is behind door A
-The prize is behind door B
-The prize is behind door C
So if you stick to the door you just picked, then you have a 1/3 chance of winning.
Now obviously there's a 2/3 chance that the prize is behind one of the two other doors. And the host is basically giving you the information
"IF the prize is behind one of the two remaining doors, then it is behind THIS one" by opening an empty door.
So switch, it will give you a 2/3 chance of winning.
And yes, I had to write a program, too, before I actually believed it.
Imagine that you always stick with your first choice. Therefore, you've got to select the right door in the first place to win, hence your chance of winning by always sticking is 1 in 3.
Now imagine that you always switch. If you picked the right door to start with, you're screwed as you will always lose by switching. However, if you pick one of the two wrong doors then the host must to open the other wrong door, leaving just the right door remaining. So if you picked a wrong door in the first place, you are guaranteed to win by switching. Your chance of selecting a wrong door initially is 2 in 3 and therefore your chance of winning by always switching is 2 in 3.
1/3 + 2/3 = 1, hence all possibilites are accounted for and it is proved that by switching you twice as much chance of winning than by sticking.
Nope, but they got through about six coconuts.
The solution came after 61.40 CPU-days, corresponding to 138.25 days of computation at 1 GHz
Yeah, and I came to work in 12.34 horsepower-hours, corresponding to 666.13 hours of driving at 5K RPM. I mean, damn, I understand when my mom utters movie-level technobabble, but this?
\ 1 2 3
A y n n
B n y n
C n n y
The top row is the door number, the letters are the three cases, y means 'yes' (location of prize), n means 'no'. Suppose you chose door #1. In case A he'll show you door 2 or 3, in case B he'll show you #3, in case C he'll show #2. Only in Case A will you win by sticking with it. Case B and C you'll win by switching. That's 2/3 chance of winning by switching. Same thing regardless of what choice of door you made first.
You're right, the evidence has no mathematical beauty. Still, it's good to know what you're trying to do when you start writing a proof.
Here's what I have to say about mathematicians (since I have a bachelors in mathematics): Most people would invent paint to cover a wall they have that's bare. Mathematicians would invent paint with no intended purpose, then later discover it could be used on a wall.
Mathematicians frequently create for the sake of creation, rather than for any specific purpose.
--RJ
Oh please. Next you'll want to know the exact DRAM configuration. Was it DDR? How big was the L2? Was the data set swapped out to a 7200rpm hard disk or a 10k rpm disk?
Good grief. It's just an estimate. It's not the exact compute time that's interesting. It still tells me the interesting bits-- that it was a complexity that an ordinary PC could do in a reasonable time frame, not the sort of thing a gigantic cluster chewed on for 100 years.
...Assuming the 'host' always opens one of the remaining doors and the remaining door never has a prize behind it...
A note to all the people writing code to solve this, the key to this problem is that Monty intentionally chooses a door that has no prize behind it. No doubt, some of you are interpreting this problem as, "Monty chooses another door at random, and we're only examining the cases where he chooses the door with no prize". If that is your interpretation, then switching doesn't matter, but the traditional Monty Hall Problem assumes Monty knows what's behind the doors and chooses accordingly.
A knights tour involves moving the knight onto every square of the chessboard without repeating a square (being a knight, it is of course allowed to jump over squares it has previously landed on).
:).
A magic square is a square grid, with each grid position numbered, such that the horizontals, verticals, and diagonals all add to the same number (you can also ask for all the broken diagonals to add to this number, but this doesn't have to hold in a basic magic square).
If we number the knight's initial position 1, and increment with every jump, then a knights tour gives us a numbered n by n square (8 by 8 in the case of a normal chessboard).
The question: are there any knights tours which give us a magic square after we perform this numbering operation?
The answer: no, although there are many tours which give us a 'semi-magic' square (where the horizonals and verticals, but not the diagonals, give us the same sum).
The point: although magic squares have a variety of surprising uses, there seems to be no 'point' to the magic knights tour question other than another line in the book of 'solved minor problems' -- but if it's enough to write a paper on, then you can bet you'll be able to find a graduate student to do it
-- Help Digitise the Public Domain at DP.
Sir Paul McCartney did make a Magical Mystery Tour
I've been seeing a lot of comments disappointed with brute-force problem-solving--but I am all for it. Here's why:
In my job, I do fine structural analysis and computational fluid dynamics for aerospace design. Aerospace engineering is rapidly reaching the point where simplified, elegant models are inadequate to the real-world structures they are meant to mimic. For instance, the Navier-Stokes equations, a set of second-order partial differential equations which describe fluid flow, are not susceptible to analytical solution in any but the most simplified cases, and as things like airfoils, turbine blades, and computers grow more refined, their properties require much hairier math to describe. Turbulent flow around a wing or turbine blade has no elegant solution, but a brute-force computational model can yield a solution that allows us to design a lighter wing, and thus a more fuel-efficient plane, or a stronger turbine fan, and a more efficient generator. Or, to cite an example near and dear to many slashdotter hearts, as we can better model the heat transfer inside a microprocessor, we can better devise ways to cool it, and thus build a faster, more stable computer. (And then, we can solve more iterations on it, and build an even faster computer...and then we can solve more iterations... ^_~)
There is an intense intellectual satisfaction to a 20 or 100 line proof (I still remember the triumph of my high school proof that a triangle's interior angles sum to 180), but for a lot of things, there simply exist no such proofs. As we tackle more and more mathematical problems, those with relatively simple proofs will quickly be solved and set aside, and we will move on to messier things. For instance, the proof of Fermat's Theorem runs to several hundred pages of dense elliptic curve math. It was an aesthetic disappointment for those hoping for a simpler solution, but it was a triumph for the field of mathematics as a whole.
There is a whole 'nother world of proofs involved in brute-force solutions. Estimated time to solution, order of error--elegant mathematical tools are still necessary, but they are increasingly used to delineate regions of uncertainty as the complete picture becomes messier. The closer mathematical models get to the real world, the more complex and beautiful, but the less elegant, they become. I do not think that the field of mathematics will stop producing elegant proofs, but I do think they will have less and less to do with the world we live in and more and more to do with hypothetical mathematical constructs, whose usefulness will then filter down in the form of special cases to more prosaic disciplines, like science and engineering. This diminishes neither science nor engineering, and adds to the knowledge available in all fields.
-Carolyn
Like Daddy always said: if you can't dazzle 'em with brilliance, baffle 'em with bullshit.
However, try and think about what this problem really is mathematically, rather than in terms of chess or magic squares. A knight's tour requires the knight to visit every square on the board exactly once. Replace "squares" with "nodes," and "board" with "graph," and what we have here is the problem of finding a Hamiltonian path with some interesting constraints.
And that's where this problem gets interesting- finding a Hamiltonian path on a graph is known to be NP-complete, a designation which carries with it all sorts of baggage, including some of the million-dollar sort. The fact that the question of whether magic knight's tours exist on an standard 8x8 board required 60+ CPU-days to answer speaks volumes about the complexity of the problem, and demands answers as to how this complexity comes about, and why there is no solution with the given constraints. Far from being just a silly mathematical curiosity, this is a problem that presents a lot of potential applications with regards to algorithms, complexity, and computability. Also, if you can find an algorithm that finds Hamiltonian paths in polynomial time, you get the aforementioned free money.
So yes, the problem of finding a magic tour seems worthless if you only consider the problem literally in terms of a chessboard and magic squares, instead of as a model for other complex problems in mathematics, science, and engineering. But by the same token, how interesting and useful would the Traveling Salesman Problem be if it were only applied to traveling salesmen?
"FDA staff reviewers expressed concern about the number of patients who were left out of the study because they died."