dacs.doc electric

 

Computers and Creativity,
computer programming and mathematics

by Charles Bovaird Jr.

 

The world we live in is composed of many apparently consistent processes, which we attempt to discover. A key tool of discovery is mathematics. Mathematics is a language whose foundation is extremely rigorous and consistent. It is a tool of scientists, engineers, doctors, and philosophers. Computers can process mathematical procedures with amazing speed and can be used to produce programs (or procedures) to simulate real world processes.

During the process of designing programs (sometimes called algorithms) the analyst
discovers ways to address the solutions to many problems s/he was previously unaware. Looking at a process from a different perspective increases the likelihood of new discovery, that is, the creation of a new useful way to look at the world.
.
In the Sept. 2004 DACSDOC Ricahrd Tendyke posed a 3 x 3 magic square using the integers 1 through 9, and then challenged you to come up with a 4x4 magic square. Following that feat you were challenged to develop a process for generating more magic squares and commit it to a computer program.

There is a simple procedure for generating "the basic 3x3 magic square" he posed. This exercise is left up to the reader using the following "basic 3x3 magic square".

8 1 6
3 5 7
4 9 2

Understanding the procedure will not directly help you solve the 4x4 matrix however basic concepts can be discovered by playing with this simpler problem on paper and in your mind. Later on we can address writing a program (i.e. committing the process we discovered to a computer program). That is not to say we can not use a computer as a tool of our thinking process. Used properly, computers are more reliable than your brain (at least mine) in remembering what has transpired in the past.

Assuming you have discovered the process to generate "the basic 3x3 magic square", and thinking outside the box, low and behold you find the process can generate magic squares with sides whose length is a positive odd number (e.g. 5x5, 11x11, etc.). You will also discover this process does not apply to generating even numbered (4x4, 8x8, etc.) magic squares.

Next you will find our basic 3x3 magic square, if viewed from a different angle (in our 3 dimensional world) has seven more perspectives.

For example, take 9 children's blocks, the first block representing the number 1, the second block representing the number 2, etc.

Place them on a glass top table to form the basic 3x3 magic square. When we look at the magic square from each side of the table we see four views of the same magic square. Now do the same looking at the underside of the table. Considering all rotations you should come up with a total of eight unique views of the "basic 3x3 magic square" illustrated below.

basic 3x3   rotate |   rotate--
8 1 6 6 1 8 4 9 2
3 5 7 7 5 3 3 5 7
4 9 2 2 9 4 8 1 6

turn base -90 degrees
6 7 2   2 7 6   8 3 4
1 5 9 9 5 1 1 5 9
8 3 4 4 3 8 6 7 2

turn again -90 degrees
2 9 4
7 5 3
6 1 8

turn again -90 degrees
4 3 8
9 5 1
2 7 6

Problem 1: Can you create a 9x9 magic square (with integer numbers 1 though 81other than 1,2,...,9)?

Problem 2: What is the maximum number of odd sided magic squares that can be generated?
.
Problem 3: Can you create a 3x3 magic square (with numbers other than 1,2,...,9) that add up to 16?

Problem 4: Here is one solution to a 4x4 magic square. Can you come up with a procedure for generating other even sided magic squares?

16 3 2 13
5 10 11 8
9 6 7 12
4 15 14 1


Charles Bovaird retired from IBM. He is presently Treasurer of DACS. You may contact him at treasurer@dacs.org.

BackHomeNext