standardized form for products of surds
Clash 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,
- No irrational denominators are allowed.
- All sums are linearly independent over the rationals.
- 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
- 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)$.
complex-numbers soft-question radicals
add a comment |Â
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,
- No irrational denominators are allowed.
- All sums are linearly independent over the rationals.
- 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
- 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)$.
complex-numbers soft-question radicals
add a comment |Â
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,
- No irrational denominators are allowed.
- All sums are linearly independent over the rationals.
- 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
- 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)$.
complex-numbers soft-question radicals
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,
- No irrational denominators are allowed.
- All sums are linearly independent over the rationals.
- 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
- 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)$.
complex-numbers soft-question radicals
asked yesterday
Alex Kindel
13110
13110
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password