Alec Mihailovs

Dr. Aleksandrs Mihailovs

4455 Reputation

21 Badges

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

Social Networks and Content at Maplesoft.com

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 answers submitted by Alec Mihailovs

A usual way is to save your other (not master) files in a repository, see ?repository , ?libname , and ?LibraryTools. Some examples can be seen in ?examples,binarytree

Alec

It would be helpful if you also provided examples for other functions, as well as the output that you would like to have. Is the following OK?

seq(op([i,1],data),i=1..4);

Alec

The wikipedia article Snark (graph theory) has a link only to the page in Polish on the same topic, in which the term "Żmirłacz" is used. That sounds rather different.

The beginning of it sounds like "snake" in Polish,"żmija", but the translation of "shark" is "Rekina" which has a different ending - probably, something different was used.

Alec

In this particular example, it seems as if the value of Digits should be increased, because of the following:

evalf[20](1/6.);

                             0.1666666667

Can that be considered as a bug in evalf?

In particular, the following works OK,

Digits:=20:
`&/`:=(a,b)->b(a):
C := sin( Pi/6. ) &/ evalf;

                     C := 0.50000000000000000001

Alec

PS I posted my previous reply before seeing acer's reply above it, then I edited it, and tried to edit again, but already couldn't, because it got a reply. That's a very annoying feature of this site - that I can't edit my own posts if somebody replied to them. -Alec

Note that

evalf[20](sin(Pi/6.));

                        0.50000000009068996821

The desirable effect could be achieved by turning automatic simplification and evaluating of PI/6. off.

Alec

Gaussian elimination, in general, is not very good term for that, probably, because, as Acer correctly stated, PLU _is_  the Gaussian elimination, so calling one form of it "Gaussian elimination", and another one - "fraction free", is not exactly right - "fraction free" is also a form of Gaussian elimination.

Alec

One can use fsolve,

Z:=(x,N,c)->fsolve( N=Sum(  z^j / (1-exp(-j*c / x)) ,j=1..infinity), z);

For example,

Z(1.4,1,2);

                             0.4570317763

Alec

Skipping the PLU decomposition and lower triangular matrix would be even more clear - just "Use Gaussian elimination" (another popular choice is "fraction free")

The original form, "Get the PLU decomposition lower triangular factor.." sounds pretty clear to me, and mathematically correct.

"The lower triangular matrix of the PLU decomposition" is, maybe, clear, but not mathematically correct, without a special definition what it is. The correct expression would be "The lower triangular matrix from the PLU decomposition".

Alec

OK. Here are the detailed instructions for obtaining the source.

  1. Download 7-Zip and install it
  2. Download QRMlib_1.4.4.tar.gz
  3. Click right button on the downloaded file in Windows Explorer, then click 7-Zip and Extract Here
  4. Click right button on the extracted tar file and do the same thing, 7-Zip, Extract Here
  5. Go to the extracted folder, then folder R in it and open functionsCopulas.R in Notepad
  6. look at the rAC (at the very beginning) - you will need only the gumbel part of it, and at rstable (a few functions down). Do the replacements that I mentioned above, with replacing matrix by Matrix and using map for the elementwise operations on Matrices and Vectors.
  7. That's it.

Alec

Or binomial(n,3)-binomial(m,3)

Alec

Probably, the best would be starting from the mean. The binary search has the advantage that in the worst case it will do log2(n) steps, while starting from 1, in the worst case it will do n steps. Still, the Newton's method should be faster, and not limited to the end of the list. Or, perhaps, a combination method can be used - start with searching the list (from the mean), and if that require more than 2-3 steps, switch to Newton's method, using the last found list entry as the starting point.

Alec

Out of 4 standard functional programming elements in Maple, which are ->, map, select, and fold, fold seems to be the one less used. Does anybody have an explanation why?

Alec

I almost posted the code here based on the R sources (and located in functionsCopulas.R in the R folder), but then realized that I can't do that, because R is GPLd, and this site posts licensing is not GPL-compatible.

Anyway, it is rather short and easy to understand, so it shouldn't be hard to rewrite it in Maple. The 2 things that may be not completely obvious are

  1. <- should be replaced with :=
  2. runif(n) is a sample of length n from the Uniform(0,1) distribution

Good luck,

Alec

For lists, we usually use indices instead of op. For example,

a[1],a[3],a[4];

                          2, "john", sin(57)

seq(a[i],i in [1,3,4]);

                          2, "john", sin(57)

If you want to delete the second element, that can be done as

subsop(2=NULL,a);

                         [2, "john", sin(57)]

Alec

R is an open source, so it's easy to see how it's done.

Alec

First 41 42 43 44 45 46 47 Last Page 43 of 76