Page 2 of 2 FirstFirst 12
Results 16 to 28 of 28

Math Help - Regular Square Questions

  1. #16
    Member
    Joined
    Jun 2010
    From
    United States
    Posts
    200
    Quote Originally Posted by undefined View Post
    The program output given above is only base 4.
    So can your program also output the decimal square as well?
    Follow Math Help Forum on Facebook and Google+

  2. #17
    MHF Contributor undefined's Avatar
    Joined
    Mar 2010
    From
    Chicago
    Posts
    2,340
    Awards
    1
    The following two images should be enough to illustrate the remaining parts of the algorithm.

    So, once you have an arrangement for most significant digits, choose the top row of least significant digits, for example:

    Regular Square Questions-regsq3.png

    This corresponds with the beginning output of the program, above. (0's stand in for empty slots.)

    This is just one of 4! possibilities for the top row; the program is written to exhaustively try all of them. But as it turns out, the very first one produces a regular square.

    Now, consider that we only have two options for least significant digit for each cell.

    Regular Square Questions-regsq4.png

    To see why, consider the cell in the second row, first column, containing the numbers 1 (blue) 2 3 (red). We can't have 11 because that's already in the first row. And we can't have 10 because we already used 0 as least significant digit in the first row, for that column. So that leaves 12 and 13.

    Now, suppose we choose 12 to go into that cell. Then notice that the cell in row 4, column 1 must become 31. Consequently the cell in row 3, column 1 must become 23. Do this throughout the entire square and see that choosing that initial 2 in row 2, column 1, uniquely determines all other cells. The result is the regular square I mentioned above.

    As it turns out, there are 24 different initial arrangements of most significant digits. Each of those has 4! possible first rows. Each of those has 2 possible candidate squares.

    So the program (if finished) would be finding and testing 24 * 4! * 2 candidates.

    The only part I didn't explain is how a candidate can fail to be a regular square. If we follow all the steps above, we are not guaranteed to have all numbers in {0, 1, ..., 15} represented. We have to check the candidates for that property.

    For the purposes of counting how many 4 by 4 regular squares exist, we would need to specify whether two squares are equivalent up to permutations of {0,1,2,3}, rotation, reflection.
    Follow Math Help Forum on Facebook and Google+

  3. #18
    MHF Contributor undefined's Avatar
    Joined
    Mar 2010
    From
    Chicago
    Posts
    2,340
    Awards
    1
    Quote Originally Posted by Samson View Post
    So can your program also output the decimal square as well?
    Yes, the method printSquare() takes base as an argument. You can display in any base you like.
    Follow Math Help Forum on Facebook and Google+

  4. #19
    MHF Contributor ebaines's Avatar
    Joined
    Jun 2008
    From
    Illinois
    Posts
    1,045
    Thanks
    285
    Regading Q1 - why any "regular square" must also be "magic":

    For a base N regular square, the digits 0, 1, 2, ...N-1 must each appear exactly once in the units place for any given row/coumn. Hence the sum of the units digits is (N-1)N/2. Similarly, each digit appears once in the N's column, so it's sum is also (N-1)N/2. Hence the sum of the numbers in any row or column is:

    <br />
\frac {(N-1)} 2 N(N+1)<br />

    This must be true of all columns, and of all rows. Hence the square is "magic." (However, as noted in the previous discusison about magic squares, this form of "magic square" does not require the diagonals to add to the same number as the rows and columns.)
    Follow Math Help Forum on Facebook and Google+

  5. #20
    Member
    Joined
    Jun 2010
    From
    United States
    Posts
    200
    Quote Originally Posted by undefined View Post
    Yes, the method printSquare() takes base as an argument. You can display in any base you like.
    Could you please post the output of the decimal version of the base 4 response you outputted? I don't have a java compiler installed locally.
    Follow Math Help Forum on Facebook and Google+

  6. #21
    MHF Contributor undefined's Avatar
    Joined
    Mar 2010
    From
    Chicago
    Posts
    2,340
    Awards
    1
    Quote Originally Posted by Samson View Post
    Could you please post the output of the decimal version of the base 4 response you outputted? I don't have a java compiler installed locally.
    I don't see why you would want that. But here it is.

    Code:
    00 05 10 15
    04 00 12 08
    08 12 00 04
    12 08 04 00
    
    [[], [], [], [], [2, 3], [2, 3], [0, 1], [0, 1], [1, 3], [0, 2], [1, 3], [0, 2], [1, 2], [0, 3], [0, 3], [1, 2]]
    
    00 05 11 14
    04 00 12 08
    08 12 00 04
    12 08 04 00
    
    [[], [], [], [], [2, 3], [2, 3], [0, 1], [0, 1], [1, 2], [0, 3], [1, 2], [0, 3], [1, 3], [0, 2], [0, 2], [1, 3]]
    Follow Math Help Forum on Facebook and Google+

  7. #22
    Member
    Joined
    Jun 2010
    From
    United States
    Posts
    200
    Okay! So now I have both the decimal version and the base 4 (base 4 was the first one and your last post is the decimal version of it) ?
    Follow Math Help Forum on Facebook and Google+

  8. #23
    MHF Contributor undefined's Avatar
    Joined
    Mar 2010
    From
    Chicago
    Posts
    2,340
    Awards
    1
    Quote Originally Posted by Samson View Post
    Okay! So now I have both the decimal version and the base 4 (base 4 was the first one and your last post is the decimal version of it) ?
    You seem a bit confused.

    My program did not output any regular squares. I worked it out on paper while trying the very first candidate (to use as a baseline, as a debugging aid). The first candidate worked, so I didn't bother completing the program.

    So, the regular square I provided you is this

    Code:
    00 11 22 33
    12 03 30 21
    23 32 01 10
    31 20 13 02
    
    00 05 10 15
    06 03 12 09
    11 14 01 04
    13 08 07 02
    First it's given in base 4, then decimal. This should be obvious. (Otherwise, for example, the number 22 is out of range.)

    Then you asked about output, so I naturally assumed you meant program output, which was near the bottom of that post.

    I hope it's clear now.
    Follow Math Help Forum on Facebook and Google+

  9. #24
    Member
    Joined
    Jun 2010
    From
    United States
    Posts
    200
    Quote Originally Posted by undefined View Post
    You seem a bit confused.

    My program did not output any regular squares. I worked it out on paper while trying the very first candidate (to use as a baseline, as a debugging aid). The first candidate worked, so I didn't bother completing the program.
    .
    Okay, well now I'm confused again. Here is what I was looking for in my original post:

    My book gives example for the 3 dimensional square, but does not give one for 4. Can someone help me find a 4x4 that is regular? I would like to try expressing it in BOTH regular decimal and base-n forms, and for the sake of consistency, I'd like to use a base-4 form. (I can give my example from the book upon request).
    You said you didn't output any regular squares? If you did, could use just copy and paste them in a form like so:

    Regular Square (Decimal) =
    Regular Square (Base 4) =

    Sorry for the re-hash, but i'm just a little lost here even though i'm sure what I'm looking for is already in this thread, I just cant decipher it exactly.
    Follow Math Help Forum on Facebook and Google+

  10. #25
    MHF Contributor undefined's Avatar
    Joined
    Mar 2010
    From
    Chicago
    Posts
    2,340
    Awards
    1
    Quote Originally Posted by Samson View Post
    Okay, well now I'm confused again. Here is what I was looking for in my original post:



    You said you didn't output any regular squares? If you did, could use just copy and paste them in a form like so:

    Regular Square (Decimal) =
    Regular Square (Base 4) =

    Sorry for the re-hash, but i'm just a little lost here even though i'm sure what I'm looking for is already in this thread, I just cant decipher it exactly.
    Code:
    BASE 4
    
    00 11 22 33
    12 03 30 21
    23 32 01 10
    31 20 13 02
    
    DECIMAL
    
    00 05 10 15
    06 03 12 09
    11 14 01 04
    13 08 07 02
    How much clearer can I be?????
    Follow Math Help Forum on Facebook and Google+

  11. #26
    Member
    Joined
    Jun 2010
    From
    United States
    Posts
    200
    And those are both regular squares? The only reason I ask about clarity is because you said your code did not output regular squares.
    Follow Math Help Forum on Facebook and Google+

  12. #27
    MHF Contributor undefined's Avatar
    Joined
    Mar 2010
    From
    Chicago
    Posts
    2,340
    Awards
    1
    Quote Originally Posted by Samson View Post
    And those are both regular squares? The only reason I ask about clarity is because you said your code did not output regular squares.
    Maybe you don't know what base 4 means...

    Code:
    Base 4 Base 10
    ====== =======
         0       0
         1       1
         2       2
         3       3
        10       4
        11       5
        12       6
        13       7
        20       8
        21       9
        22      10
        23      11
        30      12
        31      13
        32      14
        33      15
       100      16
    Asking whether they are "both" regular squares makes no sense. They are the same square!

    My program output is

    Code:
    00 11 22 33
    10 00 30 20
    20 30 00 10
    30 20 10 00
    
    [[], [], [], [], [2, 3], [2, 3], [0, 1], [0, 1], [1, 3], [0, 2], [1, 3], [0, 2], [1, 2], [0, 3], [0, 3], [1, 2]]
    
    00 11 23 32
    10 00 30 20
    20 30 00 10
    30 20 10 00
    
    [[], [], [], [], [2, 3], [2, 3], [0, 1], [0, 1], [1, 2], [0, 3], [1, 2], [0, 3], [1, 3], [0, 2], [0, 2], [1, 3]]
    There is no regular square there.

    The regular square I gave you is from work I did on PAPER!
    Follow Math Help Forum on Facebook and Google+

  13. #28
    MHF Contributor undefined's Avatar
    Joined
    Mar 2010
    From
    Chicago
    Posts
    2,340
    Awards
    1
    After doing some internet research, I've discovered that these objects have been studied by Euler, among others. See this article on Graeco-Latin squares.
    Follow Math Help Forum on Facebook and Google+

Page 2 of 2 FirstFirst 12

Similar Math Help Forum Discussions

  1. Replies: 1
    Last Post: September 27th 2011, 02:42 PM
  2. Magic Square Questions
    Posted in the Number Theory Forum
    Replies: 6
    Last Post: June 3rd 2010, 04:19 PM
  3. Distinct Square Questions
    Posted in the Number Theory Forum
    Replies: 9
    Last Post: June 2nd 2010, 09:07 AM
  4. Square Root questions!
    Posted in the Algebra Forum
    Replies: 1
    Last Post: May 6th 2010, 07:48 PM
  5. A couple questions with chi square
    Posted in the Advanced Statistics Forum
    Replies: 3
    Last Post: March 28th 2010, 08:29 PM

Search Tags


/mathhelpforum @mathhelpforum