matrix: solve for square matrix with 0 diagonal












0












$begingroup$


I have an equation of $XI = Y$, where I know $I$ (vector of 1s) and $Y$ (vector of positive integers). I want to find positive square matrix $X$, I also know that the diagonal entries of $X$ are all 0.



So example is $X$ is 3x3, $I$ is 3x1 and $Y$ is 3x1.



How can I solve this? There could be multiple solutions.










share|cite|improve this question









$endgroup$

















    0












    $begingroup$


    I have an equation of $XI = Y$, where I know $I$ (vector of 1s) and $Y$ (vector of positive integers). I want to find positive square matrix $X$, I also know that the diagonal entries of $X$ are all 0.



    So example is $X$ is 3x3, $I$ is 3x1 and $Y$ is 3x1.



    How can I solve this? There could be multiple solutions.










    share|cite|improve this question









    $endgroup$















      0












      0








      0





      $begingroup$


      I have an equation of $XI = Y$, where I know $I$ (vector of 1s) and $Y$ (vector of positive integers). I want to find positive square matrix $X$, I also know that the diagonal entries of $X$ are all 0.



      So example is $X$ is 3x3, $I$ is 3x1 and $Y$ is 3x1.



      How can I solve this? There could be multiple solutions.










      share|cite|improve this question









      $endgroup$




      I have an equation of $XI = Y$, where I know $I$ (vector of 1s) and $Y$ (vector of positive integers). I want to find positive square matrix $X$, I also know that the diagonal entries of $X$ are all 0.



      So example is $X$ is 3x3, $I$ is 3x1 and $Y$ is 3x1.



      How can I solve this? There could be multiple solutions.







      matrix-calculus






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Jan 24 at 11:41









      Dirk NachbarDirk Nachbar

      1012




      1012






















          2 Answers
          2






          active

          oldest

          votes


















          3












          $begingroup$

          Let $X=(x_{jk})_{j,k=1}^3$ and $Y=(l,m,n)^T$ with $l,m,n in mathbb N.$ Since $x_{11}=x_{22}=x_{33}=0$, we get from $XI=Y$ the equations



          $x_{12}+x_{13}=l, x_{21}+x_{23}=m$ and $x_{31}+x_{32}=n.$



          Can you proceed ?






          share|cite|improve this answer









          $endgroup$





















            2












            $begingroup$

            The Moore-Penrose inverse can be used to write the general solution to any linear equation, i.e.
            $$(XA = Y) implies X = YA^+ + C - CAA^+$$ where $C$ is an arbitrary matrix.



            In the current problem the matrices $(A,Y)$ are replaced by the vectors $(1,y)$, yielding
            $$eqalign{
            X &= y1^+ + C - C11^+ cr
            }$$

            For a real vector, the MP-inverse can be written in terms of the transpose
            $$a^+ = frac{a^T}{a^Ta}$$
            so we can write
            $$1^+ = tfrac{1}{3}1^T$$
            Extract the $k^{th}$ diagonal element of the matrix by multiplying from the left with $e_k^T$ and from the right with $e_k$, and set it to zero.
            $$eqalign{
            X_{kk} &= e_k^TXe_k cr
            0 &= tfrac{1}{3}y_k + C_{kk} - tfrac{1}{3}e_k^TC1 cr
            0 &= y_k + 3C_{kk} - e_k^TC1 cr
            }$$

            There are more unknowns than equations, so let's constrain the matrix to $C={rm Diag}(c).$
            $$eqalign{
            0 &= y_k + 3c_{k} - e_k^Tc cr
            c_k &= -tfrac{1}{2}y_k &implies
            C &= -tfrac{1}{2}{rm Diag}(y) cr
            }$$

            Putting it all together, and generalizing the dimensions from $(3to n)$ yields
            $$eqalign{
            X &= tfrac{1}{n}y1^T - tfrac{1}{n-1}{rm Diag}(y) + tfrac{1}{n(n-1)}{rm Diag}(y)11^T cr
            }$$






            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%2f3085773%2fmatrix-solve-for-square-matrix-with-0-diagonal%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









              3












              $begingroup$

              Let $X=(x_{jk})_{j,k=1}^3$ and $Y=(l,m,n)^T$ with $l,m,n in mathbb N.$ Since $x_{11}=x_{22}=x_{33}=0$, we get from $XI=Y$ the equations



              $x_{12}+x_{13}=l, x_{21}+x_{23}=m$ and $x_{31}+x_{32}=n.$



              Can you proceed ?






              share|cite|improve this answer









              $endgroup$


















                3












                $begingroup$

                Let $X=(x_{jk})_{j,k=1}^3$ and $Y=(l,m,n)^T$ with $l,m,n in mathbb N.$ Since $x_{11}=x_{22}=x_{33}=0$, we get from $XI=Y$ the equations



                $x_{12}+x_{13}=l, x_{21}+x_{23}=m$ and $x_{31}+x_{32}=n.$



                Can you proceed ?






                share|cite|improve this answer









                $endgroup$
















                  3












                  3








                  3





                  $begingroup$

                  Let $X=(x_{jk})_{j,k=1}^3$ and $Y=(l,m,n)^T$ with $l,m,n in mathbb N.$ Since $x_{11}=x_{22}=x_{33}=0$, we get from $XI=Y$ the equations



                  $x_{12}+x_{13}=l, x_{21}+x_{23}=m$ and $x_{31}+x_{32}=n.$



                  Can you proceed ?






                  share|cite|improve this answer









                  $endgroup$



                  Let $X=(x_{jk})_{j,k=1}^3$ and $Y=(l,m,n)^T$ with $l,m,n in mathbb N.$ Since $x_{11}=x_{22}=x_{33}=0$, we get from $XI=Y$ the equations



                  $x_{12}+x_{13}=l, x_{21}+x_{23}=m$ and $x_{31}+x_{32}=n.$



                  Can you proceed ?







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered Jan 24 at 12:08









                  FredFred

                  48.3k1849




                  48.3k1849























                      2












                      $begingroup$

                      The Moore-Penrose inverse can be used to write the general solution to any linear equation, i.e.
                      $$(XA = Y) implies X = YA^+ + C - CAA^+$$ where $C$ is an arbitrary matrix.



                      In the current problem the matrices $(A,Y)$ are replaced by the vectors $(1,y)$, yielding
                      $$eqalign{
                      X &= y1^+ + C - C11^+ cr
                      }$$

                      For a real vector, the MP-inverse can be written in terms of the transpose
                      $$a^+ = frac{a^T}{a^Ta}$$
                      so we can write
                      $$1^+ = tfrac{1}{3}1^T$$
                      Extract the $k^{th}$ diagonal element of the matrix by multiplying from the left with $e_k^T$ and from the right with $e_k$, and set it to zero.
                      $$eqalign{
                      X_{kk} &= e_k^TXe_k cr
                      0 &= tfrac{1}{3}y_k + C_{kk} - tfrac{1}{3}e_k^TC1 cr
                      0 &= y_k + 3C_{kk} - e_k^TC1 cr
                      }$$

                      There are more unknowns than equations, so let's constrain the matrix to $C={rm Diag}(c).$
                      $$eqalign{
                      0 &= y_k + 3c_{k} - e_k^Tc cr
                      c_k &= -tfrac{1}{2}y_k &implies
                      C &= -tfrac{1}{2}{rm Diag}(y) cr
                      }$$

                      Putting it all together, and generalizing the dimensions from $(3to n)$ yields
                      $$eqalign{
                      X &= tfrac{1}{n}y1^T - tfrac{1}{n-1}{rm Diag}(y) + tfrac{1}{n(n-1)}{rm Diag}(y)11^T cr
                      }$$






                      share|cite|improve this answer











                      $endgroup$


















                        2












                        $begingroup$

                        The Moore-Penrose inverse can be used to write the general solution to any linear equation, i.e.
                        $$(XA = Y) implies X = YA^+ + C - CAA^+$$ where $C$ is an arbitrary matrix.



                        In the current problem the matrices $(A,Y)$ are replaced by the vectors $(1,y)$, yielding
                        $$eqalign{
                        X &= y1^+ + C - C11^+ cr
                        }$$

                        For a real vector, the MP-inverse can be written in terms of the transpose
                        $$a^+ = frac{a^T}{a^Ta}$$
                        so we can write
                        $$1^+ = tfrac{1}{3}1^T$$
                        Extract the $k^{th}$ diagonal element of the matrix by multiplying from the left with $e_k^T$ and from the right with $e_k$, and set it to zero.
                        $$eqalign{
                        X_{kk} &= e_k^TXe_k cr
                        0 &= tfrac{1}{3}y_k + C_{kk} - tfrac{1}{3}e_k^TC1 cr
                        0 &= y_k + 3C_{kk} - e_k^TC1 cr
                        }$$

                        There are more unknowns than equations, so let's constrain the matrix to $C={rm Diag}(c).$
                        $$eqalign{
                        0 &= y_k + 3c_{k} - e_k^Tc cr
                        c_k &= -tfrac{1}{2}y_k &implies
                        C &= -tfrac{1}{2}{rm Diag}(y) cr
                        }$$

                        Putting it all together, and generalizing the dimensions from $(3to n)$ yields
                        $$eqalign{
                        X &= tfrac{1}{n}y1^T - tfrac{1}{n-1}{rm Diag}(y) + tfrac{1}{n(n-1)}{rm Diag}(y)11^T cr
                        }$$






                        share|cite|improve this answer











                        $endgroup$
















                          2












                          2








                          2





                          $begingroup$

                          The Moore-Penrose inverse can be used to write the general solution to any linear equation, i.e.
                          $$(XA = Y) implies X = YA^+ + C - CAA^+$$ where $C$ is an arbitrary matrix.



                          In the current problem the matrices $(A,Y)$ are replaced by the vectors $(1,y)$, yielding
                          $$eqalign{
                          X &= y1^+ + C - C11^+ cr
                          }$$

                          For a real vector, the MP-inverse can be written in terms of the transpose
                          $$a^+ = frac{a^T}{a^Ta}$$
                          so we can write
                          $$1^+ = tfrac{1}{3}1^T$$
                          Extract the $k^{th}$ diagonal element of the matrix by multiplying from the left with $e_k^T$ and from the right with $e_k$, and set it to zero.
                          $$eqalign{
                          X_{kk} &= e_k^TXe_k cr
                          0 &= tfrac{1}{3}y_k + C_{kk} - tfrac{1}{3}e_k^TC1 cr
                          0 &= y_k + 3C_{kk} - e_k^TC1 cr
                          }$$

                          There are more unknowns than equations, so let's constrain the matrix to $C={rm Diag}(c).$
                          $$eqalign{
                          0 &= y_k + 3c_{k} - e_k^Tc cr
                          c_k &= -tfrac{1}{2}y_k &implies
                          C &= -tfrac{1}{2}{rm Diag}(y) cr
                          }$$

                          Putting it all together, and generalizing the dimensions from $(3to n)$ yields
                          $$eqalign{
                          X &= tfrac{1}{n}y1^T - tfrac{1}{n-1}{rm Diag}(y) + tfrac{1}{n(n-1)}{rm Diag}(y)11^T cr
                          }$$






                          share|cite|improve this answer











                          $endgroup$



                          The Moore-Penrose inverse can be used to write the general solution to any linear equation, i.e.
                          $$(XA = Y) implies X = YA^+ + C - CAA^+$$ where $C$ is an arbitrary matrix.



                          In the current problem the matrices $(A,Y)$ are replaced by the vectors $(1,y)$, yielding
                          $$eqalign{
                          X &= y1^+ + C - C11^+ cr
                          }$$

                          For a real vector, the MP-inverse can be written in terms of the transpose
                          $$a^+ = frac{a^T}{a^Ta}$$
                          so we can write
                          $$1^+ = tfrac{1}{3}1^T$$
                          Extract the $k^{th}$ diagonal element of the matrix by multiplying from the left with $e_k^T$ and from the right with $e_k$, and set it to zero.
                          $$eqalign{
                          X_{kk} &= e_k^TXe_k cr
                          0 &= tfrac{1}{3}y_k + C_{kk} - tfrac{1}{3}e_k^TC1 cr
                          0 &= y_k + 3C_{kk} - e_k^TC1 cr
                          }$$

                          There are more unknowns than equations, so let's constrain the matrix to $C={rm Diag}(c).$
                          $$eqalign{
                          0 &= y_k + 3c_{k} - e_k^Tc cr
                          c_k &= -tfrac{1}{2}y_k &implies
                          C &= -tfrac{1}{2}{rm Diag}(y) cr
                          }$$

                          Putting it all together, and generalizing the dimensions from $(3to n)$ yields
                          $$eqalign{
                          X &= tfrac{1}{n}y1^T - tfrac{1}{n-1}{rm Diag}(y) + tfrac{1}{n(n-1)}{rm Diag}(y)11^T cr
                          }$$







                          share|cite|improve this answer














                          share|cite|improve this answer



                          share|cite|improve this answer








                          edited Jan 26 at 20:53

























                          answered Jan 26 at 19:39









                          greggreg

                          8,8401824




                          8,8401824






























                              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%2f3085773%2fmatrix-solve-for-square-matrix-with-0-diagonal%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

                              Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

                              Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

                              A Topological Invariant for $pi_3(U(n))$