Exploring Magic Squares


Overview: Many times students wonder "How did anyone ever come up with this?" when they are introduced to a new mathematical concept. Also students are under the impression that all mathematics is of European ancestry (because we don't teach them differently). I created this site to provide information on how magic squares began in China and through their evolution led to the "discovery" of matrix methods. Included in this site is a history of magic squares, categorization of magic squares, algorithms for creating magic squares and a warm up activity to use in introducing systems of linear equations.

Warm-up Activity: Using any positive integer, fill in a 3*3 grid such that the sum of each row, column, and major diagonal are equal. After some experimentation students should see that one possibility is when each entry in the grid is the same number. Use this activity to lead into a discussion on the history of magic squares

Here's a more difficult example, taken from Ken's Puzzle of the Week, that students could work on as an out-of-class challenge. "Take one 1, two 2s, three 3s, four 4s, five 5s, six 6s, seven 7s, and eight 8s and place them in a 6-by-6 grid, one digit per square, such that each row, column, and major diagonal sums to 34." Three possible solutions include:

Solution 1)

 5  7  8  6  7  1
 8  4  5  6  5  6
 3  5  7  8  6  5
 4  3  4  8  8  7
 6  8  7  4  2  7
 8  7  3  2  6  8

Solution 2)

 8  4  4  4  6  8
 8  8  3  7  3  5
 6  4  7  8  7  2
 7  5  6  1  8  7
 2  6  6  8  5  7
 3  7  8  6  5  5

Solution 3)

8 3 3 4 8 8
8 6 4 5 4 7
5 8 4 6 6 5
1 7 7 6 7 6
5 2 8 7 7 5
7 8 8 6 2 3

History of Magic Squares:The use of matrices to solve systems of equations resulted from a game now known as magic squares created by the Chinese. Magic squares involve filling in the entries of a square grid such that each row, each column and each main diagonal sums to the same number, known as the magic constant. Magic squares can be classified as normal, even order, odd order, singly even, doubly even, pandiagonal, and regular. See Types of Magic Squares.

The oldest known account of a magic square, the lo-shu magic square, appears in the Chinese I-king, or Book on Permutations. The lo-shu is named for the River Lo and the Chinese shu meaning books. There are several accounts of how the lo-shu originated. One ancient Chinese legend claims the lo-shu was first seen by the Emperor Yu in about 2200 B. C. in a pattern decorating the back of a giant divine tortoise which surfaced from the Yellow River (the River Lo). Another account says that the same divine turtle was discovered sometime later during a flood. The people had tried to calm the anger of the river god of the Lo river by offering sacrifices but each time a giant turtle emerged from the river, circled the sacrifice, and it was not accepted until a child noticed a pattern (the lo-shu) on the back of the turtle indicating the magic constant 15, the correct amount of sacrifice that should be made. Still a third story says that magic squares were created by the tic-tac-toe expert Fu Yung during the fifth century B. C. when he analyzed some numbers he had absent-mindedly written on his tic-tac-toe board and discovered they held the properties of what became magic squares. He supposedly engraved the numbers onto the shell of a tortoise which later wandered into the Imperial garden and was discovered and recorded by the emperor. This third story is known to be fictitious since the tablet containing the lo-shu dates to 2200 B. C. In each of the preceding stories, the pattern upon the tortoises back indicated a three by three square grid of circular dots indicating numbers, the black dots for even numbers and the white dots for odd numbers. The pattern of numbers in each row, column and main diagonal of the lo-shu add up to 15.

Magic squares and the mystique behind them had a large impact on Chinese culture. Those who were able to create magic squares used their knowledge to influence and gain power in the government and religious establishments of their time. The Chinese solar calendar, which consists of 24 cycles of 15 days each is thought to have been devised using the lo-shu as an inspiration. The lo-shu also influenced the Chinese system of time dimension which takes into account the number 9. Time is divided into 9 ages, each lasting 20 years. Three 20 year ages make up one period. A full cycle takes 180 years. Each period is assigned a number from 1 to 9. The origins of The Eight Types of Houses Theory makes use of the Pa Kua or The Eight Trigram of the I-Ching (Book of Changes) to diagnose a home. Also, the lo-shu square became the basic theory behind The Flying Star School of Feng Shui. In China (and India), magic squares were engraved on pendants of stone, metal, or wood and worn on necklaces as talismans or amulets to bring good fortune or to ward off malign spirits or the evil eye. Magic squares can still be found today in the ruins of ancient oriental cities carved on the doors or above entrances to houses and temples.

Although the Babylonians were working with linear equations 200 years earlier, between 200 and 100 B. C. the Chinese discovered a modified version of magic squares, namely matrices, which could be used to solve systems of linear equations. The first known example of such a matrix appears in the Chinese text Nine Chapters of the Mathematical Art written during the Han dynasty (221 B. C.-221 A. D.). The Chinese used the method now known as Gaussian elimination to manipulate these matrices and arrive at a solution to the system of equations.

Magic squares are known to have been studied by the Arabs as early as the ninth century. It was during this period that the Arabic mathematician, Tabit ibn Qorra (826-901 A. D.), discussed magic squares in his writings and Arabic astrologers used magic squares in their calculations of horoscopes.

The earliest discussion of magic squares in the western world can be found in the writings of Theon of Smyrna around 130 A. D. Magic squares were introduced to Europe through the writings of Moscopulus of Constantinople who wrote on them in 1300 A. D. Magic squares fascinated and teased the inquiring minds of the Renaissance great impacting the culture just as they had in China, India and Arabia. In fact the oldest known example of a magic square in Europe appears in 1514 in a painting, Melancholia by Albrecht Durer. In 1512, Guarini di Forli, not knowing of magic squares, asked how two white and two black knights could be interchanged if they were placed at the corners of a 3 by 3 board using normal knights moves. This problem became the subject of great interest and was later solved using magic squares. Cornelius Agrippa (1486-1535) constructed magic squares of order three through seven associating them with the then-known seven planets-Saturn, Jupiter, Mars, the sun, Venus, Mercury, and the moon.

Several European mathematicians contributed to the study of magic squares through their writings. Magic squares appear in the writings of Frenchman Phillipe de la Hire (1640-1718). De la Loubere, envoy of Louis XIV to Siam from 1687 to 1688 learned of the staircase method for finding a normal magic square of any odd order and recorded this method in his writings. Euler (1707-83) came to the conclusion in his studies of magic squares that no pandiagonal square of order 2(2n+1) can exist. (This was later disproved by mathematician Martin Gardener in 1950s.)

Benjamin Franklin studied magic squares in colonial America coming up with an 8 by 8 and 16 by 16 magic square.

Computers have played a big role in the study and manipulation of magic squares. For instance, they have been used to find all 880 distinct normal magic squares of order 4 and the 48 pandiagonal magic squares of that set. However, the number of magic squares, normal or not, of order greater than 4 remains unsolved. Magic squares (and other matrices) also influence computers in that computer animation is performed by recording the coordinates of an image as a magic square (or other matrix) and then manipulating its coordinates to change its position or scale.

At first magic squares were considered merely recreational, but beginning with the discovery of (their relation to matrices) magic squares have proven to be a great influence in the development and study of many areas of mathematics. Today one can find connections between magic squares and infinitesimal calculus, the calculus of operations, group theory, matrices, set theory, number theory, factor analysis, and combinatorics.


Return to Portfolio