Talk:Most-perfect magic square

message: {| border="1" cellpadding="3" cellspacing="0" align="center" style="background:black; color:white"	  	  	
9 	14	3 	4
2 	5 	8 	15
12	11	6 	1
7 	0 	13	10
{| border="1" cellpadding="3" cellspacing="0" align="center" style="background:black; color:white"	  	  	
14	5 	8 	3
9 	2 	15	4
7 	12	1 	10
0 	11	6 	13
:::::: Hello! I created some templates to illustrate some special properties of the 4x4 type Most-perfect magic squares.
:::::: With the availability of <inputbox> (meta:Help:inputbox) and its expected improvements "one click previews" for these properties could be generated without overloading the page.
:::::: Please let me know if you have some time to generate more of the required templates and to work on this page. Please drop a note at meta:examples. Thanks in advance. Best regards Gangleri | [ Th] | T 09:45, 14 July 2005 (UTC)
replies: text:  Tip: to see how to use the templates, edit this item.  Templates used are listed at the bottom of the page -- LarryLACa 18:33, 4 November 2005 (UTC)
thread_title:  Templates 

message: You ask on Meta:Babel about if their is some interest in the Jain magic squares.
I guess that there is some call for a curtural note on the use of these squares in Jain tradition, with some references and explaining a bit more about the cultural and cosmological significance.
A few Q's: 
Whats the significance of 384 is it the number of different Jain squares?
Some of the examples show negative numbers and are hence not technically Most Perfect Magic Squares.
I didn't really understand the special properties of the squares, 
"fractional mirroring NW - SE" etc. Are these ways to generate new squares?
I suggest that the info be removed from Meta:Babel, its not really appropriate there. Also see the editoral guidlines, for what should and should not be included.
Pfafrich 09:50, 6 August 2005 (UTC)
thread_title:  Comments on Jain Squares 

message: * Analysing the algorithm it can be seen that the number of generated squares is either
# 2n!*22n for n = 2 and n = 3
# 16*2n!*22n for n > 3
* An example of an most-perfect magic square which will not be generated by this algorithm is mentioned at the end of de: ... Beispiele pandiagionaler magischer Quadrate und einiges zu deren Analysemethoden. It can be seen that the value 126 which is half the value equivalent to the magic constant does not occur as sume of four "consecutive" values in any column.
* An implementation was made at http://easy.go.is/gangleri/ferningar/ around end of 2003 in phtml. Some examples from  (all using random values) as  or  are displaying squares using a 3D effect.
: parameters:
:# "&x_signs=" alows different representations:
:## default (absent), &x_signs=0 or &x_signs=1 values from 1 to 2n
:## &x_signs=2 values from 0 to 2n - 1
:## &x_signs=3 (negative an positive) odd value representation
:# "&x_max_tables=99" shows intermediate steps in the generation; this parameter is overwritten for 4x4 sqaures
:# "&x_square_type=" defines the order of the square: 0 for 4x4, 1 for 8x8, 2 for 16x16, 3 for 32x32, 4 for 64x64 and 5 for 128x128
:: Enjoy!  Gangleri | [ Th] | T 18:08, 10 August 2005 (UTC)
thread_title:  notes 

message: * To be continued after feedback from meta:Help talk:Table. Regards Gangleri | [ Th] | T 19:59, 16 August 2005 (UTC)
thread_title:  about the unique binary pattern 

message: Only Three Squares, Only One Pattern shows that the 4x4 most-perfect magic squares have only one underlaying pattern. To ilustrate this please take a look at the binary representation of one of these squares:
{| border="1" cellpadding="3" cellspacing="7" align="left" style="background:efefef; color:black"	 	      	                   	 	
{| border="1" cellpadding="3" cellspacing="0" align="center" style="background:efefef; color:black;	 	      	                   	 	
a div 8 = 1        	→	 	a div 8 = 0        	→	 
(a mod 8) div 4 = 1	→	 	(a mod 8) div 4 = 0	→	 
(a mod 4) div 2 = 1	→	 	(a mod 4) div 2 = 0	→	 
a mod 2 = 1        	→	 	a mod 2 = 0        	→	 
We can see that each of the colors occur only two times in each row, each column and in each of the diagonals. We can verify how the pattern relates to all of the broken diagonals and to the 16 2x2 subsquares using wrap around. In all these "entities" we have each color only two times. This means that you can change the coding of the pattern:
a) changing "a div 8 = 1 with "a mod 2 = 1" and vice versa would give the square:
 1	15	 4	10
 6	 8	 3	13
11	 5	14	 0
12	 2	 9	 7
If we "change" only the weights for the binary representation we will have 4! permutations and the values "0" and "15" will be always fixed.
b) changing "a mod 2 = 1 with "a mod 2 = 0" and vice versa would give the square:
 9	14	 5	 2
 7	 0	11	12
10	13	 6	 1
 4	 3	 8	15
We can see that doing this there are 16 times more possibilities. Gangleri | [ Th] | T 22:34, 16 August 2005 (UTC)
thread_title:  Only Three Squares, Only One Pattern 

message: A good approach to understand the method described below would be to visit the page The 8x8 Pan-Magic Squares. However it is about constructing panmagic squares and not most-perfect magic squares (the last term seems to be used the first time by Henry Ernest Dudeney – see ).
The site is using the representations of the squares with values from 0 to n2 and the term "carpets". We should note that for the generation of most-perfect magic squares no carpet containing a 2x2 subsquare like
1 1
1 1
can be used (in general). If that carpet would be used together with the value 22n-1 the sum of this subsquare would be for this carpet already 22n+1 which is greather then 2(22n-1) – this is 22n+1 - 2 – the maximum sum allowed for a 2x2 subsquare inside the final most-perfect magic square. Requirement a) would be that such a pattern would never occur.
Note that not all listed (panmagic) carpets fulfill "for every cell a the cell located at n/2 rows and n/2 columns is the complement of a". This would be requirement b) which is a requirement from the definition of most-perfect magic squares.
Clasifying the carpets who fulfills a) and b) we find some which can be decomposed
M    M
c(M) c(M)
– lets talk about as "type v" (v from vertical) – and others which can be decomposed as
M c(M)
M c(M)
– lets talk about as "type h" (v from horizontal) – where c(M) is a subsquare replacing all values with their binary complement.
The task mentioned at the page is to find all carpets and to find a way how to select the "usefull subsets" to generate the squares of the required type.
It can be noticed that if you take two of the carpets A and B which fulfill a) and b) the following can happen:
:c1) the number of cells where the value in both carpets is 0 is 22n - 2
:c2) the number of cells where the value in both carpets is 1 is 22n - 2
:c3) the number of cells where the value A is 0 the value B is 1 is 22n - 2
:c4) the number of cells where the value A is 1 the value B is 0 is 22n - 2
Last condition is fulfilled automatically if c1) and c2) and c3) is fulfilled.
This would be requirement c). Note this is a "symmetrical" condition. Note that neither the pair (A, A) nor pair (A, c(A)) fullfils c). Take some time to understand that you may "swap" to raws which are in a distance of n/2 raws in a carpet of "type v" (up to n/2 such "independend and commutative" transitions are possible) and you may "swap" to colums which are in a distance of n/2 colums in a carpet of "type h" (up to n/2 such "independend and commutative" transitions are possible) but not vice versa – columns in a distance of n/2 columns in a carpet of "type v" have the same content and raws in a distance of n/2 raws in a carpet of "type h" have same content too.
"Swaping" two raws which are in a distance of n/2 or two columns which are in a distance of n/2 is a usefull technique to be used with squares which fulfill b) and can be used to expand the first algorithm described on this page. The total number of these transitions (for squares) is "n" – not to be confused with the discussion from above relating to carpets. The algebraic closure of the composition should be handeled later.
Please note that if we take a carpet of "type v" and "swap" only two raws the values for 3/4 of all cells will be unchanged while 1/4 will "toggle" to the complement of these cells.
To identify the / all carpets of "type h" respective all of "type v" we should remember that the final goal here is to generate a "most perfect magic square". Similar to requirement a) we should realise that every raw and column must contain exactly n/2 cells with value "0" and exactly n/2 cells with value "1".
A (general?) solution to construct carpets of "type h" would be as follow:
a00    a01    a02    a0(n/2)    c(a00) c(a01) c(a02) c(a0(n/2))
c(a00) c(a01) c(a02) c(a0(n/2)) a00    a01    a02    a0(n/2)
Only these two raws would be used to fill the carpet. The number of such carpets is 2n/2. If this is the general solution it should be possible to proof it (with mathematical induction ?).
The carpets of "type v" are the transposed of the carpets of "type h". Note that the transposition is an isomorphism transition, the number of such carpets is 2n/2 too. The number of zeros and ones in the raws of "type v" is balanced, else they would be of no use.
There are some interesting properties:
: Every carpet A and its transposition fulfills c).
: Every pair of carpets (A, B) where A is of "type h" and B is of "type v" (or vice versa) fullfills c).
=== selecting "usefull subsets" of carpets ===
To describe the general case lets take first carpet A from the 2n/2 of "type h" as the "first" carpet. The first values in A represents as "a00    a01    a02    a0(n/2)".
Let us take as second carpet a carpet of "type h" where half of the values of "a00    a01    a02    a0(n/2)" are preserved and the other half of the values is exchanged with their complement. For n=3 we would have 6 (3!) carpets to choose from.
To understand the method lets continue with the case n=3. As 3rd carpet we select a carpet of "type h" to filfill the following conditions:
: we preserve one of the two values preserved in the second selection together with one of the two values we have exchanged with its complement in the second selection
: the other two values are exchanged with their complement
There are 4 (22) possibilities to do so. We see that all pairs of these three carpets fulfill c) and it would not be possible to find another carpet of "type h" which would fulfill c) in combination with the three already found.
We have the coice to select other three carpets of "type v" in a similar way. Then we can assign (binary) "weights" to the carpets. By multiplying the "weights" with the carpets and adding all results together we get a new square. Due to construction we have generated a most-perfect magic square.
In order to count the generated squares we should note that the way / the order we selected the "usefull" set of carpets is not relevant when we generate the squares.
Regards Gangleri | [ Th] | T 10:29, 20 August 2005 (UTC)
thread_title:  more advanced (/ general?) method for the generation of most-perfect magic squares of order 2<sup>n</sup> 

message: To describe the general case lets take first carpet A from the 2n/2 of "type h" as the "first" carpet. The first values in A represents as "a00    a01    a02    a0(n/2)".
Let us take as second carpet a carpet of "type h" where half of the values of "a00    a01    a02    a0(n/2)" are preserved and the other half of the values is exchanged with their complement. For n=3 we would have 6 (3!) carpets to choose from.
To understand the method lets continue with the case n=3. As 3rd carpet we select a carpet of "type h" to filfill the following conditions:
: we preserve one of the two values preserved in the second selection together with one of the two values we have exchanged with its complement in the second selection
: the other two values are exchanged with their complement
There are 4 (22) possibilities to do so. We see that all pairs of these three carpets fulfill c) and it would not be possible to find another carpet of "type h" which would fulfill c) in combination with the three already found.
We have the coice to select other three carpets of "type v" in a similar way. Then we can assign (binary) "weights" to the carpets. By multiplying the "weights" with the carpets and adding all results together we get a new square. Due to construction we have generated a most-perfect magic square.
In order to count the generated squares we should note that the way / the order we selected the "usefull" set of carpets is not relevant when we generate the squares.
Regards Gangleri | [ Th] | T 10:29, 20 August 2005 (UTC)
thread_title:  selecting "''usefull subsets''" of carpets 

message: Hello fellow Wikipedians,
I have just modified one external link on Most-perfect magic square. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
*Added archive https://web.archive.org/web/20100225233941/http://www.surabooks.com/ProductDisplay.asp?RefID=2800 to http://www.surabooks.com/ProductDisplay.asp?RefID=2800
When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.
Cheers.—InternetArchiveBot (Report bug) 07:49, 6 February 2018 (UTC)
thread_title:  External links modified (February 2018) 

message: The article starts: ... satisfying the additional three properties
# ...
# ...
and that's all. There is no third property, and neither 1° nor 2° are of the form " XXX and YYY ". — MFH:Talk 00:06, 21 October 2018 (UTC)
thread_title:  what third property ? 

message: hi!  is a reference to a historical article about most perfect magical squares. regards 62.246.132.211 (talk) 17:09, 23 May 2024 (UTC)
thread_title:  Nasik square historical article