Vector Spaces of Magic Squares

100 downloads 7685 Views 447KB Size Report
Vector Spaces of Magic Squares. Author(s): James E. Ward III. Source: Mathematics Magazine, Vol. 53, No. 2 (Mar., 1980), pp. 108-111. Published by: ...
Vector Spaces of Magic Squares Author(s): James E. Ward III Source: Mathematics Magazine, Vol. 53, No. 2 (Mar., 1980), pp. 108-111 Published by: Mathematical Association of America Stable URL: http://www.jstor.org/stable/2689960 Accessed: 27/10/2010 13:48 Your use of the JSTOR archive indicates your acceptance of JSTOR's Terms and Conditions of Use, available at http://www.jstor.org/page/info/about/policies/terms.jsp. JSTOR's Terms and Conditions of Use provides, in part, that unless you have obtained prior permission, you may not download an entire issue of a journal or multiple copies of articles, and you may use content in the JSTOR archive only for your personal, non-commercial use. Please contact the publisher regarding any further use of this work. Publisher contact information may be obtained at http://www.jstor.org/action/showPublisher?publisherCode=maa. Each copy of any part of a JSTOR transmission must contain the same copyright notice that appears on the screen or printed page of such transmission. JSTOR is a not-for-profit service that helps scholars, researchers, and students discover, use, and build upon a wide range of content in a trusted digital archive. We use information technology and tools to increase productivity and facilitate new forms of scholarship. For more information about JSTOR, please contact [email protected].

Mathematical Association of America is collaborating with JSTOR to digitize, preserve and extend access to Mathematics Magazine.

http://www.jstor.org

VectorSpaces of Magic Squares

JAMES

E. WAw III

BowdoinCollege Brunswick, ME 04011

Exercise.An n X n magicsquareis an nX n matrixof real numbersin whichthesumalong of themagicsquare). each row,eachcolumnand each diagonalis a constant(calledtheline-sum For example,three3 x 3 magicsquareswithline-sums15,3/2 and 0, respectively, are 2 9 4

-1

5/2

7 5 3

3/2

1/2 -1/2

6 1 8

1 -3/2

0

2

1 -2 1

0 0 0

-1 2 -1

(i) Show thatthe(matrix)sum of twon X n magicsquaresis an n X n magicsquare.If the line-sums of thesquaresare ml and M2, whatis theline-sumof thesum? (ii) Showthatthe(matrix)scalarmultipleofan n X n magicsquareby a realnumberk is an n X n magicsquare.If the originalsquarehas line-summ, whatis the line-sumof the scalarmultiple? (iii) Is theset of all n X n magicsquares(withall possibleline-sums)a vectorspace? Why? (iv) Is theset of all n X n magicsquareswithline-summ#0 a vectorspace?Why? (v) Is thesetof all nX n magicsquareswithline-sumzero a vectorspace?Why? Thisexercise, suggested by Fletcher[3],encouragesconsideration of thealgebraicstructure of magicsquares,as opposedto methodsforgenerating them.In thisarticlewe followFletcher's suggestion, usingfamiliarlinearalgebratechniquesto determine the dimensionsof thevector spaces of magicsquares.Then we use thesedimensionsto establishan upperbound on the numberof magicsquares. A Chineseemperoris supposedto have Magic squareshave fascinatedpeopleforcenturies. seen one-on theback of a divineturtle,no less-as earlyas 2200 B. C. Fromthattimeon, have been ascribedto them.In themiddleages,a magicsquareengravedon mystical properties a silverplateand wornabout theneckwas thoughtto wardofftheplague[5].Writingin 1844, Hutton[4] reported: Thesesquareshavebeencalledmagicsquaresbecausetheancientsascribedto themgreat of manyof thebasisand principle formed ofnumbers and becausethisdisposition virtues, to thisidea a squareof one cell,filledup withunity,was the theirtalismans. According of God; fortheyremarked symbolof theDeity,on accountof theunityand immutability theproduct ofunity thatthissquarewas,byitsnature, being uniqueandimmutable, byitself bothon account ofimperfect Thesquareoftheroottwowasthesymbol alwaysunity. matter, A squareof thissquaremagically. ofarranging andoftheimpossibility of thefourelements thatoftwenty-five to Jupiter, thatofsixteen toSaturn, orconsecrated ninecellswasassigned to Venus,thatof sixty-four to to the Sun,thatof forty-nine to Mars,thatof thirty-six

108

MATHEMATICS MAGAZINE

or nineon eachside,totheMoon.Thosewhocan findany Mercury, andthatofeighty-one, of numbers must,no doubt,have relationbetweentheplanetsand suchan arrangement withsuperstition; butsuchwas thetoneofthemysterious philosomindsstrongly tinctured whiletheyamuse Modemmathematicians, and theirdisciples. phyofJamblichus,Porphyry, whichrequirea pretty ofcombinaextensive knowledge themselves withthesearrangements, thantheyreallydeserve. tion,attachto themno moreimportance

attachedenoughimporbothbeforeand after1844apparently mathematicians Nevertheless,

tance to magic squares to writethousands of pages about them. In 1888, F. A. P. Barnard, then

president ofColumbiaand afterwhomBarnardCollegeis named,publisheda 61-pagepaper[2] of 47 scholarly at the end of whichhe includedan "approximately complete"bibliography on magic squares would papers and books on the subject.Today a completebibliography probablyrequireall 61 pages! The magic squares which are best known are those n x n squares which use only the firstn2

to as classicalmagic positiveintegers. Thesesquarearraysof thenumbers1 to n2willbe referred squares. The firstexample given in the opening exercise is a 3 x 3 classical magic square.

Each magicsquareyieldssevenothermagicsquares,obtainedfromit by rotatingit in the

plane throughangles of 900, 1800, and 2700 and by rotatingit in space about its horizontal, verticaland two diagonal axes. These seven, togetherwiththe original,constitutethe symmetries of the magic square. Symmetricmagic squares are regardedas being identical. It is easy to show that the firstexample in the opening exercise is the only 3 x 3 classical magic square up to symmetry. More generally,we shall call any n x n array of n2 (integral,real, or complex) numbers in which each line-sumis constant a magic square. The second and thirdexamples of the opening exercise are real 3 x 3 magic squares. Note that the same number may appear several timesin a magic square, a statementwhich is not true of classical magic squares.

This paper will consideronly real magic squares,althoughall of the resultsare truefor all of theresultshold complexmagicsquaresas well.If theentriesare restricted to theintegers, if"vectorspace" is replacedjudiciouslyby "Z-module."Fromnowon, all magicsquareswillbe real magic squares unless it is specificallystatedotherwise.Because 1x 1 and 2 x 2 magic and becausetheybog downtheproofswithspecialcases,it will squaresare notveryinteresting be assumedthatn > 3. We shalldenoteby MS(n) thesetof all nx n magicsquares;by mMS(n) theset of all n x n magicsquareswithline-summ; and by OMS(n) thesetof all n x n magicsquareswithline-sum zero. The openingexerciserevealsthatMS(n) and OMS(n) are vectorspaces but thatmMS(n) form #0 is not.The space OMS(n) is a subspaceof MS(n) whichis, in turn,a subspaceof the n2-dimensional vectorspace of all nx n real matrices.Thus thedimensionof MS(n) is at most n2. (Note thatmMS(n) is neverempty:it alwayscontainsthe square in whicheach entryis m/n.) Let us call each magic square in OMS(n), whose line-sumsare all zero, a zero magic square. ifone can be obtainedfromtheotherby adding We willcall twonx n magicsquaresequivalent

thesamerealnumberto each entry.It follows,trivially, thateach magicsquareis equivalentto one and onlyone zero magicsquare: ifan n x n magicsquarehas line-summ,it can " zeroed" m/nfromeach entry.Thus thereis a one-to-one correspondence betweentheset bysubtracting mMS(n) fora fixedm and thevectorspace OMS(n). This setsthestageforthemainresultof thispaper. THEOREM.

Thedimension ofOMS(n) is n2 - 2n- 1.

are all zero. Thus there Proof. If an nx n matrixA = (a.) is in OMS(n), its 2n + 2 line-sums are 2n+ 2 homogeneous linearequationsin then2variablesay,1 < i,j < n. Writetheseequations

in thefollowing order:firstthen rowsumsin order,thenthen column order,calledthestandard sumsin order,thentheNW-SE diagonalsum,and,last,theSW-NE diagonalsum.The resulting coefficient matrixwillbe a (2n + 2) x n2matrixof O's and l's. Whenn= 3, it is the8 x 9 matrix

VOL. 53, NO. 2, MARCH 1980

109

I

I

I

0

0

0

0

o

o

O

O

0

1

1

1

0

0

0

O

O

O

O

O

0

1

1

1

1

0

0

1

0

0

1

0

0

0

1

0

0

1

0

0

1

0

O

0

1

0

0

1

0

0

1

1

0

0

0

1

0

0

0

1

O

0

1

0

1

0

1

0

O,

of thejth variable in the list where the elementsin thejth column are the coefficients ajj,aI2,aI3,a2I,

a22,a23,a3l,a32,a33-

matrixdetermined In thecoefficient byA, thefirst2n-1I rowsare clearlylinearlyindepenof thefirst2n -1, beingthesum of thefirstn dent.But the2nthrowis a linearcombination 2n -1. Moreover,thelasttworowsare bothlinearly rowsminusthe sumof rowsn+ I through matrixhas I's in thefirst, of thefirst2n-1I rows:thenthcolumnof thecoefficient independent 2nthand (2n+2)nd rows,andzeroeseverywhere else,and then2thcolumnhas I's in thenth, 2nthand (2n+ I)st rows,and zeroeseverywhere else,makingit impossibleto finda nontrivial zero linearcombinationof thefirst2 n-1I rowswitheitherof thelast two rows.Finally,it is clear thatneitherof the last two rowsis a scalar multipleof the other.Thus the matrixof r.owsand hencehas rank2n+ 1. By therank coefficients has exactly2n+ I linearlyindependent and nullitytheorem[1],thedimensionof OMS(n),whichis thenullityof thecoefficient matrix, is n2-_(2n+ 1). COROLLARY.Thedimension ofMS(n) is n2-

2n= n(n-2).

Proof.Let q = n2-_2n-1I and SI, . .., Sq be a basis forOMS(n),a subspaceof MS(n). Let I be .S ,I}

thesetB={S and consider themagicsquarein MS(n) withI in everyposition, ofMS(n). ofn2-2n vectors consisting

The setB spansMS(n), forifM is anymagicsquarein MS(n) and M has line-sum m,thenM

1 10MATH111000000ZIN is equivalent to thezerom'agicsquareMO= M-(ml n)I ofOMS(n).As SI,..., Sq is a basisfor = . cq, so M= clSl+ *,* +cqSq +(m/n)I. OMS(n),MD clISI + ***+ cqSq forsomescalarsclI ..,

+ cqSq +cq + II, forthe line-sumof the vectorcISI + Moreover,B is linearlyindependent, wheretheci'sare scalars,is ncq+1.[See parts(i) and (ii) of theopeningexercise.]If thisvectoris to equal thezero vector,whichhas line-sumzero,we musthave ncq+I= or cq 0=. Then the of SI,_., Sq impliesthatcl= linearindependence cq= as well.ThusB is a basisfor MS(n). It is easyto see thatthecentralentryofanymagicsquarein OMS(3) is zero.Thismeansthat the withrespectto the diagonals.By theTheoremn, OMS(3) magicsquaresare anti-symmetric dimensionof OMS(3) is 2; thusa magicsquarein OMS(3) is uniquelydetermined by specifying any twoentriesnotcollinearwiththecentralzero.If we choosethefirsttwoentriesin thefirst basis forOMS(3): rowto be 1,O and O, 1,we getthefollowing I

0

-1

0

-1

O

-2 1

2

1

0

-1

I

-1

-1

O

1

0

Accordingto theTheorem,the dimensionof OMS(4) is 7. Using an argumentof thesame it natureas thatwhichshowsthatthereis a unique3 x 3 classicalmagicsquareup to symmnetry, can be established thatthesumof thefourcornerentriesand thesumof thefourcentralentries of a magicsquarein OMS(4) are both zero. Withthesefacts,it is easy to findseven entries determine a 4 x 4 zeromagicsquare.Two examplesare: which,whenspecified, completely x x x

x x -

x x -

-

x x

-

x x x

x x

The sevensquaresobtainedbyputting1 in one of thedesignatedpositionsof eitherpatternand O's in theothersix in all possibleways constitute a basis forOMS(4). For instance,theseven magicsquareswhichforma basis forOMS(4) accordingto thefirstpatternare: 1 00

0

0 -1 0 0 0o

0

1 0 -1

-1 1 0

0 2 -2 0 2 1 -1 -2 0 0 0 0 0 0

0 -1 1

0

1

0 -1 0 0o0

0 1 -1 0 -2 1 0 0 0 0 0

0 1 0

0 -1 1

0 00

0

1

0 1 -1 0 -1 0

0

1 0 -1

0

-1 1 0

-1 0

0 1 0

0 1 -1

0 1

0 0

0 0 0 -1

0 1 -1 -1 -1 1 0 0 0

0 1 -1

0 -1 1

0 1

0 -1 1

Motivatedby thisexample,it is naturalto make the followingdefinition. A selectionof

n' - 2n- 1 positionsin an n X n matrixis called a skeletonof OMS(n) if theassignment of real

numbersto thosepositionsuniquelydetermines entriesin all otherpositionsusing the zero magic square conditions.Given a skeletonof OMS(n), the arrayof the 2n+ 1 positionsnot specifiedis calledtheframeof thatskeleton.In theOMS(4) examplesabove,each arrayofx's is a skeletonand each arrayof dashesis a frame.Whenn is large,thenumberof positionsin a skeletonis muchgreaterthanthenumberofpositionsin itsframe,so it is convenient to thinkof skeletonsin termsof theframestheydetermine. Everyskeletonof OMS(n) leads to a basis of OMS(n) in a naturalway,by assigning1 to one skeletalpositipnand O's to therestin all n2- 2n- 1 possibleways.We shallcall thisbasis the naturalbasis associatedwiththat skeleton.Thus we could determinea canonical basis for theredoes not OMS(n) if we could agree on a canonicalskeletonof OMS(n). Unfortunately, appear to be any one skeletonof OMS(n) whichis superiorto, or morenaturalthan,all the or near-symmetry, while others others.Some skeletonspossess certainkinds of symmetry guaranteethepresenceof a largenumberof zeroesin themagicsquaresof thenaturalbases Preference forone skeletonoveranotherseemsto be largelya matterof taste. theydetermine. The precedingideas can be used to determine a crudeupperboundon thenumberof nx n is n2(n2 + 1)/2,each line-sumof an classicalmagicsquares.Sincethesumof thefirstn2integers nx n classicalmagicsquaremustbe n(n2+ 1)/2. Letting1= n(n2+ 1)/2,an nx n classicalmagic squarecan be zeroedby subtracting I/n fromeach entry.A skeletonof thisn X n zero magic n consists of the zero magic square,and hence the square 12-2n-I positionsand determines Thus the numberof nx n classicalmagic squaresis the classical magicsquare,completely. numberof waysthe n2- 2n- 1 positionsof thisskeletoncan be chosenfromthen2 numbers 1-1/n,2-i/n, ... , n2-I//n, choosingeach numberno morethanonce. Since the numberof of n2- 2n- 1 elementswhich can be formedfroma set of n2 elementsis permutations (n2)!/(2n+ 1)!, themaximumnumberof nx n classicalmagicsquares,takingintoaccountthe8 of thisbound is revealed of a magicsquare,is (n2)! /8(2n+ 1)!. The imprecision symmetries evenwhenn= 3: in thatcase, thebound says thatthereare at mostnine3 x 3 classicalmagic earlierin thispaper,itis easyto showthatthereis,in fact,onlyone. squares,while,as suggested References [1]

[2] [3]

[4]

H. Anton,ElementaryLinear Algebra,2nd ed., Wiley,New York, 1977.

F. A. P. Barnard, Theoryof magicsquaresand of magiccubes,Memoirsof theNationalAcademyof Sciences, vol.4, Part1, 1888,pp. 209-270. T. J. Fletcher,Linear AlgebraThroughIts Applications,Van NostrandReinhold,New York, 1972.

Hutton, Mathematical Recreations, 1844.

toNumberTheory, Markham, Chicago,1970. [51 H. M. Stark,Introduction

VOL. 53, NO. 2, MARCH 1980

111