Open access peer-reviewed chapter

Nullspace of Compound Magic Squares

By Saleem Al-Ashhab

Submitted: October 1st 2017Reviewed: January 30th 2018Published: August 29th 2018

DOI: 10.5772/intechopen.74678

Downloaded: 210

Abstract

In this chapter, we consider special compound 4 n × 4 n magic squares. We determine a 2 n − 3 dimensional subspace of the nullspace of the 4 n × 4 n squares. All vectors in the subspaces possess the property that the sum of all entries of each vector equals zero.

Keywords

  • null space
  • magic squares
  • mathematical induction

1. Introduction

A semi-magic square is an n× nmatrix such that the sum of the entries in each row and column is the same. The common value is called the magic constant. If, in addition, the sum of all entries in each left-broken diagonal and each right-broken diagonal is the magic constant, then we call the matrix a pandiagonal magic square. Rosser and Walker show that a pandiagonal 4×4magic square with magic constant 2shas in general the following structure.

ABCω
Eθςρ
s − Cs − ωs − As − B
s − ςs − ρs − Es − θ

where

ω=2sABC;
θ=2sABE;
ς=A+EC;
ρ=B+CE.

This result was developed by Rosser and Walker. Hendricks proved that the determinant of a pandiagonal magic square is zero. We note that every antipodal pair of elements add up to one-half of the magic constant. Al-Amerie considered in his M.Sc thesis some of the results here. There are three fundamental primitive pandiagonal squares which are 4 × 4. Kraitchik (see [3, 8]) has shown how to derive all pandiagonal squares from three particular ones.

We define a certain class of 6×6magic squares, which has a similar structure to the structure of a pandiagonal 4×4magic square. In this class each antipodal pair will add up to one-third of the magic constant. Precisely, we have:

Definition 1: A 6×6magic square with 3sas a magic constant is called panmagic if

aij+akl=s,for eachi,j,k,lsuch thatikmod3andjlmod3.

The following matrix is a possible form for this kind of squares:

MRWTLK
QJIHGF
PEDCBA
sTsLsKsMsRsW
sHsGsFsQsJsI
sCsBsAsPsEsD

where

M=J+I+H+E+D+CLK3s2,
W=KI+FD+A,
P=3sEDCBA
Q=3sJIHGF,
R=LJ+GE+B,
T=9s2LKHGFCBA.

Note that we have the following relations:

M+Q+P=T+H+C,R+J+E=L+G+B,W+I+D=K+F+A.E1

Using Maple we can show that the 6×6panmagic square possesses a nontrivial null space, which can be written in the following form:

zx1x2x3x1x2x3:zR

where

x1=ADGJBEIF,x2=FIB+2C+E3s+2FD2AI+DAG+J+2H3s,x3=BEF+I+2H+A+D+2C+2B+2E3sJG.

Note that the sum of all entries of the vectors is zero. For example:

−5139260913
54−10−2−54−5
−51231718
123−163−27−14
17817−422214
9−5−6171110

has as nullspace z3411513234115132t:zR.

Definition 2: A 8×8square consisting of 4 pandiagonal magic squares A11,A12,A21,A22having the same magic sum in the form

A11A12A21A22

is called a compound magic square if the following relation holds:

A22+A11=A12+A21.

It is easy to check if the last relation guarantees that the square is a magic 8 × 8 square. In the same manner we can combine four panmagic squares in a magic square.

Definition 3: Let B22,B11,B12,B21be panmagic squares having the same magic constant. Assume that B22+B11=B12+B21. Then the matrix

B11B12B21B22

is called the compound 12×12magic square.

The condition B22+B11=B12+B21ensures that the compound 12×12magic square is magic.

2. Main results

We prove first a simple result for a compound square of 4×4squares. We then generalize this result for an arbitrary number of squares.

Proposition 1: The compound 8×8magic square processes a three-dimensional subspace of its nullspace.

Proof: First we note that the vector

11111111

is a nonzero vector, which belongs to the nullspace of the square, since the squares have the same magic constant.

Now, the square A11(res. A12) has a nonzero vector v11(res. v12), which belongs to the nullspace of the square, since A11(res. A12) is a pandiagonal magic square. We look for four numbers f11,f12,f21,f22such that the vector

f11v11+f12v12f21v11+f22v12

belongs to the nullspace of the square. To do this we compute the following matrix multiplication:

A11A12A21A22f11v11+f12v12f21v11+f22v12=A11f11v11+f12v12+A12f21v11+f22v12A21f11v11+f12v12+A22f21v11+f22v12

According to the choice of v11and v12we obtain the vector g1g2as the result of matrix multiplication, where:

g1=A11f12v12+A12f21v11,g2=A21v11f11+A21v12f12+A12v11+A21v11f21+A21v12A11v12f22.

Note that we used the relation A22=A12+A21A11. We can rewrite the vector g1g2in the form.

0A11v12A12v110A21v11A21v12A12+A21v11A21A11v12f11f12f21f22E2

According to Al-Ashhab (see [3]) we can assume that the vectors in the nullspace of the pandiagonal magic square are

vij=vijvijvijvij,fori=1,j=1,2

Further, we can assume that

Aij=aijbijcijdijeijfijgijhijscijsdijsaijsbijsgijshijseijsfij,i,j=1,2

Hence, we can assume that:

Aijvij=aijvij+bijvijcijvijdijvijeijvij+fijvijgijvijhijvijcijvijdijvij+aijvij+bijvijgijvijhijvij+eijvij+fijvij=aijcijvij+bijdijvijeijgijvij+fijhijvijaijcijvijbijdijvijeijgijvijfijhijvij

Since the sum of two pandiagonal magic squares is pandiagonal magic, we deduce that four rows in the matrix in Eq. (2) are redundant. Since we have the relations

a11+e11=c11+g11a11c11=e11g11b11+f11=d11+h11b11d11=f11h11

the application of elementary row operations on the matrix in Eq. (2) yields to

0r12r210q11q12r21+q11q12r12000000000000000000000000

where

r12=a11c11v12+b11d11v12r21=a12c12v11+b12d12v11q11=a21c21v11+b21d21v11q12=a21c21v12+b21d21v12

This analysis enables us to conclude the following relations from (2):

f11=r12r21+q11r12q12r21q11r12f21+q12+r12q11f22,f12=r21r12f21.

If we set

f12=0,f21=0,f22=q11,f11=r12q12,

which is consistent with the previous relations, we conclude that the vector

r12q12v11q11v12

belongs to the nullspace of the square. We can make another choice as follows.

f22=0,f21=r12q11,f12=r21q11,f11=r21q12r12r21+q11

and we obtain a vector belonging to the nullspace of the square, which is

r21q12r12r21+q11v11r21q11v12r21q11v11

Now, the vectors v12,v11are linearly independent, since they correspond to different magic squares. Hence, the last two vectors are linearly independent. Also the vector

11111111

is linearly independent with the last two vectors, since its first two entries are not the opposite of the third and fourth entry. ⎕

For example, the following square is a compound 8×8magic square.

014−1913105−2215
−12677−2013123
23−94−1026−11−6−1
−3−316−2−8124−9
−1625−1716−616−2018
1−227−7573
21−1220−2124−1410−12
2−336−3111−1

For this square we can construct as described the following two vectors in its nullspace

38572253857225170544170544t
21600658502652160065850265377471706377471706t

In fact, its nullity is 3. Thus, these two vectors together with

11111111

form a basis of its nullspace.

We prove now a similar result to the previous proposition, where we replace the 4×4square with a 6×6one.

Proposition 2: The compound 12×12magic square possess a three-dimensional subspace of its nullspace.

Proof: First we note that the vector

111111111111

is a nonzero vector, which belongs to the nullspace of the square, since the squares have the same magic constant.

We look for scalars v1,v2,v3,v4,v5,v6such that

a11b11c11d11e11f11a12b12c12d12e12f12g11h11i11j11k11l11g12h12i12j12k12l12m11n11o11p11q11r11m12n12o12p12q12r12sd11se11sf11sa11sb11sc11sd12se12sf12sa12sb12sc12sj11sk11sl11sg11sh11si11sj12sk12sl12sg12sh12si12sp11sq11sr11sm11sn11so11sp12sq12sr12sm12sn12so12a21b21c21d21e21f21a22b22c22d22e22f22g21h21i21j21k21l21g22h22i22j22k22l22m21n21o21p21q21r21m22n22o22p22q22r22sd21se21sf21sa21sb11sc21sd22se22sf22sa22sb22sc22sj21sk21sl21sg21sh21si21sj22sk22sl22sg22sh22si22sp21sq21sr21sm21sn21so21sp22sq22sr22sm22sn22so22.v1v2v3v1v2v3v4v5v6v4v5v6=000000000000

We transform this equation into a linear system, in which we eliminate the redundant equations. The system becomes

a11d11v1+b11e11v2+c11f11v3+a12d12v4+b12e12v5+c12f12v6=0g11j11v1+h11k11v2+i11l11v3+g12j12v4+h12k12v5+i12l12v6=0m11p11v1+n11q11v2+o11r11v3+m12p12v4+n12q12v5+o12r12v6=0a21d21v1+b21e21v2+c21f21v3+a22d22v4+b22e22v5+c22f22v6=0g21j21v1+h21k21v2+i21l21v3+g22j22v4+h22k22v5+i22l22v6=0m21p21v1+n21q21v2+o21r21v3+m22p22v4+n22q22v5+o22r22v6=0

From the definition of the panmagic square we know that

aij+gij+mij=dij+jij+pijaijdij+gijjij=mijpijE3
bij+hij+nij=eij+kij+qijbijeij+hijeij=nijqijE4
cij+lij+oij=fij+lij+rijcijfij+iijlij=oijrijE5

Thus, due to Eqs. (3)(5), we can reduce the linear system to the following

a11d11v1+b11e11v2+c11f11v3+a12d12v4+b12e12v5+c12f12v6=0g11j11v1+h11k11v2+i11l11v3+g12j12v4+h12k12v5+i12l12v6=0a21d21v1+b21e21v2+c21f21v3+a22d22v4+b22e22v5+c22f22v6=0g21j21v1+h21k21v2+i21l21v3+g22j22v4+h22k22v5+i22l22v6=0

We can verify using the computer that the coefficient matrix of this system has in general the rank four. Hence, we deduce that v1,v2,v3,v4depends on v5and v6. By letting v5and v6take the values 0 and 1 we obtain two linearly independent vectors in the nullspace. These two vectors do not possess the property that the first six elements are the opposite of the last six elements. Hence, they are independent of the vector 111111111111.⎕

Remark: We did not here make use of the relation B22+B11=B12+B21. It actually does not affect the proof.

For example, the following square is a compound 12×12magic square.

−513926091361715−604
54−10−2−54−52052090
−51231718−246781920
123−163−27−14181286−5−3
17817−42221412312−8710
9−5−61711104−7−83665
25345−1313334593134−1372425
−10010111213−441514161718
−892122232930−1082627283132
143−21−2210−41−33149−12−13−47−19−22
10−122122−4−5−656−3−2
−11−17−18101−9−10−16−19−20120−14−15

Using the computer we can verify that its nullity is 3. In other words, the constructed subspace is the nullspace itself.

We can generalize the previous result for an arbitrary number of squares involved in the compound square.

Theorem 1: Let Aijbe the distinct pandiagonal magic square with magic constant 2shaving the structure:

Aij=aijbijcijdijeijfijgijhijscijsdijsaijsbijsgijshijseijsfij

such that Aij=A1j+Ai1A11for i,j=1,,n. Assume that a11+c12c11a120. Then, the following 4n× 4nmatrix

A11A12A13A1nA21A22A23A2nA31A32A33A3nAn1An2An3Ann

possesses a 2n3dimensional subspace of its nullspace, which is generated by the vectors

b11d11b12+d12a11+c12c11a12b11d11b12+d12a11+c12c11a12b11d11b12+d12a11+c12c11a12b11d11b12+d12a11+c12c11a1200

and

a12+c13c12a130a12+c13c12a130a11c11+c13a130a11c11+c13a130a11+c12c11a120a11+c12c11a12000,b11d11b13+d13a11+c12c11a12b11d11b13+d13a11+c12c11a12b11d11b13+d130b11d11b13+d1300a11+c12c11a120a11+c12c11a1200,,a12+c1nc12a1n0a12+c1nc12a1n0a11c11+c1na1n0a11c11+c1na1n000a11+c12c11a120a11+c12c11a120,b11d11b1n+d1na11+c12c11a12b11d11b1n+d1na11+c12c11a12b11d11b1n+d1n0b11d11b1n+d1n0000a11+c12c11a120a11+c12c11a12

Proof: We will check first that these vectors belong to the nullspace of the matrix. When we multiply the first vector with the matrix, we obtain a vector having in the first row

a11c11b11d11b12+d12+b11d11a11c11a12+c12a12c12b11d11b12+d12b12d12a11c11a12+c12=b11d11b12+d12a11c11a12c12a11c11a12+c12b11d11b12d12=0

Since we know that

a11c11=e11g11,b11d11=f11h11.

we obtain zero in the second row of the vector. Since the third and fourth rows of the squares are complementary to the first two rows, we deduce that the third and fourth rows of the vector are also zero. Now, the fifth entry of the vector is

a21c21b11d11b12+d12+b21d21a11c11a12+c12a22c22b11d11b12+d12b22d22a11c11a12+c12=b11d11b12+d12a21c21a22c22a11c11a12+c12b21d21b22d22

We use the following relations according to our assumption

a22=a12+a21a11,b22=b12+b21b11,c22=c12+c21c11,d22=d12+d21d11.

and obtain

b11d11b12+d12a21c21a12+a21a11c12c21+c11a11c11a12+c12b21d21b12+b21b11d12d21+d11=b11d11b12+d12a12a11c12+c11{a11c11a12+c12b12b11d12+d11}=0

We continue checking all rows until we reach the last entry, which is

an1cn1b11d11b12+d12+bn1dn1a11c11a12+c12an2cn2b11d11b12+d12bn2dn2a11c11a12+c12=b11d11b12+d12an1cn1an2cn2{a11c11a12+c12bn1dn1bn2dn2}

We use

an2=a12+an1a11,bn2=b12+bn1b11,cn2=c12+cn1c11,dn2=d12+dn1d11.

in order to obtain this value of the entry

b11d11b12+d12an1cn1a12+an1a11c12cn1+c11a11c11a12+c12bn1dn1b12+bn1b11d12dn1+d11=b11d11b12+d12a12a11c12+c11{a11c11a12+c12b12b11d12+d11}=0

Hence, we finished checking the first vector.

Now, we turn our attention to the second vector. When we multiply the matrix with it, we obtain in the first entry.

Using the relations

a11c11=e11g11b11d11=f11h11

we deduce that the second entry is also zero. In a similar manner we can deal with the third and fourth entries. The fifth entry will be

a21c21a12c12a13+c13a22c22a11c11a13+c13+a23c23a11c11a12+c12

We use the relations

a22=a12+a21a11,c22=c12+c21c11a23=a13+a21a11,c23=c13+c21c11

to obtain for the fifth entry.

=a21c21a12c12a13c13a12+a21a11c12c21+c11a11c11a13c13+a13+a21a11c13c21+c11a11c11a12c12=a21c21a12c12a21c21a13c13a21c21a11c11+a21c21a13c13a12c12a11c11+a12c12a13c13+a11c112+a11c11a13c13+a13c13a11c11a13c13a12c12+a21c21a11c11a21c21a12c12a11c112+a12c12a11c11=0

We continue checking the entries until we reach the last entry, which is

an1cn1a12c12a13+c13an2cn2a11c11a13+c13+an3cn3a11c11a12+c12

Using the relations

an2=a12+an1a11,cn2=c12+cn1c11an3=a13+an1a11,cn3=c13+cn1c11

we get

=an1cn1a12c12a13c13a12+an1a11c12cn1+c11a11c11a13c13+a13+an1a11c13cn1+c11a11c11a12c12=an1cn1a12c12an1cn1a13c13an1cn1a11c11+an1cn1a13c13a12c12a11c11+a12c12a13c13+a11c112+a11c11a13c13+a13c13a11c11a13c13a12c12+an1cn1a11c11an1cn1a12c12a11c112+a12c12a11c11=0

Hence, the second vector belongs to the nullspace of the (4n×4n)-matrix.

Similarly, we can check that all the other vectors are included in the nullspace of the (4n×4n)-matrix. We check the last vector (the (2n3)-th vector) belongs to the nullspace of the (4n × 4n)-matrix. The first entry by matrix multiplication is:

a11c11b11d11b1n+d1n+b11d11a11c11a12+c12a12c12b11d11b1n+d1nb1nd1na11c11a12+c12=b11d11b1n+d1na11c11a12c12{a11c11a12+c12b11d11b1nd1n}=0

As before we deduce also that the second, third, and fourth entries are zero. The fifth entry is

a21c21b11d11b1n+d1n+b21d21a11c11a12+c12a22c22b11d11b1n+d1nb2nd2na11c11a12+c12=b11d11b1n+d1na21c21a22c22{a11c11a12+c12b21d21b2nd2n}=b11d11b1n+d1na21c21a12+a21a11c12c21+c11

We use the relations

a22=a12+a21a11b2n=b1n+b21b11c22=c12+c21c11d2n=d1n+d21d11

Therefore, this entry is

b11d11b1n+d1na21c21a12+a21a11c12c21+c11a11c11a12+c12b21d21b1n+b21b11d1nd21+d11=b11d11b1n+d1na12a11c12+c11{a11c11a12+c12b1nb11d1n+d11}=0

When we reach the (2n3)th entry, we find that it is

an1cn1b11d11b1n+d1n+bn1dn1a11c11a12+c12anncnnb11d11b1n+d1nbnndnna11c11a12+c12=b11d11b1n+d1nan1cn1anncnna11c11a12+c12bn1dn1bnndnn

We use the relations

ann=a1n+an1a11bnn=b1n+bn1b11cnn=c1n+cn1c11dnn=d1n+dn1d11

to prove that this entry is

b11d11b1n+d1nan1cn1a12+an1a11c12cn1+c11a11c11a12+c12bn1dn1b1n+bn1b11d1ndn1+d11=b11d11b1n+d1na12a11c12+c11{a11c11a12+c12b1nb11d1n+d11}=0

We prove now that the vectors are linearly independent. Let k1,k2,k3,,k2n4,k2n3Rsuch that

k1b11d11b12+d12a11+c12c11a12b11d11b12+d12a11+c12c11a12b11d11b12+d12a11+c12c11a12b11d11b12+d12a11+c12c11a1200000000+k2a12+c13c12a130a12+c13c12a130a11c11+c13a130a11c11+c13a130a11+c12c11a120a11+c12c11a1200000++k2n3b11d11b1n+d1na11+c12c11a12b11d11b1n+d1na11+c12c11a12b11d11b1n+d1n0b11d11b1n+d1n000000a11+c12c11a120a11+c12c11a12=0000000000000000

This leads us to the following vector which is a zero vector.

k1b11d11b12+d12+k2a12+c13c12a13+k3b11d11b13+d13++k2n4a12+c1nc12a1n+k2n3b11d11b1n+d1nk1a11+c12c11a12k3a11+c12c11a12k2n3a11+c12c11a12k1b11d11b12+d12k2a12+c13c12a13k3b11d11b13+d13k2n4a12+c1nc12a1nk2n3b11d11b14+d1nk1a11+c12c11a12+k3a11+c12c11a12+k2n3a11+c12c11a12k1b11d11b12+d12k2a11c11+c13a13k3b11d11b13+d13k2n4a11c11+c1na1nk2n3b11d11b1n+d1nk1a11+c12c11a12k1b11d11b12+d12+k2a11c11+c13a13+k3b11d11b13+d13++k2n4a11c11+c1na1n+k2n3b11d11b1n+d1nk1a11+c12c11a12k2a11+c12c11a12k3a11+c12c11a12k2a11+c12c11a12k3a11+c12c11a12k2n4a11+c12c11a12k2n3a11+c12c11a12k2n4a11+c12c11a12k2n3a11+c12c11a12

From the (4n2)-th row of this vector we obtain the equation

k2n3a11+c12c11a12=0

According to our assumptions we must have k2n3=0. Similarly, we obtain k2n4=0from the (4n3)-th row. We continue checking all the rows up to the tenth row, which looks like this

k3a11+c12c11a12=0

Hence, we conclude that k3=0. From the ninth (res. eighth) row we obtain k2=0(res. k1=0). Since all k1,k2,k3,,k2n4,k2n3are zero, we are done.⎕

© 2018 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution 3.0 License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

How to cite and reference

Link to this chapter Copy to clipboard

Cite this chapter Copy to clipboard

Saleem Al-Ashhab (August 29th 2018). Nullspace of Compound Magic Squares, Matrix Theory - Applications and Theorems, Hassan A. Yasser, IntechOpen, DOI: 10.5772/intechopen.74678. Available from:

chapter statistics

210total chapter downloads

More statistics for editors and authors

Login to your personal dashboard for more detailed statistics on your publications.

Access personal reporting

Related Content

This Book

Next chapter

Nature of Phyllotaxy and Topology of H-matrix

By Ab. Hamid Ganie

Related Book

First chapter

3-Algebras in String Theory

By Matsuo Sato

We are IntechOpen, the world's leading publisher of Open Access books. Built by scientists, for scientists. Our readership spans scientists, professors, researchers, librarians, and students, as well as business professionals. We share our knowledge and peer-reveiwed research papers with libraries, scientific and engineering societies, and also work with corporate R&D departments and government entities.

More About Us