home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: sci.math
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!darwin.sura.net!jvnc.net!princeton!tinton.ccur.com!cjh
- From: cjh@tinton.ccur.com (Christopher J. Henrich)
- Subject: Magic Squares (was: Re: Sum of Numbers)
- Message-ID: <1992Nov14.233001.29160@tinton.ccur.com>
- Lines: 31
- Sender: news@tinton.ccur.com (News)
- Organization: Concurrent Computer Corp., Tinton Falls, NJ
- References: <1992Nov12.214936.15458@aio.jsc.nasa.gov>
- Date: Sat, 14 Nov 1992 23:30:01 GMT
- Lines: 30
-
- In article <1992Nov12.214936.15458@aio.jsc.nasa.gov> nas_ps@jsc.nasa.gov writes:
- >I hope this is not a FAQ. I have posted the same question on rec.puzzles.
- >Given numbers from 1 to 16, arrange them on a 4 by 4 - magic square such that
- >when added them diagonally, horizontally, and vertically would yield the same
- >number. Is there any algorithm do this problem ? The solution may not be
- >unique. Can we use the solution from a simultaneous equations ?
- >
- There are 880 solutions. We count two solutions as being the same if
- they differ only by a rotation or reflection of the square. The
- algorithm for finding this out is an example of "backtracking."
- Here is an outline of how it might start (leaving out clever
- details):
-
- Try to find solutions with, say, a "1" in the upper left hand
- corner. So, place a "1" there; now try to find solutions by placing
- a "2" next to the "1". so far so good, it seems... let's try placing
- "3" in the next square over. It won't do. To make the top
- row add up to 34, you would need to put "28" in the upper right,
- and the available numbers go up only to 16. So, *backtrack* -
- erase the "3" and try a "4". And so on.
-
- This is clearly a job for a computer. In the seventeenth century,
- a French mathematician named Frenicle (^ over the first "e")
- did it by hand. Others have implemented it by computer.
-
- See also my paper on magic squares and linear algebra, in the
- _American Mathematical Monthly_, June-July 1991.
-
- Regards,
- Chris Henrich
-