acer

32333 Reputation

29 Badges

19 years, 322 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

Yes, similarity is necessary, and so I tried be phrase it carefully. You had asked about efficient means, and since the problem is hard it seemed to me that a test of some necessary conditions (at a cost like that of, say, eigenvalue computation) might be of some use in practice. It might be used as a (reasonably low complexity) rejection filter.

acer

Yes, similarity is necessary, and so I tried be phrase it carefully. You had asked about efficient means, and since the problem is hard it seemed to me that a test of some necessary conditions (at a cost like that of, say, eigenvalue computation) might be of some use in practice. It might be used as a (reasonably low complexity) rejection filter.

acer

If Matrices A and B are not similar then there is no invertible Matrix C such that C.A=B.C, and hence no P=C^(-1) with the same property. See IsSimilar. For floating-point Matrices, you might consider looking at eigenvalues.

acer

If Matrices A and B are not similar then there is no invertible Matrix C such that C.A=B.C, and hence no P=C^(-1) with the same property. See IsSimilar. For floating-point Matrices, you might consider looking at eigenvalues.

acer

> M := Matrix(2,2,symbol=m);
                                [m[1, 1]    m[1, 2]]
                           M := [                  ]
                                [m[2, 1]    m[2, 2]]
 
> M^(-1) ;
                           [ m[2, 2]       m[1, 2]]
                           [ -------     - -------]
                           [   %1            %1   ]
                           [                      ]
                           [  m[2, 1]     m[1, 1] ]
                           [- -------     ------- ]
                           [    %1          %1    ]
 
                    %1 := m[1, 1] m[2, 2] - m[1, 2] m[2, 1]

There are the formulae for each entry of the inverse of a general 2x2 Matrix. Just code those up in a procedure that accepts argument m (a 2x2 Matrix).

acer

> M := Matrix(2,2,symbol=m);
                                [m[1, 1]    m[1, 2]]
                           M := [                  ]
                                [m[2, 1]    m[2, 2]]
 
> M^(-1) ;
                           [ m[2, 2]       m[1, 2]]
                           [ -------     - -------]
                           [   %1            %1   ]
                           [                      ]
                           [  m[2, 1]     m[1, 1] ]
                           [- -------     ------- ]
                           [    %1          %1    ]
 
                    %1 := m[1, 1] m[2, 2] - m[1, 2] m[2, 1]

There are the formulae for each entry of the inverse of a general 2x2 Matrix. Just code those up in a procedure that accepts argument m (a 2x2 Matrix).

acer

The user can create a initialization file to correct a bad default value for currentdir. The user can also adjust the Properties of the desktop launcher to correct a bad default value for currentdir.

The user can fix the bad default currentdir value, if told how. That is not at issue.

My point is that users (and especially new users) will have little or no idea how to do these things, or even be aware that they could/should be done. It should be fixed in the product.

acer

The user can create a initialization file to correct a bad default value for currentdir. The user can also adjust the Properties of the desktop launcher to correct a bad default value for currentdir.

The user can fix the bad default currentdir value, if told how. That is not at issue.

My point is that users (and especially new users) will have little or no idea how to do these things, or even be aware that they could/should be done. It should be fixed in the product.

acer

When Maple gets installed, can its installer set the Properties of the desktop launcher? If it could, then it could explicitly set it to a better default.

acer

When Maple gets installed, can its installer set the Properties of the desktop launcher? If it could, then it could explicitly set it to a better default.

acer

It is great to see Maple's help online.

The feedback mechanism on each page looks useful.

As first-versions go, it is very good. (It's very hard to make the first version of anything near perfect.) And since it is online it can be adjusted or improved independently of Maple patch releases.

I have a few suggestions for improvements:

  • When a search would return only one item, then display it immediately (that is how Maple's own Help works). Right now it shows a page with just the link to the single result.
  • Provide the alternate text in the properties on any 2D Math output. (Mapleprimes does this.)
  • Have the subsections of a help-page be url targets, so that one can link to the offset Examples, See Also, Description, CallingSequence, etc.
  • Provide a way to get all the Examples as 1D Maple Notation. Maple's own Help has a toggle for this, but the Online Help might provide 1D with its own mechanism.
  • Have a better way to deal with hidden code in the Applications worksheets. I realize this could be difficult, but otherwise application pages like the one for Image Processing appear obscure.
  • Make the site faster.
  • The information for titles for individual pages is certainly availaible (it gets used nicely in the table-of-contents in the left-bar). But it doesn't get properly used in the summaries on the right. For example, going to this summary page shows titles like Student/plot_options while the table-of-contents shows the much nicer Plot Options. It could be set out more nicely on the right as Student / Plot Options. There are many more unreadable examples, such as on the Error Message Guide summary here. Again, the table-of-contents demonstrates that the nicer name is available.

acer

I was so focused on the kludge. EmpiricalDistribution is just what you want.

> with(Statistics):
> X:=RandomVariable(EmpiricalDistribution(<0,0,0,0,1,2,2,2>)):
> Sample(X,10);
                   [0., 1., 0., 0., 0., 1., 0., 2., 0., 2.]
 
> Mean(X), evalf(Mean(Sample(X,1000000)));
                      0.875000000000000000, 0.8757290000
 
> CDF(X,-1), CDF(X,0), CDF(X,1), CDF(X,2), CDF(X,3);
                               0, 1/2, 5/8, 1, 1

Now, how to create the Vector V so that EmpiricalDistribution does whatever customized discrete distribution you want. How about this,

> L := [0=1/2,1=1/8,2=3/8]:
> l := lcm(seq(denom(rhs(x)),x in L)):
> V := Vector[row](l, [seq(lhs(x)$l*rhs(x), x in L)] );
                         V := [0, 0, 0, 0, 1, 2, 2, 2]

So then you should be able to use EmpiricalDistribution(V).

acer

I was so focused on the kludge. EmpiricalDistribution is just what you want.

> with(Statistics):
> X:=RandomVariable(EmpiricalDistribution(<0,0,0,0,1,2,2,2>)):
> Sample(X,10);
                   [0., 1., 0., 0., 0., 1., 0., 2., 0., 2.]
 
> Mean(X), evalf(Mean(Sample(X,1000000)));
                      0.875000000000000000, 0.8757290000
 
> CDF(X,-1), CDF(X,0), CDF(X,1), CDF(X,2), CDF(X,3);
                               0, 1/2, 5/8, 1, 1

Now, how to create the Vector V so that EmpiricalDistribution does whatever customized discrete distribution you want. How about this,

> L := [0=1/2,1=1/8,2=3/8]:
> l := lcm(seq(denom(rhs(x)),x in L)):
> V := Vector[row](l, [seq(lhs(x)$l*rhs(x), x in L)] );
                         V := [0, 0, 0, 0, 1, 2, 2, 2]

So then you should be able to use EmpiricalDistribution(V).

acer

Yes, thanks. I was only speaking directly to plots:-display rather than in general. But you bring up a good point.

As ?colondash indicates, since DEplot is not a protected name and may be also used as a local in the current scope, the truly safe form is DEtools[':-DEplot']. And, as you mention, because DEtools is table-based rather than a module, there is no choice to use the much nicer and equally safe :- form.

And here is the rub. For table-based packages, there is no nice :- form. So the only truly safe form is like A[':-B'] which is a pain. The are even some examples of potential problems documented on ?colondash which are only problematic for table-based packages. But with module-based packages the issue is almost entirely avoidable, just by going with :- instead of [] all the time.

The great pity, then, is that Maple's documentation uses the [] form throughout. I am confident that the Maple community could easily adapt to the :- form, even if it is a different syntax than for the few remaining (shrinking) number of table-based packages. There are several usage and convenience safety benefits, and the downside of syntax incompatibility with the shrinking number of old table-based packages is limited.

The only time that [] syntax might be needed for module-based package A is when all the entry points A[B] had to be formed and dealt with programmatically (and where exports(A) was not enough). Very few users will ever need to do that (except Joe R, of course!).

acer

Yes, thanks. I was only speaking directly to plots:-display rather than in general. But you bring up a good point.

As ?colondash indicates, since DEplot is not a protected name and may be also used as a local in the current scope, the truly safe form is DEtools[':-DEplot']. And, as you mention, because DEtools is table-based rather than a module, there is no choice to use the much nicer and equally safe :- form.

And here is the rub. For table-based packages, there is no nice :- form. So the only truly safe form is like A[':-B'] which is a pain. The are even some examples of potential problems documented on ?colondash which are only problematic for table-based packages. But with module-based packages the issue is almost entirely avoidable, just by going with :- instead of [] all the time.

The great pity, then, is that Maple's documentation uses the [] form throughout. I am confident that the Maple community could easily adapt to the :- form, even if it is a different syntax than for the few remaining (shrinking) number of table-based packages. There are several usage and convenience safety benefits, and the downside of syntax incompatibility with the shrinking number of old table-based packages is limited.

The only time that [] syntax might be needed for module-based package A is when all the entry points A[B] had to be formed and dealt with programmatically (and where exports(A) was not enough). Very few users will ever need to do that (except Joe R, of course!).

acer

First 495 496 497 498 499 500 501 Last Page 497 of 591