Find a permutation making the sum of products to equal a given value











up vote
1
down vote

favorite












Suppose we have a sequence of integers ${x_i}$ and a permutation of this sequence changing its order ${x_{j_i}}$. We want to find a such a permutation making $sum_i x_ix_{j_i} =C$, where C is a already given value. For example, given $x={1,2,3,4}$ and $C=28$, then the permutation ${2,1,4,3}$ satisfies the above conditions.



If the above is not clear enough, essentially, the question is




Given a column vector $x$ of integer elements, and a constant $C$, find a permutation matrix $A$ such that $x^T A x=C$, where T denotes transpose.




$A$ is certainly not unique, so I am looking for a way to find all solutions.



I try to make $x$ into a square matrix by right multiply it by a row vector, but obviously this will certainly give a singular matrix without an inverse, so I make no progresses.










share|cite|improve this question




























    up vote
    1
    down vote

    favorite












    Suppose we have a sequence of integers ${x_i}$ and a permutation of this sequence changing its order ${x_{j_i}}$. We want to find a such a permutation making $sum_i x_ix_{j_i} =C$, where C is a already given value. For example, given $x={1,2,3,4}$ and $C=28$, then the permutation ${2,1,4,3}$ satisfies the above conditions.



    If the above is not clear enough, essentially, the question is




    Given a column vector $x$ of integer elements, and a constant $C$, find a permutation matrix $A$ such that $x^T A x=C$, where T denotes transpose.




    $A$ is certainly not unique, so I am looking for a way to find all solutions.



    I try to make $x$ into a square matrix by right multiply it by a row vector, but obviously this will certainly give a singular matrix without an inverse, so I make no progresses.










    share|cite|improve this question


























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      Suppose we have a sequence of integers ${x_i}$ and a permutation of this sequence changing its order ${x_{j_i}}$. We want to find a such a permutation making $sum_i x_ix_{j_i} =C$, where C is a already given value. For example, given $x={1,2,3,4}$ and $C=28$, then the permutation ${2,1,4,3}$ satisfies the above conditions.



      If the above is not clear enough, essentially, the question is




      Given a column vector $x$ of integer elements, and a constant $C$, find a permutation matrix $A$ such that $x^T A x=C$, where T denotes transpose.




      $A$ is certainly not unique, so I am looking for a way to find all solutions.



      I try to make $x$ into a square matrix by right multiply it by a row vector, but obviously this will certainly give a singular matrix without an inverse, so I make no progresses.










      share|cite|improve this question















      Suppose we have a sequence of integers ${x_i}$ and a permutation of this sequence changing its order ${x_{j_i}}$. We want to find a such a permutation making $sum_i x_ix_{j_i} =C$, where C is a already given value. For example, given $x={1,2,3,4}$ and $C=28$, then the permutation ${2,1,4,3}$ satisfies the above conditions.



      If the above is not clear enough, essentially, the question is




      Given a column vector $x$ of integer elements, and a constant $C$, find a permutation matrix $A$ such that $x^T A x=C$, where T denotes transpose.




      $A$ is certainly not unique, so I am looking for a way to find all solutions.



      I try to make $x$ into a square matrix by right multiply it by a row vector, but obviously this will certainly give a singular matrix without an inverse, so I make no progresses.







      linear-algebra matrices discrete-mathematics permutations






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Nov 15 at 4:44









      gt6989b

      31.9k22351




      31.9k22351










      asked Nov 15 at 4:05









      Ma Joad

      799216




      799216



























          active

          oldest

          votes











          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',
          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%2f2999197%2ffind-a-permutation-making-the-sum-of-products-to-equal-a-given-value%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2999197%2ffind-a-permutation-making-the-sum-of-products-to-equal-a-given-value%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

          AnyDesk - Fatal Program Failure

          How to calibrate 16:9 built-in touch-screen to a 4:3 resolution?

          QoS: MAC-Priority for clients behind a repeater