Alec Mihailovs

Dr. Aleksandrs Mihailovs

4495 Reputation

21 Badges

20 years, 336 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

The situation in trading is different. Using gambling terminology, there is such thing as "rush" - for example, if a coin fell down heads up 3 times in a row, it is more probable that it will fall down heads up next time (because the person fliiping it might have a pattern making the coin falling down heads up more probable). Or, say, if a woman had 2 daughters, it is more probable that her next child will be a daughter as well - again, because the average 50% probability of having a daugter doesn't mean that a concrete person has also that probability. Some may have probability 30%, and some - 70%.

Alec

Well, I can write it as a formula. If 0 ≤ a < b, then from the additivity of probability,

P(d(X,m)<b) = P(d(X,m)<a) + P(a≤d(X,m)<b)

From the positivity of probability, P(a≤d(X,m)<b) ≥ 0, so

P(d(X,m)<b) ≥ P(d(X,m)<a).

Alec

Well, I can write it as a formula. If 0 ≤ a < b, then from the additivity of probability,

P(d(X,m)<b) = P(d(X,m)<a) + P(a≤d(X,m)<b)

From the positivity of probability, P(a≤d(X,m)<b) ≥ 0, so

P(d(X,m)<b) ≥ P(d(X,m)<a).

Alec

The first command invocation requires more time than further tries, so for time measurements it has sense to do it several times to get better estimates. Something like

time(seq(XXX(1000000),i=1..100));

                                0.530

Alec

These sequences can be also generated without combstruct as

for n to 11 do seq(binomial(n,m),m=1..n) od;

In small dimensions the simplices are just a point, a segment, a (regular) triangle, and a (regular) tetrahedron. They can be plotted using corresponding commands in the plottools, geometry and geom3d packages.

Also, their vertices and edges form a complete graph Kn, which can be plotted using GraphTheory package, for larger n as well.

If you ask in your last question what the ditto operators mean, that can be seen in ?%.

Alec

These sequences can be also generated without combstruct as

for n to 11 do seq(binomial(n,m),m=1..n) od;

In small dimensions the simplices are just a point, a segment, a (regular) triangle, and a (regular) tetrahedron. They can be plotted using corresponding commands in the plottools, geometry and geom3d packages.

Also, their vertices and edges form a complete graph Kn, which can be plotted using GraphTheory package, for larger n as well.

If you ask in your last question what the ditto operators mean, that can be seen in ?%.

Alec

I remember seeing on the Drupal site in the troubleshooting section (which could be reached through the FAQ if I remember correctly) a detailed advise how to deal with that - the problem, again if I remember correctly, could be solved by changing configuration options in MySQL, allowing it to allocate larger portions of memory.

Alec

I remember seeing on the Drupal site in the troubleshooting section (which could be reached through the FAQ if I remember correctly) a detailed advise how to deal with that - the problem, again if I remember correctly, could be solved by changing configuration options in MySQL, allowing it to allocate larger portions of memory.

Alec

It could be seen through showstat without changing kernelopts as

showstat(numtheory::invrec);

It can't be executed that way though (to see how it works) - for that setting opaquemodules=false in kernelopts is needed.

It looks as if it is just a part of the algorithm for invphi. Numtheory doesn't export it.

Alec

Now, compare that with adding array elements in Python (I used the IPython(x,y) console from the Python(x,y) distribution for Windows),

In [9]: a=randint(-100,100,10**8)

In [10]: time add.reduce(a)
CPU times: user 0.29 s, sys: 0.00 s, total: 0.29 s
Wall time: 0.28 s
Out[11]: -51005647

Alec

It was just my personal observation. The way I use Windows and Linux may be far from the most typical, so other people may have different opinions.

Same with reviews - it's not that easy to find a reviewer having similar experience (and weights) as you or me.

In this particular example, comparing speed of the same commands in Maple in Windows and Linux, on the same computer, the advantage of using Windows and Classic Maple is rather clear.

Alec

Yes, I did these measurements in 32-bit Maple - in Classic Maple interface in Windows. 64-bit Maple doesn't have Classic interface, so I use it quite rarely (if at all.)

Out of curiosity, I've just repeated them in 64-bit Maple 12 in Linux (Ubuntu 9.04).

n := 10^8:
A := LinearAlgebra:-RandomVector( n, outputoptions=[datatype=integer[8]] ):
time[real](add( A[i], i=1..n )); 
                                         
                                24.198

time[real](add( i, i=A ));

                                22.308

time[real](convert(A,`+`));

                                17.513

time[real](`+`(entries(A,nolist)));

Waited for a few minutes - it didn't stop, so I interrupted the calculation, but Maple stayed frozen and I couldn't do anything in it, so I closed it and then started it again.

time[real](rtable_scanblock(A,[],Sum));

                                6.353

time[real](trunc(Statistics:-Mean(A)*10^8));

                                7.837

Doing that second time gave

time[real](rtable_scanblock(A,[],Sum));

                                5.934

time[real](trunc(Statistics:-Mean(A)*10^8));

                               74.394

But for n=10^7 the order of results is about the same as in Windows, just about 3 - 5 times slower for procedures using external calling - obviously, Windows dll used by Maple are faster than Linux so.

That, by the way, confirms other evidence that Linux development has stalled last year or two. While Windows 7 is a significant step ahead, latest Linux upgrades, either kernel or desktop, are just minor improvements and bug fixing. A lot of not only new, but also 2 or 3 years old hardware, especially networking, doesn't work in Linux. It seems as if the Linux developers finally realized that they can't compete with Windows.

Conclusion: 32-bit Classic Maple in Windows is much better than 64-bit Standard Maple in Linux.

Alec

If you look at the

showstat(LinearAlgebra:-Modular:-Random);

you'll see that that at the end, after checking the number of arguments etc. it calls Create. So it is faster to use Create directly.

Alec

If you look at the

showstat(LinearAlgebra:-Modular:-Random);

you'll see that that at the end, after checking the number of arguments etc. it calls Create. So it is faster to use Create directly.

Alec

The default order of elements in a Matrix is Fortran_order, in which matrix elements listed as

A:=Matrix(2,symbol=a);

                           [a[1, 1]    a[1, 2]]
                      A := [                  ]
                           [a[2, 1]    a[2, 2]]

seq(A(i),i=1..4);

                  a[1, 1], a[2, 1], a[1, 2], a[2, 2]

seq(i,i=A);

                  a[1, 1], a[2, 1], a[1, 2], a[2, 2]

In this order, to get what you need, the matrix has to be transposed,

A^%T;

                         [a[1, 1]    a[2, 1]]
                         [                  ]
                         [a[1, 2]    a[2, 2]]

If you defined the C_order in the matrix, the transposing wouldn't be needed,

A:=Matrix(2,symbol=a, order=C_order);

                           [a[1, 1]    a[1, 2]]
                      A := [                  ]
                           [a[2, 1]    a[2, 2]]

seq(A(i),i=1..4);

                  a[1, 1], a[1, 2], a[2, 1], a[2, 2]

seq(i,i=A);

                  a[1, 1], a[1, 2], a[2, 1], a[2, 2]

Alec

First 39 40 41 42 43 44 45 Last Page 41 of 180