Proving magic squares determinant is a multiple of 3 when any numbers can be used












5












$begingroup$


I am trying to prove that the determinant of a magic square, where all rows, columns and diagonal add to the same amount, is divisible by 3.



I proved it for magic squares which have entries $1,ldots, 9$, but it turns out I need to show it for magic squares which can have any entries, e.g.
begin{pmatrix}
1 & 1 & 1 \
1 & 1 & 1 \
1 & 1 & 1
end{pmatrix}



or
begin{pmatrix}
3 & 1 & 2 \
1 & 2 & 3 \
2 & 3 & 1
end{pmatrix}



How can I do this? I tried working out the determinant using $a, b,ldots, i$ as entries but could not find it.



Thank you!










share|cite|improve this question









$endgroup$








  • 2




    $begingroup$
    Idea (I don't know if this works): The determinant is the product of eigenvalues. If all the rows sum to the same number, then $(1, 1, 1)^T$ is an eigenvector with that sum as eigenvalue. Does the full magic-square requirement (including diagonals) mean this sum must be divisible by $3$?
    $endgroup$
    – Arthur
    Mar 26 at 13:06












  • $begingroup$
    @Arthur Also had this idea, but the other two eigenvalues may not be integers. Or we must prove they are.
    $endgroup$
    – M. Vinay
    Mar 26 at 13:08






  • 1




    $begingroup$
    @M.Vinay Not a problem. If the sum is $s$, then the characteristic polynomial factors as $(lambda - s)g(lambda)$ where $g$ is a (quadratic) polynomial with integer coefficients. So it doesn't matter what its roots are; the constant term of $g$ is an integer and therefore the constant term of the entire polynomial (which is the determinant with a sign) is divisible by $s$.
    $endgroup$
    – Arthur
    Mar 26 at 13:10








  • 1




    $begingroup$
    So the only thing I'm uncertain of is whether the sum $s$ must be divisible by $3$. Because without the diagonal requirement, you can just increase each $3$ in your second example to a $4$, and $s = 7$ and the determinant is $-49$.
    $endgroup$
    – Arthur
    Mar 26 at 13:13








  • 2




    $begingroup$
    @Arthur Let $s$ be the sum along one row etc, $c$ the value in the center. Then the sum along both diagonals and the row and column through the center is equal $4s$ and equal $3s+ 3c$ (because it contains sum of all elements in square plus $3c$). Hence $c=s/3$, and $s$ is divisible by $3$.
    $endgroup$
    – daw
    Mar 26 at 14:35
















5












$begingroup$


I am trying to prove that the determinant of a magic square, where all rows, columns and diagonal add to the same amount, is divisible by 3.



I proved it for magic squares which have entries $1,ldots, 9$, but it turns out I need to show it for magic squares which can have any entries, e.g.
begin{pmatrix}
1 & 1 & 1 \
1 & 1 & 1 \
1 & 1 & 1
end{pmatrix}



or
begin{pmatrix}
3 & 1 & 2 \
1 & 2 & 3 \
2 & 3 & 1
end{pmatrix}



How can I do this? I tried working out the determinant using $a, b,ldots, i$ as entries but could not find it.



Thank you!










share|cite|improve this question









$endgroup$








  • 2




    $begingroup$
    Idea (I don't know if this works): The determinant is the product of eigenvalues. If all the rows sum to the same number, then $(1, 1, 1)^T$ is an eigenvector with that sum as eigenvalue. Does the full magic-square requirement (including diagonals) mean this sum must be divisible by $3$?
    $endgroup$
    – Arthur
    Mar 26 at 13:06












  • $begingroup$
    @Arthur Also had this idea, but the other two eigenvalues may not be integers. Or we must prove they are.
    $endgroup$
    – M. Vinay
    Mar 26 at 13:08






  • 1




    $begingroup$
    @M.Vinay Not a problem. If the sum is $s$, then the characteristic polynomial factors as $(lambda - s)g(lambda)$ where $g$ is a (quadratic) polynomial with integer coefficients. So it doesn't matter what its roots are; the constant term of $g$ is an integer and therefore the constant term of the entire polynomial (which is the determinant with a sign) is divisible by $s$.
    $endgroup$
    – Arthur
    Mar 26 at 13:10








  • 1




    $begingroup$
    So the only thing I'm uncertain of is whether the sum $s$ must be divisible by $3$. Because without the diagonal requirement, you can just increase each $3$ in your second example to a $4$, and $s = 7$ and the determinant is $-49$.
    $endgroup$
    – Arthur
    Mar 26 at 13:13








  • 2




    $begingroup$
    @Arthur Let $s$ be the sum along one row etc, $c$ the value in the center. Then the sum along both diagonals and the row and column through the center is equal $4s$ and equal $3s+ 3c$ (because it contains sum of all elements in square plus $3c$). Hence $c=s/3$, and $s$ is divisible by $3$.
    $endgroup$
    – daw
    Mar 26 at 14:35














5












5








5





$begingroup$


I am trying to prove that the determinant of a magic square, where all rows, columns and diagonal add to the same amount, is divisible by 3.



I proved it for magic squares which have entries $1,ldots, 9$, but it turns out I need to show it for magic squares which can have any entries, e.g.
begin{pmatrix}
1 & 1 & 1 \
1 & 1 & 1 \
1 & 1 & 1
end{pmatrix}



or
begin{pmatrix}
3 & 1 & 2 \
1 & 2 & 3 \
2 & 3 & 1
end{pmatrix}



How can I do this? I tried working out the determinant using $a, b,ldots, i$ as entries but could not find it.



Thank you!










share|cite|improve this question









$endgroup$




I am trying to prove that the determinant of a magic square, where all rows, columns and diagonal add to the same amount, is divisible by 3.



I proved it for magic squares which have entries $1,ldots, 9$, but it turns out I need to show it for magic squares which can have any entries, e.g.
begin{pmatrix}
1 & 1 & 1 \
1 & 1 & 1 \
1 & 1 & 1
end{pmatrix}



or
begin{pmatrix}
3 & 1 & 2 \
1 & 2 & 3 \
2 & 3 & 1
end{pmatrix}



How can I do this? I tried working out the determinant using $a, b,ldots, i$ as entries but could not find it.



Thank you!







linear-algebra matrices determinant magic-square






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










asked Mar 26 at 12:42









tjsptjsp

352




352








  • 2




    $begingroup$
    Idea (I don't know if this works): The determinant is the product of eigenvalues. If all the rows sum to the same number, then $(1, 1, 1)^T$ is an eigenvector with that sum as eigenvalue. Does the full magic-square requirement (including diagonals) mean this sum must be divisible by $3$?
    $endgroup$
    – Arthur
    Mar 26 at 13:06












  • $begingroup$
    @Arthur Also had this idea, but the other two eigenvalues may not be integers. Or we must prove they are.
    $endgroup$
    – M. Vinay
    Mar 26 at 13:08






  • 1




    $begingroup$
    @M.Vinay Not a problem. If the sum is $s$, then the characteristic polynomial factors as $(lambda - s)g(lambda)$ where $g$ is a (quadratic) polynomial with integer coefficients. So it doesn't matter what its roots are; the constant term of $g$ is an integer and therefore the constant term of the entire polynomial (which is the determinant with a sign) is divisible by $s$.
    $endgroup$
    – Arthur
    Mar 26 at 13:10








  • 1




    $begingroup$
    So the only thing I'm uncertain of is whether the sum $s$ must be divisible by $3$. Because without the diagonal requirement, you can just increase each $3$ in your second example to a $4$, and $s = 7$ and the determinant is $-49$.
    $endgroup$
    – Arthur
    Mar 26 at 13:13








  • 2




    $begingroup$
    @Arthur Let $s$ be the sum along one row etc, $c$ the value in the center. Then the sum along both diagonals and the row and column through the center is equal $4s$ and equal $3s+ 3c$ (because it contains sum of all elements in square plus $3c$). Hence $c=s/3$, and $s$ is divisible by $3$.
    $endgroup$
    – daw
    Mar 26 at 14:35














  • 2




    $begingroup$
    Idea (I don't know if this works): The determinant is the product of eigenvalues. If all the rows sum to the same number, then $(1, 1, 1)^T$ is an eigenvector with that sum as eigenvalue. Does the full magic-square requirement (including diagonals) mean this sum must be divisible by $3$?
    $endgroup$
    – Arthur
    Mar 26 at 13:06












  • $begingroup$
    @Arthur Also had this idea, but the other two eigenvalues may not be integers. Or we must prove they are.
    $endgroup$
    – M. Vinay
    Mar 26 at 13:08






  • 1




    $begingroup$
    @M.Vinay Not a problem. If the sum is $s$, then the characteristic polynomial factors as $(lambda - s)g(lambda)$ where $g$ is a (quadratic) polynomial with integer coefficients. So it doesn't matter what its roots are; the constant term of $g$ is an integer and therefore the constant term of the entire polynomial (which is the determinant with a sign) is divisible by $s$.
    $endgroup$
    – Arthur
    Mar 26 at 13:10








  • 1




    $begingroup$
    So the only thing I'm uncertain of is whether the sum $s$ must be divisible by $3$. Because without the diagonal requirement, you can just increase each $3$ in your second example to a $4$, and $s = 7$ and the determinant is $-49$.
    $endgroup$
    – Arthur
    Mar 26 at 13:13








  • 2




    $begingroup$
    @Arthur Let $s$ be the sum along one row etc, $c$ the value in the center. Then the sum along both diagonals and the row and column through the center is equal $4s$ and equal $3s+ 3c$ (because it contains sum of all elements in square plus $3c$). Hence $c=s/3$, and $s$ is divisible by $3$.
    $endgroup$
    – daw
    Mar 26 at 14:35








2




2




$begingroup$
Idea (I don't know if this works): The determinant is the product of eigenvalues. If all the rows sum to the same number, then $(1, 1, 1)^T$ is an eigenvector with that sum as eigenvalue. Does the full magic-square requirement (including diagonals) mean this sum must be divisible by $3$?
$endgroup$
– Arthur
Mar 26 at 13:06






$begingroup$
Idea (I don't know if this works): The determinant is the product of eigenvalues. If all the rows sum to the same number, then $(1, 1, 1)^T$ is an eigenvector with that sum as eigenvalue. Does the full magic-square requirement (including diagonals) mean this sum must be divisible by $3$?
$endgroup$
– Arthur
Mar 26 at 13:06














$begingroup$
@Arthur Also had this idea, but the other two eigenvalues may not be integers. Or we must prove they are.
$endgroup$
– M. Vinay
Mar 26 at 13:08




$begingroup$
@Arthur Also had this idea, but the other two eigenvalues may not be integers. Or we must prove they are.
$endgroup$
– M. Vinay
Mar 26 at 13:08




1




1




$begingroup$
@M.Vinay Not a problem. If the sum is $s$, then the characteristic polynomial factors as $(lambda - s)g(lambda)$ where $g$ is a (quadratic) polynomial with integer coefficients. So it doesn't matter what its roots are; the constant term of $g$ is an integer and therefore the constant term of the entire polynomial (which is the determinant with a sign) is divisible by $s$.
$endgroup$
– Arthur
Mar 26 at 13:10






$begingroup$
@M.Vinay Not a problem. If the sum is $s$, then the characteristic polynomial factors as $(lambda - s)g(lambda)$ where $g$ is a (quadratic) polynomial with integer coefficients. So it doesn't matter what its roots are; the constant term of $g$ is an integer and therefore the constant term of the entire polynomial (which is the determinant with a sign) is divisible by $s$.
$endgroup$
– Arthur
Mar 26 at 13:10






1




1




$begingroup$
So the only thing I'm uncertain of is whether the sum $s$ must be divisible by $3$. Because without the diagonal requirement, you can just increase each $3$ in your second example to a $4$, and $s = 7$ and the determinant is $-49$.
$endgroup$
– Arthur
Mar 26 at 13:13






$begingroup$
So the only thing I'm uncertain of is whether the sum $s$ must be divisible by $3$. Because without the diagonal requirement, you can just increase each $3$ in your second example to a $4$, and $s = 7$ and the determinant is $-49$.
$endgroup$
– Arthur
Mar 26 at 13:13






2




2




$begingroup$
@Arthur Let $s$ be the sum along one row etc, $c$ the value in the center. Then the sum along both diagonals and the row and column through the center is equal $4s$ and equal $3s+ 3c$ (because it contains sum of all elements in square plus $3c$). Hence $c=s/3$, and $s$ is divisible by $3$.
$endgroup$
– daw
Mar 26 at 14:35




$begingroup$
@Arthur Let $s$ be the sum along one row etc, $c$ the value in the center. Then the sum along both diagonals and the row and column through the center is equal $4s$ and equal $3s+ 3c$ (because it contains sum of all elements in square plus $3c$). Hence $c=s/3$, and $s$ is divisible by $3$.
$endgroup$
– daw
Mar 26 at 14:35










2 Answers
2






active

oldest

votes


















4












$begingroup$

Let the three rows of the magic square be $r_1$, $r_2$, and $r_3$. Since the determinant is unchanged by row operations that add a multiple of one row to another, the matrix with rows $r_1$, $r_2$ and $r_1+r_2+r_3$ has the same determinant. The entries in $r_1 + r_2 + r_3$ are the column sums of the original magic square, which are all equal to the magic constant. The magic constant is three times the central entry of the magic square, so every entry in this new row is multiple of three; therefore the determinant is, too.






share|cite|improve this answer









$endgroup$





















    3












    $begingroup$

    Collecting from all the comments above:



    Let $s$ be the sum of one row. This $s$ must be divisible by $3$: Since the sum of the two diagonals along with the row and the column going through the center equals $4s$, but it is also the sum of every element in the matrix, along with the center value $c$ an additional three times, which is $3s + 3c$. Equating these two gives $s = 3c$.



    Since all the rows have the same sum, the vector $(1, 1, 1)^T$ is an eigenvector of the matrix with eigenvalue $s$. The determinant is (up to a sign) equal to the constant term of the characteristic polynomial. Since we know the characteristic polynomial has $s$ as a root, it must factor as
    $$
    (lambda - s)g(lambda)
    $$

    for some polynomial $g$ with integer coefficients. Particularily, this means that the constant term of $g$ must be an integer, which means that the constant term of the characteristic polynomial (and therefore the determinant) must be divisible by $s$.






    share|cite|improve this answer











    $endgroup$














      Your Answer





      StackExchange.ifUsing("editor", function () {
      return StackExchange.using("mathjaxEditing", function () {
      StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
      StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
      });
      });
      }, "mathjax-editing");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "69"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      noCode: true, onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3163123%2fproving-magic-squares-determinant-is-a-multiple-of-3-when-any-numbers-can-be-use%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      4












      $begingroup$

      Let the three rows of the magic square be $r_1$, $r_2$, and $r_3$. Since the determinant is unchanged by row operations that add a multiple of one row to another, the matrix with rows $r_1$, $r_2$ and $r_1+r_2+r_3$ has the same determinant. The entries in $r_1 + r_2 + r_3$ are the column sums of the original magic square, which are all equal to the magic constant. The magic constant is three times the central entry of the magic square, so every entry in this new row is multiple of three; therefore the determinant is, too.






      share|cite|improve this answer









      $endgroup$


















        4












        $begingroup$

        Let the three rows of the magic square be $r_1$, $r_2$, and $r_3$. Since the determinant is unchanged by row operations that add a multiple of one row to another, the matrix with rows $r_1$, $r_2$ and $r_1+r_2+r_3$ has the same determinant. The entries in $r_1 + r_2 + r_3$ are the column sums of the original magic square, which are all equal to the magic constant. The magic constant is three times the central entry of the magic square, so every entry in this new row is multiple of three; therefore the determinant is, too.






        share|cite|improve this answer









        $endgroup$
















          4












          4








          4





          $begingroup$

          Let the three rows of the magic square be $r_1$, $r_2$, and $r_3$. Since the determinant is unchanged by row operations that add a multiple of one row to another, the matrix with rows $r_1$, $r_2$ and $r_1+r_2+r_3$ has the same determinant. The entries in $r_1 + r_2 + r_3$ are the column sums of the original magic square, which are all equal to the magic constant. The magic constant is three times the central entry of the magic square, so every entry in this new row is multiple of three; therefore the determinant is, too.






          share|cite|improve this answer









          $endgroup$



          Let the three rows of the magic square be $r_1$, $r_2$, and $r_3$. Since the determinant is unchanged by row operations that add a multiple of one row to another, the matrix with rows $r_1$, $r_2$ and $r_1+r_2+r_3$ has the same determinant. The entries in $r_1 + r_2 + r_3$ are the column sums of the original magic square, which are all equal to the magic constant. The magic constant is three times the central entry of the magic square, so every entry in this new row is multiple of three; therefore the determinant is, too.







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Mar 26 at 13:43









          FredHFredH

          3,6851023




          3,6851023























              3












              $begingroup$

              Collecting from all the comments above:



              Let $s$ be the sum of one row. This $s$ must be divisible by $3$: Since the sum of the two diagonals along with the row and the column going through the center equals $4s$, but it is also the sum of every element in the matrix, along with the center value $c$ an additional three times, which is $3s + 3c$. Equating these two gives $s = 3c$.



              Since all the rows have the same sum, the vector $(1, 1, 1)^T$ is an eigenvector of the matrix with eigenvalue $s$. The determinant is (up to a sign) equal to the constant term of the characteristic polynomial. Since we know the characteristic polynomial has $s$ as a root, it must factor as
              $$
              (lambda - s)g(lambda)
              $$

              for some polynomial $g$ with integer coefficients. Particularily, this means that the constant term of $g$ must be an integer, which means that the constant term of the characteristic polynomial (and therefore the determinant) must be divisible by $s$.






              share|cite|improve this answer











              $endgroup$


















                3












                $begingroup$

                Collecting from all the comments above:



                Let $s$ be the sum of one row. This $s$ must be divisible by $3$: Since the sum of the two diagonals along with the row and the column going through the center equals $4s$, but it is also the sum of every element in the matrix, along with the center value $c$ an additional three times, which is $3s + 3c$. Equating these two gives $s = 3c$.



                Since all the rows have the same sum, the vector $(1, 1, 1)^T$ is an eigenvector of the matrix with eigenvalue $s$. The determinant is (up to a sign) equal to the constant term of the characteristic polynomial. Since we know the characteristic polynomial has $s$ as a root, it must factor as
                $$
                (lambda - s)g(lambda)
                $$

                for some polynomial $g$ with integer coefficients. Particularily, this means that the constant term of $g$ must be an integer, which means that the constant term of the characteristic polynomial (and therefore the determinant) must be divisible by $s$.






                share|cite|improve this answer











                $endgroup$
















                  3












                  3








                  3





                  $begingroup$

                  Collecting from all the comments above:



                  Let $s$ be the sum of one row. This $s$ must be divisible by $3$: Since the sum of the two diagonals along with the row and the column going through the center equals $4s$, but it is also the sum of every element in the matrix, along with the center value $c$ an additional three times, which is $3s + 3c$. Equating these two gives $s = 3c$.



                  Since all the rows have the same sum, the vector $(1, 1, 1)^T$ is an eigenvector of the matrix with eigenvalue $s$. The determinant is (up to a sign) equal to the constant term of the characteristic polynomial. Since we know the characteristic polynomial has $s$ as a root, it must factor as
                  $$
                  (lambda - s)g(lambda)
                  $$

                  for some polynomial $g$ with integer coefficients. Particularily, this means that the constant term of $g$ must be an integer, which means that the constant term of the characteristic polynomial (and therefore the determinant) must be divisible by $s$.






                  share|cite|improve this answer











                  $endgroup$



                  Collecting from all the comments above:



                  Let $s$ be the sum of one row. This $s$ must be divisible by $3$: Since the sum of the two diagonals along with the row and the column going through the center equals $4s$, but it is also the sum of every element in the matrix, along with the center value $c$ an additional three times, which is $3s + 3c$. Equating these two gives $s = 3c$.



                  Since all the rows have the same sum, the vector $(1, 1, 1)^T$ is an eigenvector of the matrix with eigenvalue $s$. The determinant is (up to a sign) equal to the constant term of the characteristic polynomial. Since we know the characteristic polynomial has $s$ as a root, it must factor as
                  $$
                  (lambda - s)g(lambda)
                  $$

                  for some polynomial $g$ with integer coefficients. Particularily, this means that the constant term of $g$ must be an integer, which means that the constant term of the characteristic polynomial (and therefore the determinant) must be divisible by $s$.







                  share|cite|improve this answer














                  share|cite|improve this answer



                  share|cite|improve this answer








                  edited Mar 26 at 18:49

























                  answered Mar 26 at 14:44









                  ArthurArthur

                  122k7122211




                  122k7122211






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Mathematics Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      Use MathJax to format equations. MathJax reference.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3163123%2fproving-magic-squares-determinant-is-a-multiple-of-3-when-any-numbers-can-be-use%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      How to change which sound is reproduced for terminal bell?

                      Can I use Tabulator js library in my java Spring + Thymeleaf project?

                      Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents