Alec Mihailovs

Dr. Aleksandrs Mihailovs

4495 Reputation

21 Badges

20 years, 339 days
Mihailovs, Inc.
Owner, President, and CEO
Tyngsboro, Massachusetts, United States

Social Networks and Content at Maplesoft.com

Maple Application Center

I received my Ph.D. from the University of Pennsylvania in 1998 and I have been teaching since then at SUNY Oneonta for 1 year, at Shepherd University for 5 years, at Tennessee Tech for 2 years, at Lane College for 1 year, and this year I taught at the University of Massachusetts Lowell. My research interests include Representation Theory and Combinatorics.

MaplePrimes Activity


These are replies submitted by Alec Mihailovs

Mario,

I guess you meant log instead of exp (the Taylor series for which is absolutely convergent for any argument).

Alec

Mario,

I guess you meant log instead of exp (the Taylor series for which is absolutely convergent for any argument).

Alec

Yes, Maple is slow. For example,

f:=proc()
    local s,i;
    s:=0;
    for i to 10000000 do s:=s+1./i od
end:

time(f());
                                33.805

time(add(1./i,i=1..10000000));
                                29.328

which is much slower than in any other interpreter, such as Python etc. that I've just tried.

It can be improved by using evalhf,

time(evalhf(f()));
                                3.244

time(evalhf(add(1/i,i=1..10000000)));

                                1.294

And it can be significantly improved by compiling,

f1:=proc()
    local s::float[8], i;
    option autocompile;
    s:=0;
    for i to 10000000 do s:=s+1./i od
end:

time(f1());
                                0.062

Of course, in this particular example, the answer can be found even faster,

time(harmonic(10000000.));
                                  0.

Alec

What would be a normal way of doing that (without Maple)? Something like

echo "obase=12;scale=1100;sqrt(2)"|bc

Now, I tried to execute that from Maple using ssystem and wasn't able to. Is it possible?

Alec

What would be a normal way of doing that (without Maple)? Something like

echo "obase=12;scale=1100;sqrt(2)"|bc

Now, I tried to execute that from Maple using ssystem and wasn't able to. Is it possible?

Alec

Well, the title "no" is unfriendly, I think. As well as the assumption that somebody like me, after 30+ years of teaching Calculus, might not understand what he was talking about :)

Alec

With something like

if not assigned(n) or n>=100 then n:=1 else n:=n+1 fi;

It is better (more secure) to use something different instead of n though, say _my_index_, for example. Or change the condition for n=100 - create a new Vector, for example.

Alec

 

With something like

if not assigned(n) or n>=100 then n:=1 else n:=n+1 fi;

It is better (more secure) to use something different instead of n though, say _my_index_, for example. Or change the condition for n=100 - create a new Vector, for example.

Alec

 

In those examples, they differ by a constant, F2=F1-1 and Q2=Q1-Pi/2.

Certainly, any expression can have different representations - in particular, sin(x)^2 can be always substituted with (1- cos(x)^2) etc.

It is, by the way, one of the standard ways of proving that 2 expressions, looking different, differ by a constant - find their derivatives, and any Calculus text has a variety of examples.

The "extra qualifying aspects" are well known - in particular, for real functions it is the first part of the Fundamental Theorem of Calculus.

Talking about simplification - whether every expression should have some canonical form to which all of different representations of it should be reduced by using simplify command (with some optional arguments) - I didn't mean that.

However, some things - such as cancelling sqrt(2) in the numerator and denominator of the result of the differentiation in my example above, certainly, should be done, even without simplify command. The fact that even simplify (without additional arguments) don't cancel them, is a bug, in my opinion.

Pagan, whoever you are - you chose to post anonymously, why are your posts always so unfriendly and full of negative emotions? Do you related some way with Maplesoft?

Do you really think that the result of the integration in my example should look as it currently looks (in case if it is "correct" in some sense, which may be)? Mathematica does much better job in this example, by the way.

Alec

 

 

I just tried to access that Oracles site and got the following error:

This site's MapleNet has similar and other problems all the time - I rarely can access a worksheet from a link to it.

Alec

PS  When I first heard about that site (Oracles), I thought - what a great idea - beats Wolfram integrals.com. Then I visited it and thought - uh-oh, what a bad representation of Maple - so slow, with so many errors, inconvenient to use. But now, after using Standard Maple for a while (from time to time, for this site postings), I started to think that may be not - that gives a pretty good idea of what Standard Maple is (Classic is still different fortunately.) -Alec

95 is more or less standard choice, and you have to subtract 32 before calculating a power mod 95 and and 32 after. For example, that can be done as

e:=x->(x-32)&^17 mod 95+32:
a:=StringTools:-Iota(32..126):
s:=convert(map(e,convert(a,bytes)),bytes):
F:=curry(StringTools:-CharacterMap,a,s):

Then both encoding and decoding can be done using F,

F("hello");

                               "Ttlly"

F(%);

                               "hello"

Such encodings, with replacing a character with another one, are very insecure (can be easily cracked if text is long enough), and have a practical use only for making puzzles for children (12 yrs and younger).

Alec

95 is more or less standard choice, and you have to subtract 32 before calculating a power mod 95 and and 32 after. For example, that can be done as

e:=x->(x-32)&^17 mod 95+32:
a:=StringTools:-Iota(32..126):
s:=convert(map(e,convert(a,bytes)),bytes):
F:=curry(StringTools:-CharacterMap,a,s):

Then both encoding and decoding can be done using F,

F("hello");

                               "Ttlly"

F(%);

                               "hello"

Such encodings, with replacing a character with another one, are very insecure (can be easily cracked if text is long enough), and have a practical use only for making puzzles for children (12 yrs and younger).

Alec

In your example with "hello", one could add 99 to every number in the resulting list. But that doesn't solve the problem in general. As I said earlier, if you are going to do calculations mod 33, representing characters with their ASCII codes is not a good idea.

Alec

In your example with "hello", one could add 99 to every number in the resulting list. But that doesn't solve the problem in general. As I said earlier, if you are going to do calculations mod 33, representing characters with their ASCII codes is not a good idea.

Alec

You get the original list mod 33. If you add 99 (which is 0 mod 33), you get the original list. But that might be different in other examples, including letters a, b, and spaces.

Alec

 

First 60 61 62 63 64 65 66 Last Page 62 of 180