How to solve with each variable having an unique value?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite












I have a puzzle for example:




Use 1 to 9, once only in the cells so that you obtain row and column products as shown:
enter image description here




mypuzzle2[val1_, val2_, val3_, val4_, val5_, val6_] := Solve[a*b*c == val1, d*e*f == val2, g*h*i == val3, a*d*g == val4, b*e*h == val5, c*f*i == val6, a > 0, b > 0, c > 0, d > 0, e > 0, f > 0, g > 0, h > 0, i > 0, a < 10, b < 10, c < 10, d < 10, e < 10, f < 10, g < 10, h < 10, i < 10, a, b, c, d, e, f, g, h, i, Integers]


mypuzzle2[80, 63, 72, 72, 48, 105]


enter image description here



How do I modify the code, so that it only returns with the answer with unique values of 1 to 9?



Thanks.










share|improve this question

























    up vote
    4
    down vote

    favorite












    I have a puzzle for example:




    Use 1 to 9, once only in the cells so that you obtain row and column products as shown:
    enter image description here




    mypuzzle2[val1_, val2_, val3_, val4_, val5_, val6_] := Solve[a*b*c == val1, d*e*f == val2, g*h*i == val3, a*d*g == val4, b*e*h == val5, c*f*i == val6, a > 0, b > 0, c > 0, d > 0, e > 0, f > 0, g > 0, h > 0, i > 0, a < 10, b < 10, c < 10, d < 10, e < 10, f < 10, g < 10, h < 10, i < 10, a, b, c, d, e, f, g, h, i, Integers]


    mypuzzle2[80, 63, 72, 72, 48, 105]


    enter image description here



    How do I modify the code, so that it only returns with the answer with unique values of 1 to 9?



    Thanks.










    share|improve this question























      up vote
      4
      down vote

      favorite









      up vote
      4
      down vote

      favorite











      I have a puzzle for example:




      Use 1 to 9, once only in the cells so that you obtain row and column products as shown:
      enter image description here




      mypuzzle2[val1_, val2_, val3_, val4_, val5_, val6_] := Solve[a*b*c == val1, d*e*f == val2, g*h*i == val3, a*d*g == val4, b*e*h == val5, c*f*i == val6, a > 0, b > 0, c > 0, d > 0, e > 0, f > 0, g > 0, h > 0, i > 0, a < 10, b < 10, c < 10, d < 10, e < 10, f < 10, g < 10, h < 10, i < 10, a, b, c, d, e, f, g, h, i, Integers]


      mypuzzle2[80, 63, 72, 72, 48, 105]


      enter image description here



      How do I modify the code, so that it only returns with the answer with unique values of 1 to 9?



      Thanks.










      share|improve this question













      I have a puzzle for example:




      Use 1 to 9, once only in the cells so that you obtain row and column products as shown:
      enter image description here




      mypuzzle2[val1_, val2_, val3_, val4_, val5_, val6_] := Solve[a*b*c == val1, d*e*f == val2, g*h*i == val3, a*d*g == val4, b*e*h == val5, c*f*i == val6, a > 0, b > 0, c > 0, d > 0, e > 0, f > 0, g > 0, h > 0, i > 0, a < 10, b < 10, c < 10, d < 10, e < 10, f < 10, g < 10, h < 10, i < 10, a, b, c, d, e, f, g, h, i, Integers]


      mypuzzle2[80, 63, 72, 72, 48, 105]


      enter image description here



      How do I modify the code, so that it only returns with the answer with unique values of 1 to 9?



      Thanks.







      equation-solving






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 52 mins ago









      Chen Stats Yu

      2,4671333




      2,4671333




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          mypuzzle3[val1_, val2_, val3_, val4_, val5_, val6_] := 
          Select[Permutations[Range @ 9], With[p = Partition[#, 3],
          And[Times @@@ p == val1, val2, val3, Times @@@ Transpose[p] == val4, val5, val6]] &]

          mypuzzle3[80, 63, 72, 72, 48, 105]



          2, 8, 5, 9, 1, 7, 4, 6, 3







          share|improve this answer






















            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: "387"
            ;
            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: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f182007%2fhow-to-solve-with-each-variable-having-an-unique-value%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            4
            down vote



            accepted










            mypuzzle3[val1_, val2_, val3_, val4_, val5_, val6_] := 
            Select[Permutations[Range @ 9], With[p = Partition[#, 3],
            And[Times @@@ p == val1, val2, val3, Times @@@ Transpose[p] == val4, val5, val6]] &]

            mypuzzle3[80, 63, 72, 72, 48, 105]



            2, 8, 5, 9, 1, 7, 4, 6, 3







            share|improve this answer


























              up vote
              4
              down vote



              accepted










              mypuzzle3[val1_, val2_, val3_, val4_, val5_, val6_] := 
              Select[Permutations[Range @ 9], With[p = Partition[#, 3],
              And[Times @@@ p == val1, val2, val3, Times @@@ Transpose[p] == val4, val5, val6]] &]

              mypuzzle3[80, 63, 72, 72, 48, 105]



              2, 8, 5, 9, 1, 7, 4, 6, 3







              share|improve this answer
























                up vote
                4
                down vote



                accepted







                up vote
                4
                down vote



                accepted






                mypuzzle3[val1_, val2_, val3_, val4_, val5_, val6_] := 
                Select[Permutations[Range @ 9], With[p = Partition[#, 3],
                And[Times @@@ p == val1, val2, val3, Times @@@ Transpose[p] == val4, val5, val6]] &]

                mypuzzle3[80, 63, 72, 72, 48, 105]



                2, 8, 5, 9, 1, 7, 4, 6, 3







                share|improve this answer














                mypuzzle3[val1_, val2_, val3_, val4_, val5_, val6_] := 
                Select[Permutations[Range @ 9], With[p = Partition[#, 3],
                And[Times @@@ p == val1, val2, val3, Times @@@ Transpose[p] == val4, val5, val6]] &]

                mypuzzle3[80, 63, 72, 72, 48, 105]



                2, 8, 5, 9, 1, 7, 4, 6, 3








                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 5 mins ago

























                answered 26 mins ago









                kglr

                160k8184384




                160k8184384



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f182007%2fhow-to-solve-with-each-variable-having-an-unique-value%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    Long meetings (6-7 hours a day): Being “babysat” by supervisor

                    Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

                    Confectionery