Post Reply 
Magic Square, No Center
07-30-2018, 01:26 PM
Post: #1
Magic Square, No Center
This is a slightly revised 4-sided zigzag problem: (see July 2018 little math problem)
This have wonderful symmetries ...

ABC
H D
GFE

All sides sum to the same number S
Variable values between 1 to 8, all different:

Hint: search for as many symmetries as you can.

I have an elegant solution, only 12 cases to check (will post later ...)
Find all posts by this user
Quote this message in a reply
07-30-2018, 07:33 PM (This post was last modified: 07-30-2018 08:11 PM by ijabbott.)
Post: #2
RE: Magic Square, No Center
I get a total of 64 solutions: 4 (fundamental) * 2 (9's complement) * 8 (order of symmetry group of square).

EDIT: I just realized there are fewer than 64 due to overlapping symmetries. I make it 48 solutions now.

Code:
Spoiler
















The square has a symmetry group of order 8.  Each solution has a
corresponding solution with 9's complement of the digits.  To eliminate
the symmetries, the following restrictions can be imposed:

A < C
A < E
A < G
C < G

Also:

{ A B C D E F H G } = { 1 2 3 4 5 6 7 8 }
// set equality only, no mapping implied.

A + C != E + G // because B != F
A + G != C + E // because H != D

S = (36 + A + C + E + G) / 4 
S = 9 + (A + C + E + G) / 4
S mod 4 = 1
(A + C + E + G) mod 4 = 0

B = S - (A + C)
D = S - (C + E)
F = S - (E + G)
H = S - (G + A)

1 <= S - (A + C) <= 8
1 <= S - (C + E) <= 8
1 <= S - (E + G) <= 8
1 <= S - (G + A) <= 8

So:

S - 8 <= A + C <= S - 1
S - 8 <= C + E <= S - 1
S - 8 <= E + G <= S - 1
S - 8 <= G + A <= S - 1

Smallest sum of A + C + E + G divisible by 4 is 1 + 2 + 3 + 6 = 12,
giving a minimum S of 12 (= 9 + 12 / 4).

Largest sum of A + C + E + G divisible by 4 with A < C, A < E, C < G is
4 + 7 + 5 + 8 = 24, giving a maximum S of 15 (= 9 + 24 / 4).

When S = 12:
4 <= A + C <= 11
4 <= C + E <= 11
4 <= E + G <= 11
4 <= G + A <= 11

When S = 13:
5 <= A + C <= 12
5 <= C + E <= 12
5 <= E + G <= 12
5 <= G + A <= 12

When S = 14:
6 <= A + C <= 13
6 <= C + E <= 13
6 <= E + G <= 13
6 <= G + A <= 13

When S = 15:
7 <= A + C <= 14
7 <= C + E <= 14
7 <= E + G <= 14
7 <= G + A <= 14

Candidates for different A, C, E, G, with corresponding B, D, F, H.
Solutions marked with '**'

S  (A)B(C)D(E)F(G)H
12 (1)8(3)7(2)4(6)5 **
13 (1)8(4)6(3)2(8)4
13 (1)8(4)4(5)2(6)6
13 (1)8(4)3(6)2(5)7 **
13 (1)7(5)6(2)3(8)4 **
13 (1)7(5)4(4)3(6)6
14 (1)7(6)3(5)1(8)5
13 (2)8(3)6(4)2(7)4
13 (2)8(3)4(6)2(5)6
13 (2)8(3)3(7)2(4)7
13 (2)7(4)6(3)3(7)4
14 (2)7(5)3(6)1(7)5
14 (2)7(5)2(7)1(6)6
14 (2)6(6)3(5)2(7)5
14 (3)7(4)5(5)1(8)3
14 (3)7(4)3(7)1(6)5
14 (3)7(4)2(8)1(5)6 **
14 (3)6(5)5(4)2(8)3
15 (4)4(7)3(5)2(8)3

Solutions marked above:

 183    184    175    374
 5 7    7 3    4 6    6 2
 642    526    832    518
(S=12) (S=13) (S=13) (S=14)
        *A*           *B*

9's complement solutions:

 816    815    824    625
 4 2    2 6    5 3    3 7
 357    473    167    481
(S=15) (S=14) (S=14) (S=13)
        *B*           *A*

Imagine all the above rotated through 0, 90, 180, or 270 degrees (4
possibilities), and reflected or reflected (2 possibilities). That is
the symmetries of the square, which is of order 8.

However, two of the 9's complement solutions marked '*A*' and '*B*'
above are 180 degree rotations of the non-complement solutions, so
there are only 6 unique non-complement + 9's complement solutions.

Total solutions = 6 * 8 = 48.

— Ian Abbott
Find all posts by this user
Quote this message in a reply
07-30-2018, 09:44 PM
Post: #3
RE: Magic Square, No Center
Hi, ijabbott:

I am glad you do the puzzle the old fashion way, and not "brute force" it.
How to do grade this puzzle ... Is it good ?

48 is correct ! (3 primary solutions x 16 = 48)

However, some issues before you win the jackpot
  • Why 9-complement symmetries not overlap at the center ? (like the odd-sided zigzag puzzle)
    In other words, can you really recover 48 unique solutions ?
  • When you realized your solutions had overlap, how to you spot it ?
    Checking primary solutions for overlap is a bad idea, as it may not be easy to spot.
  • How to get "reflected" solutions (if not careful, reflection will overlap rotation symmetry)
  • Bonus: you are not fully using 9-complement symmetry, with it, your tests can be cut in half.
  • Bonus: there is an identity you are not seeing. If you spot it, tests can be reduced to 4.
    Hint: calculate B+F and D+H
BTW, you might have missed a case, or maybe too trivial to show it.
Tests should be an even number, due to 9-complement symmetry. 19 does not sound right.
Find all posts by this user
Quote this message in a reply
07-30-2018, 11:41 PM
Post: #4
RE: Magic Square, No Center
(07-30-2018 09:44 PM)Albert Chan Wrote:  Hi, ijabbott:

I am glad you do the puzzle the old fashion way, and not "brute force" it.
How to do grade this puzzle ... Is it good ?

48 is correct ! (3 primary solutions x 16 = 48)

However, some issues before you win the jackpot
  1. Why 9-complement symmetries not overlap at the center ? (like the odd-sided zigzag puzzle)
    In other words, can you really recover 48 unique solutions ?
  2. When you realized your solutions had overlap, how to you spot it ?
    Checking primary solutions for overlap is a bad idea, as it may not be easy to spot.
  3. How to get "reflected" solutions (if not careful, reflection will overlap rotation symmetry)
  4. Bonus: you are not fully using 9-complement symmetry, with it, your tests can be cut in half.
  5. Bonus: there is an identity you are not seeing. If you spot it, tests can be reduced to 4.
    Hint: calculate B+F and D+H

BTW, you might have missed a case, or maybe too trivial to show it.
Tests should be an even number, due to 9-complement symmetry. 19 does not sound right.

(I changed your list to a numbered list for reference.)

  1. Because there is no center? (Not sure I understood.)
  2. Visually.
  3. A rotation is the same as an even number of reflections, so a single reflection will not overlap any rotation.
  4. I need sleep!
  5. Ditto!

I missed "12 (1)7(4)6(2)5(5)6" from my check list.

— Ian Abbott
Find all posts by this user
Quote this message in a reply
07-30-2018, 11:58 PM (This post was last modified: 07-31-2018 12:07 AM by Albert Chan.)
Post: #5
RE: Magic Square, No Center
Here is my answer to the puzzle.

Code:


*** Spoiler Alert ***

Four sides of square:

S = A + B + C
S = E + D + C
S = E + F + G
S = A + H + G

A + B + C + D + E + F + G + H = sum(1 to 8) = 9 * 4 = 36

4*S = 36 + A+C+E+G
    = (36 + 1+2+3+4) to (36 + 5+6+7+8)
    = 46 to 62
    = 48 to 60
  S = 12, 13, 14, 15

Center digits = 36 / 8 = 4.5 (not an integer!)

No sum will get exactly to the center
-> 9-Complement Symmetry guaranteed unique solutions.
-> We only need to solve S <= center = 3 * 4.5 = 13.5

Symmetries                              DERIVE SOLUTIONS
==========                              ================
9-Complement => S = 12, 13              99999999 - ABCDEFGH
Rotation     => A = smallest corner     GHABCDEF, EFGHABCD, CDEFGHAB
Flip Square  => C < G                   AHGFEDCB (flip on AE diagonal)

Each primary solution thus represent 2 * 4 * 2 = 16 solutions

A+C+E+G is a bit too many permutations to work with, so change it:

4*S = 36 + A+C + E+G = 36 + (S-B) + (S-F)
2*S = 36 - B - F
B+F = 36 - 2*S

4*S = 36 + C+E + G+A = 36 + (S-D) + (S-H)
2*S = 36 - D - H
D+H = 36 - 2*S

When S = 12, B+F = D+H = 36-24 = 12 = 4+8 = 5+7
Digits 1236 is missing, thus ACEG = 1236 (BFDH took away 4578)

With symmetries (A=1, C<G), only 3 checks needed:

1 2 3(3)6
1 2 6(3)3
1(8)3(7)2(4)6 <= OK

When S = 13, B+F = D+H = 36-26 = 10 = 2+8 = 3+7 = 4+6
Digits 15 is missing, possible ACEG = 1528, 1537, 1546

1(7)5(6)2(3)8 <= OK
1 2 5(0)8
1 2 8(0)5

1 5(5)3 7
1 3(5)5 7
1 3(3)7 5

1 5(4)4 6
1 4(4)5 6
1(8)4(3)6(2)5 <= OK

Thus, we have 3 primary solutions:

183   175   184
5 7   4 6   7 3
642   832   526

Apply symmetries, total solutions = 3*16 = 48
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)