standardized form for products of surds

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











up vote
0
down vote

favorite












As an exercise, I'm writing a program that takes a radical expression* as an input and returns a radical expression equal to it that is in as close to a canonical form as possible. The ideal would be for the program to have the property that any two inputs that are equal have the same output. I recognize that I'm unlikely to manage this, but I can get "closer" by placing the tightest restrictions I can on the form the output can take. For example,



  1. No irrational denominators are allowed.

  2. All sums are linearly independent over the rationals.

  3. No products in which one or more of the factors is a sum are allowed.

The question is what kind of restriction I might place on products of surds. For real-valued surds $sqrt[n_1]a_1$,...,$sqrt[n_m]a_m$, a simple way to standardize the form of their product is to consolidate it into a single surd:
$$Pi_j=1^msqrt[n_j]a_j=sqrt[r]Pi_j=1^ma_j^fracrn_j$$
where $r=mathrmLCM(n_1,...,n_m)$. The restriction would then be that



  1. No products in which more than one of the factors is a surd are allowed.

It ensures that, for example, the inputs $sqrt3sqrt[3]2$ and $sqrt[6]3sqrt[3]6$ yield the common output $sqrt[6]108$. Together with restriction 3, it implies that the only allowed products are ones between one rational number and one surd.



However, since the program allows arbitrary radical expressions as inputs, I have to deal with complex-valued surds** too, and for them, the identity given above doesn't hold - I believe it's true up to multiplication by an appropriate root of unity. I tried working out a concrete example to see what it would look like:
$$sqrt-3sqrt[3]2=e^fracpi i3sqrt[6]-27*4=(frac12+fracsqrt-32)sqrt[6]-108$$
Unfortunately, given restriction 3, I would then have to resolve $fracsqrt-32sqrt[6]-108$, and the raising of the index of $sqrt-3$ from $2$ to $6$ necessary to consolidate this product would require another multiplication by $e^fracpi i3$, so that the sequence of manipulations would never terminate.



So first of all, is it in general impossible to enforce both restriction 3 and restriction 4 when complex-valued surds are involved, or does doing so just require being craftier than I was above? If the former, what is the best I could hope to do in enforcing a standard form for products of surds?



*I use the term "radical expression" to refer to the smallest set $S$ of complex numbers such that



  • $mathbbQsubset S$

  • If $a,bin S$, then $a+b,a-b,a*bin S$

  • If $a,bin S$ and $bne0$, then $fracabin S$

  • If $ain S$, $binmathbbQ$, and $a$ and $b$ are not both $0$, then $a^bin S$

The term also implies expression purely in terms of a finite combination of integers, arithmetic operations, and root extractions.



**I use the convention where $sqrt[n]a$ refers to the root of $a$ whose argument is $fracmathrmArg(a)n$ and $mathrmArg(a)$ is defined to be the argument of $a$ that lies in $[0,2pi)$.







share|cite|improve this question























    up vote
    0
    down vote

    favorite












    As an exercise, I'm writing a program that takes a radical expression* as an input and returns a radical expression equal to it that is in as close to a canonical form as possible. The ideal would be for the program to have the property that any two inputs that are equal have the same output. I recognize that I'm unlikely to manage this, but I can get "closer" by placing the tightest restrictions I can on the form the output can take. For example,



    1. No irrational denominators are allowed.

    2. All sums are linearly independent over the rationals.

    3. No products in which one or more of the factors is a sum are allowed.

    The question is what kind of restriction I might place on products of surds. For real-valued surds $sqrt[n_1]a_1$,...,$sqrt[n_m]a_m$, a simple way to standardize the form of their product is to consolidate it into a single surd:
    $$Pi_j=1^msqrt[n_j]a_j=sqrt[r]Pi_j=1^ma_j^fracrn_j$$
    where $r=mathrmLCM(n_1,...,n_m)$. The restriction would then be that



    1. No products in which more than one of the factors is a surd are allowed.

    It ensures that, for example, the inputs $sqrt3sqrt[3]2$ and $sqrt[6]3sqrt[3]6$ yield the common output $sqrt[6]108$. Together with restriction 3, it implies that the only allowed products are ones between one rational number and one surd.



    However, since the program allows arbitrary radical expressions as inputs, I have to deal with complex-valued surds** too, and for them, the identity given above doesn't hold - I believe it's true up to multiplication by an appropriate root of unity. I tried working out a concrete example to see what it would look like:
    $$sqrt-3sqrt[3]2=e^fracpi i3sqrt[6]-27*4=(frac12+fracsqrt-32)sqrt[6]-108$$
    Unfortunately, given restriction 3, I would then have to resolve $fracsqrt-32sqrt[6]-108$, and the raising of the index of $sqrt-3$ from $2$ to $6$ necessary to consolidate this product would require another multiplication by $e^fracpi i3$, so that the sequence of manipulations would never terminate.



    So first of all, is it in general impossible to enforce both restriction 3 and restriction 4 when complex-valued surds are involved, or does doing so just require being craftier than I was above? If the former, what is the best I could hope to do in enforcing a standard form for products of surds?



    *I use the term "radical expression" to refer to the smallest set $S$ of complex numbers such that



    • $mathbbQsubset S$

    • If $a,bin S$, then $a+b,a-b,a*bin S$

    • If $a,bin S$ and $bne0$, then $fracabin S$

    • If $ain S$, $binmathbbQ$, and $a$ and $b$ are not both $0$, then $a^bin S$

    The term also implies expression purely in terms of a finite combination of integers, arithmetic operations, and root extractions.



    **I use the convention where $sqrt[n]a$ refers to the root of $a$ whose argument is $fracmathrmArg(a)n$ and $mathrmArg(a)$ is defined to be the argument of $a$ that lies in $[0,2pi)$.







    share|cite|improve this question





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      As an exercise, I'm writing a program that takes a radical expression* as an input and returns a radical expression equal to it that is in as close to a canonical form as possible. The ideal would be for the program to have the property that any two inputs that are equal have the same output. I recognize that I'm unlikely to manage this, but I can get "closer" by placing the tightest restrictions I can on the form the output can take. For example,



      1. No irrational denominators are allowed.

      2. All sums are linearly independent over the rationals.

      3. No products in which one or more of the factors is a sum are allowed.

      The question is what kind of restriction I might place on products of surds. For real-valued surds $sqrt[n_1]a_1$,...,$sqrt[n_m]a_m$, a simple way to standardize the form of their product is to consolidate it into a single surd:
      $$Pi_j=1^msqrt[n_j]a_j=sqrt[r]Pi_j=1^ma_j^fracrn_j$$
      where $r=mathrmLCM(n_1,...,n_m)$. The restriction would then be that



      1. No products in which more than one of the factors is a surd are allowed.

      It ensures that, for example, the inputs $sqrt3sqrt[3]2$ and $sqrt[6]3sqrt[3]6$ yield the common output $sqrt[6]108$. Together with restriction 3, it implies that the only allowed products are ones between one rational number and one surd.



      However, since the program allows arbitrary radical expressions as inputs, I have to deal with complex-valued surds** too, and for them, the identity given above doesn't hold - I believe it's true up to multiplication by an appropriate root of unity. I tried working out a concrete example to see what it would look like:
      $$sqrt-3sqrt[3]2=e^fracpi i3sqrt[6]-27*4=(frac12+fracsqrt-32)sqrt[6]-108$$
      Unfortunately, given restriction 3, I would then have to resolve $fracsqrt-32sqrt[6]-108$, and the raising of the index of $sqrt-3$ from $2$ to $6$ necessary to consolidate this product would require another multiplication by $e^fracpi i3$, so that the sequence of manipulations would never terminate.



      So first of all, is it in general impossible to enforce both restriction 3 and restriction 4 when complex-valued surds are involved, or does doing so just require being craftier than I was above? If the former, what is the best I could hope to do in enforcing a standard form for products of surds?



      *I use the term "radical expression" to refer to the smallest set $S$ of complex numbers such that



      • $mathbbQsubset S$

      • If $a,bin S$, then $a+b,a-b,a*bin S$

      • If $a,bin S$ and $bne0$, then $fracabin S$

      • If $ain S$, $binmathbbQ$, and $a$ and $b$ are not both $0$, then $a^bin S$

      The term also implies expression purely in terms of a finite combination of integers, arithmetic operations, and root extractions.



      **I use the convention where $sqrt[n]a$ refers to the root of $a$ whose argument is $fracmathrmArg(a)n$ and $mathrmArg(a)$ is defined to be the argument of $a$ that lies in $[0,2pi)$.







      share|cite|improve this question











      As an exercise, I'm writing a program that takes a radical expression* as an input and returns a radical expression equal to it that is in as close to a canonical form as possible. The ideal would be for the program to have the property that any two inputs that are equal have the same output. I recognize that I'm unlikely to manage this, but I can get "closer" by placing the tightest restrictions I can on the form the output can take. For example,



      1. No irrational denominators are allowed.

      2. All sums are linearly independent over the rationals.

      3. No products in which one or more of the factors is a sum are allowed.

      The question is what kind of restriction I might place on products of surds. For real-valued surds $sqrt[n_1]a_1$,...,$sqrt[n_m]a_m$, a simple way to standardize the form of their product is to consolidate it into a single surd:
      $$Pi_j=1^msqrt[n_j]a_j=sqrt[r]Pi_j=1^ma_j^fracrn_j$$
      where $r=mathrmLCM(n_1,...,n_m)$. The restriction would then be that



      1. No products in which more than one of the factors is a surd are allowed.

      It ensures that, for example, the inputs $sqrt3sqrt[3]2$ and $sqrt[6]3sqrt[3]6$ yield the common output $sqrt[6]108$. Together with restriction 3, it implies that the only allowed products are ones between one rational number and one surd.



      However, since the program allows arbitrary radical expressions as inputs, I have to deal with complex-valued surds** too, and for them, the identity given above doesn't hold - I believe it's true up to multiplication by an appropriate root of unity. I tried working out a concrete example to see what it would look like:
      $$sqrt-3sqrt[3]2=e^fracpi i3sqrt[6]-27*4=(frac12+fracsqrt-32)sqrt[6]-108$$
      Unfortunately, given restriction 3, I would then have to resolve $fracsqrt-32sqrt[6]-108$, and the raising of the index of $sqrt-3$ from $2$ to $6$ necessary to consolidate this product would require another multiplication by $e^fracpi i3$, so that the sequence of manipulations would never terminate.



      So first of all, is it in general impossible to enforce both restriction 3 and restriction 4 when complex-valued surds are involved, or does doing so just require being craftier than I was above? If the former, what is the best I could hope to do in enforcing a standard form for products of surds?



      *I use the term "radical expression" to refer to the smallest set $S$ of complex numbers such that



      • $mathbbQsubset S$

      • If $a,bin S$, then $a+b,a-b,a*bin S$

      • If $a,bin S$ and $bne0$, then $fracabin S$

      • If $ain S$, $binmathbbQ$, and $a$ and $b$ are not both $0$, then $a^bin S$

      The term also implies expression purely in terms of a finite combination of integers, arithmetic operations, and root extractions.



      **I use the convention where $sqrt[n]a$ refers to the root of $a$ whose argument is $fracmathrmArg(a)n$ and $mathrmArg(a)$ is defined to be the argument of $a$ that lies in $[0,2pi)$.









      share|cite|improve this question










      share|cite|improve this question




      share|cite|improve this question









      asked yesterday









      Alex Kindel

      13110




      13110

























          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: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          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%2f2872512%2fstandardized-form-for-products-of-surds%23new-answer', 'question_page');

          );

          Post as a guest



































          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%2f2872512%2fstandardized-form-for-products-of-surds%23new-answer', 'question_page');

          );

          Post as a guest













































































          Comments

          Popular posts from this blog

          What is the equation of a 3D cone with generalised tilt?

          Color the edges and diagonals of a regular polygon

          Relationship between determinant of matrix and determinant of adjoint?