dacs.doc electric

 

Computers and Creativity,
Computer Programming and mathematics –
Magic Squares - Part (4)

By Charles Bovaird

In this article we will use a computer model to solve the question "Is there a finite number of solutions to the M3 problem, and if so, what are they?"

Past experience solving other problems demonstrated value in creating a programming model of the thinking process since it allowed a study of perspectives not likely found using just paper and pencil. In such a case a computer program model used as a tool for problem solving becomes "A Tool of Thought". There are many programming languages that have been used in this manner. Depending upon your background and experience and the problem itself, some languages are more appropriate than others. Following is the output of such a program written in "A Programming Language" (APL).

PERMUTATIONS OF 3LETS = 9*3 = 729
PROGRAMMING MODEL GENERATED 729 3LETS
OF WHICH 61 3LETS SUM TO 15
AFTER REMOVING DUP NO.S IN 3LETS
THERE ARE 48 3LETS LEFT
FOLLOWING ARE ALL THE 3LETS GROUPED BY CENTER NO.

519 429 438 249 159 168 276 186 195
618 528 537 348 258 267 375 285 294
816 627 735 546 357 465 573 384 492
915 726 834 645 456 564 672 483 591
825 843 654 762 582
924 942 753 861 681
852
951

PROCESS - USING GROUP WITH CENTER NO. = 2 SET
WE MUST SELECT ALL SUBSETS OF 3 3LETS THAT
MEET THE FOLLOWING CRITERIA:

  1. THE SUM OF THEIR FIRST VALUES = 15
  2. THE SUM OF THEIR LAST VALUES = 15
  3. THERE MUST BE A REMAINING 3LET
    THAT FILLS THE 2 EMPTY CELLS AND STILL MEETS THE
    SUM TO 15 CRITERIA

4 7
5 2 8
6 9

THE CENTER NO.=2 GROUP FAILS CRITERIA (2) AND (3).


NOW LET US EXAM THE GROUP WITH CENTER NO.= 5
159
258
357
456
654
753
852
951

THE ONLY SUBSET OF THE '5' GROUP THAT MEET CRITERIA IS:
456 357 852 159

492
357
816

THE ROTATIONS OF THIS MAGIC SQUARE ARE:

816 672 294 438 618 834 492 276
357 159 753 951 753 159 357 951
492 834 618 276 294 672 816 438

IN POLITICS THEY WOULD CALL IT 'SPIN', BUT 'SPIN' SOMETIME HIDES A MORE USEFUL VIEW.
HERE IT IS JUST A DIFFERENT WAY OF LOOKING AT THE SAME THING.

This approach to solving the M3 problem can easily be programmed in DOS basic or Visual Basic and still qualify as a "A Tool of Thought" process.


Charles Bovaird is DACS Treasurer, and knows about needs and values.

Copyright © 2005 Charles F. Bovaird Jr.

BackHomeNext

© Copyright Danbury Area Computer Society, Inc. 1998-2003 All Rights Reserved
Web Site Terms & Conditions of Use