f

#### Re: Re: Some bugs in Mathematica

```On 12 Aug 2005, at 06:08, Alex wrote:

> Kozlowski's posting is wrong from a to z. First, the square root of a
> complex number has two branches. One is "positive" and the other is
> "negative". So, if we cancel square root in the numerator and
> denominator, the worst error we can make is in the sign. There is no
> way to justify the fact that Mathematica was unable to do the
> simplification.
>

As for the first sentence above I think I should leave it to others
to make the judgement whether it applies to my posting more than to
everything posted by Mr. Khmelnitsky.

The statement that the square root of a complex number has two
brunches is well... not very deep: we could equally say that the cube
root has three branches, the fourth root has four etc... For example,
Mathematica gives

Solve[x^5 == a, x]

{{x -> a^(1/5)}, {x -> (-(-1)^(1/5))*a^(1/5)},
{x -> (-1)^(2/5)*a^(1/5)},
{x -> (-(-1)^(3/5))*a^(1/5)},
{x -> (-1)^(4/5)*a^(1/5)}}

so we could also say that we could cancel 5-th roots since the result
is determined "up to one of the 5-th roots of 1". Of course, the real
question is how Mathematica should have expressed this in a way that
would have been more useful and clearer than leaving the expression
un-cancelled. In particular, this expression would have to be such
that it could easily serve as input for subsequent algebraic
operations. The information about the possible "error" would have to
be carried along to the next operation. If there were a large number
of such cancellations in an expression, and a number of consecutive
operations had to be perfumed on it,  all of this information would
have to be combined and carried over successive steps. ALl of this
would involve mounting computational effort. In principle such an
approach is possible and I am sure it has been considered, but the
fact is that no CAS system known to me does anything of this but
instead  such expressions are left unchanged until the user provides
additional information in the form of assumptions is the approach
adopted by all the CAS know to me. If Mr. Khmelnitsky or any one
knows of better way I am sure he can make a career in the
computational algebra world, where there are quite many pretty clever
people who for at last 3 decades have been thinking about these
matters. However, before Mr. Khmelnitsky decides to embark  on this
project I suggest he learns about the InputForm of expressions
because very few people, and certainly not me, will ever bother to
try to decode the sort of input that the originator of this thread
has been providing (particularly that almost all of turned out to
have been incorrect).

Andrzej Kozlowski

``` 0 8/13/2005 7:36:17 AM comp.soft-sys.math.mathematica  28821 articles. 0 followers. 2 Replies 471 Views Similar Articles

[PageSpeed] 18

```I accept your challenge to improve algebra of complex numbers. Here is
my first installment. I claim that

\!\(\@\(1 - z1/z2\)\/\@\(z2 - z1\)\)

can be simplified to \!\(1/\@z2\), if Re[z2] > Re[z1]. Otherwise, the
result is Sign[Re[z1]Im[z2]-Im[z1]Re[z2]] Sign[Im[z2]-Im[z1]] /
Sqrt[z2].

I challenge Kozlowski and anybody else to give me a numerical example
where my formulas are incorrect.

Alex

Andrzej Kozlowski wrote:

> As for the first sentence above I think I should leave it to others
> to make the judgement whether it applies to my posting more than to
> everything posted by Mr. Khmelnitsky.
>
>   The statement that the square root of a complex number has two
> brunches is well... not very deep: we could equally say that the cube
> root has three branches, the fourth root has four etc... For example,
> Mathematica gives
>
>
>
> Solve[x^5 == a, x]
>
> {{x -> a^(1/5)}, {x -> (-(-1)^(1/5))*a^(1/5)},
>    {x -> (-1)^(2/5)*a^(1/5)},
>    {x -> (-(-1)^(3/5))*a^(1/5)},
>    {x -> (-1)^(4/5)*a^(1/5)}}
>
> so we could also say that we could cancel 5-th roots since the result
> is determined "up to one of the 5-th roots of 1". Of course, the real
> question is how Mathematica should have expressed this in a way that
> would have been more useful and clearer than leaving the expression
> un-cancelled. In particular, this expression would have to be such
> that it could easily serve as input for subsequent algebraic
> operations. The information about the possible "error" would have to
> be carried along to the next operation. If there were a large number
> of such cancellations in an expression, and a number of consecutive
> operations had to be perfumed on it,  all of this information would
> have to be combined and carried over successive steps. ALl of this
> would involve mounting computational effort. In principle such an
> approach is possible and I am sure it has been considered, but the
> fact is that no CAS system known to me does anything of this but
> instead  such expressions are left unchanged until the user provides
> additional information in the form of assumptions is the approach
> adopted by all the CAS know to me. If Mr. Khmelnitsky or any one
> knows of better way I am sure he can make a career in the
> computational algebra world, where there are quite many pretty clever
> people who for at last 3 decades have been thinking about these
> matters. However, before Mr. Khmelnitsky decides to embark  on this
> project I suggest he learns about the InputForm of expressions
> because very few people, and certainly not me, will ever bother to
> try to decode the sort of input that the originator of this thread
> has been providing (particularly that almost all of turned out to
> have been incorrect).
>
> Andrzej Kozlowski

``` 0 8/14/2005 8:50:47 AM
```O.K. I accept the challenge even though Mr. Khmelnitsky has ignored
my advice to learn input form. Well, this is definitely the last tim
eI am going to bother to decode his input but I hope this will
definitively settle the argument about which of us is "wrong form a
to z".

Here is Mr. Khmelnitsky's contribution to the algebra of complex
numbers in input form. He claims that

p = Sqrt[1 - z1/z2]/Sqrt[z2 - z1];

can be simplified to

q = 1/Sqrt[z2];

provided the following holds:

cond = Re[z2] > Re[z1];

Here is my very complicated counter example:

z2 = -5; z1 = -6;

Let's check if cond holds

cond

True

Let's compute p

p

I/Sqrt

Let's compute q:

q

-(I/Sqrt)

Let's see if they are equal:

p==q

False

It looks like Mr. Khmelnitsky's career in the field of computer
algebra will be a brief one.

(Given this record I didn't bother decoding and trying to disprove
his second claim nor will I ever try any more).

Andrzej Kozlowski

On 14 Aug 2005, at 10:38, Alex wrote:

> I accept your challenge to improve algebra of complex numbers. Here is
> my first installment. I claim that
>
> \!\(\@\(1 - z1/z2\)\/\@\(z2 - z1\)\)
>
> can be simplified to \!\(1/\@z2\), if Re[z2] > Re[z1]. Otherwise, the
> result is Sign[Re[z1]Im[z2]-Im[z1]Re[z2]] Sign[Im[z2]-Im[z1]] /
> Sqrt[z2].
>
> I challenge Kozlowski and anybody else to give me a numerical example
> where my formulas are incorrect.
>
> Alex
>
>
> Andrzej Kozlowski wrote:
>
>
>> As for the first sentence above I think I should leave it to others
>> to make the judgement whether it applies to my posting more than to
>> everything posted by Mr. Khmelnitsky.
>>
>>   The statement that the square root of a complex number has two
>> brunches is well... not very deep: we could equally say that the cube
>> root has three branches, the fourth root has four etc... For example,
>> Mathematica gives
>>
>>
>>
>> Solve[x^5 == a, x]
>>
>> {{x -> a^(1/5)}, {x -> (-(-1)^(1/5))*a^(1/5)},
>>    {x -> (-1)^(2/5)*a^(1/5)},
>>    {x -> (-(-1)^(3/5))*a^(1/5)},
>>    {x -> (-1)^(4/5)*a^(1/5)}}
>>
>> so we could also say that we could cancel 5-th roots since the result
>> is determined "up to one of the 5-th roots of 1". Of course, the real
>> question is how Mathematica should have expressed this in a way that
>> would have been more useful and clearer than leaving the expression
>> un-cancelled. In particular, this expression would have to be such
>> that it could easily serve as input for subsequent algebraic
>> operations. The information about the possible "error" would have to
>> be carried along to the next operation. If there were a large number
>> of such cancellations in an expression, and a number of consecutive
>> operations had to be perfumed on it,  all of this information would
>> have to be combined and carried over successive steps. ALl of this
>> would involve mounting computational effort. In principle such an
>> approach is possible and I am sure it has been considered, but the
>> fact is that no CAS system known to me does anything of this but
>> instead  such expressions are left unchanged until the user provides
>> additional information in the form of assumptions is the approach
>> adopted by all the CAS know to me. If Mr. Khmelnitsky or any one
>> knows of better way I am sure he can make a career in the
>> computational algebra world, where there are quite many pretty clever
>> people who for at last 3 decades have been thinking about these
>> matters. However, before Mr. Khmelnitsky decides to embark  on this
>> project I suggest he learns about the InputForm of expressions
>> because very few people, and certainly not me, will ever bother to
>> try to decode the sort of input that the originator of this thread
>> has been providing (particularly that almost all of turned out to
>> have been incorrect).
>>
>> Andrzej Kozlowski
>>
>
>

``` 0 8/16/2005 9:43:53 AM