pagan

5147 Reputation

23 Badges

17 years, 122 days

 

 

"A map that tried to pin down a sheep trail was just credible,

 but it was an optimistic map that tried to fix a the path made by the wind,

 or a path made across the grass by the shadow of flying birds."

                                                                 - _A Walk through H_, Peter Greenaway

 

MaplePrimes Activity


These are replies submitted by pagan

The number of integers between integers A and B, inclusive, is B-A+1.

So between 0 and 7, inclusive, there are eight integers.

You can check this by counting from 0 to 7 on your fingers. If that is confusing, then try it first from 1 to 8. And then think about why that is the same as counting from 0 to 7.

Hence

> add(0.5,x=0..7);
                                      4.0
 
> add(0.5,x=1..8);
                                      4.0
 
> 0.5*8;
                                      4.0

The term "dimension" is used for that.

And, in Maple

> convert(ampere,dimensions);
                               electric_current
 
> convert(m^3,dimensions);
                                    volume

So, you could say in English, "A quantity of electric current is measured in units of amperes." Or, "A quantity of volume is measured in units of meters-cubed."

The term "dimension" is used for that.

And, in Maple

> convert(ampere,dimensions);
                               electric_current
 
> convert(m^3,dimensions);
                                    volume

So, you could say in English, "A quantity of electric current is measured in units of amperes." Or, "A quantity of volume is measured in units of meters-cubed."

"Usually" suggests that the converse sometimes occurs, in which case the diagonalization approach may well produce an incorrect result. It could be unfortunate, if you didn't notice.

Perhaps Mathematica tries a similar approach, but only after trying to detect defective matrices (by computing the conditioning). Or perhaps they are not careful. You could test that by pumping many examples into Mathematica for which there were several `missing' eigenvectors, and examine the accuracy of the results.

"Usually" suggests that the converse sometimes occurs, in which case the diagonalization approach may well produce an incorrect result. It could be unfortunate, if you didn't notice.

Perhaps Mathematica tries a similar approach, but only after trying to detect defective matrices (by computing the conditioning). Or perhaps they are not careful. You could test that by pumping many examples into Mathematica for which there were several `missing' eigenvectors, and examine the accuracy of the results.

Thanks, Will.

I also find the new features index page to be helpful.

I noticed the following (minor) issue with section-links: my selecting one caused the page view to move down, but didn't cause the relevant section to appear opened (expanded). For example, after going from that index page to the packages page, I then selected the upper link to "RootFinding". That caused the page view to move down, to the RootFinding section. But the RootFinding section remained unopened (unexpanded). It would be nicer if the behaviour were for (sub)sections to open automatically when accessed from the page's table of contents (or via a url more generally).

In the corresponding Maple 13 Online Help page for what's new in packages, all the sections are already expanded. Maybe it was also an oversight to not upload such M14 pages with sections expanded?

While that does not actually mimic what the OP's original code does for both even and odd numbers of entries, something like this is possible.

> a:=[1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2]:
> [ListTools:-LengthSplit(a[1..-2],2,pad=a[-1])];
       [[1, 2], [3, 4], [5, 6], [7, 8], [9, 8], [7, 6], [5, 4], [3, 2]]
 
> a:=[1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2,17]:
> [ListTools:-LengthSplit(a[1..-2],2,pad=a[-1])];
       [[1, 2], [3, 4], [5, 6], [7, 8], [9, 8], [7, 6], [5, 4], [3, 2]]

And this still isn't a perfect match, with differing behaviour for number of entries of list `a` being any of 0, 1, or 2.

Ok, enough goofing around for one day, for me.

While that does not actually mimic what the OP's original code does for both even and odd numbers of entries, something like this is possible.

> a:=[1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2]:
> [ListTools:-LengthSplit(a[1..-2],2,pad=a[-1])];
       [[1, 2], [3, 4], [5, 6], [7, 8], [9, 8], [7, 6], [5, 4], [3, 2]]
 
> a:=[1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2,17]:
> [ListTools:-LengthSplit(a[1..-2],2,pad=a[-1])];
       [[1, 2], [3, 4], [5, 6], [7, 8], [9, 8], [7, 6], [5, 4], [3, 2]]

And this still isn't a perfect match, with differing behaviour for number of entries of list `a` being any of 0, 1, or 2.

Ok, enough goofing around for one day, for me.

It gets fun comparing them all, when the list `a` has an odd number of entries. It's plausible that could happen, and hence reasonable that the code would be supposed to somehow handle it.

> a:=[1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2,17]:

> [seq([a[2*i-1],a[2*i]],i=1..nops(a)/2)];
       [[1, 2], [3, 4], [5, 6], [7, 8], [9, 8], [7, 6], [5, 4], [3, 2]]

> [ListTools:-LengthSplit(a,2)];
    [[1, 2], [3, 4], [5, 6], [7, 8], [9, 8], [7, 6], [5, 4], [3, 2], [17]]
 
> [seq([a[i],a[i+1]], i=1..nops(a), 2)];
Error, invalid subscript selector

> convert(Matrix(nops(a)/2,2,a),listlist);
[[1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 17],
 
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]

So, each of the three given alternatives above would need fix-up in this regard.

It gets fun comparing them all, when the list `a` has an odd number of entries. It's plausible that could happen, and hence reasonable that the code would be supposed to somehow handle it.

> a:=[1,2,3,4,5,6,7,8,9,8,7,6,5,4,3,2,17]:

> [seq([a[2*i-1],a[2*i]],i=1..nops(a)/2)];
       [[1, 2], [3, 4], [5, 6], [7, 8], [9, 8], [7, 6], [5, 4], [3, 2]]

> [ListTools:-LengthSplit(a,2)];
    [[1, 2], [3, 4], [5, 6], [7, 8], [9, 8], [7, 6], [5, 4], [3, 2], [17]]
 
> [seq([a[i],a[i+1]], i=1..nops(a), 2)];
Error, invalid subscript selector

> convert(Matrix(nops(a)/2,2,a),listlist);
[[1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 17],
 
    [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]

So, each of the three given alternatives above would need fix-up in this regard.

If sol:=solve(expr,t) then the precise form a+b*I might not be obtained by simplify(evalc([sol])). For example, when expr:=t^3-t+10 and the a and b terms are combined.

But it seems easy enough to modify it slightly, eg. map(Re+Im*I,simplify(evalc([sol]))) or possibly even map((((simplify@Re)+(simplify@Im)*I)@evalc),[sol]).

If sol:=solve(expr,t) then the precise form a+b*I might not be obtained by simplify(evalc([sol])). For example, when expr:=t^3-t+10 and the a and b terms are combined.

But it seems easy enough to modify it slightly, eg. map(Re+Im*I,simplify(evalc([sol]))) or possibly even map((((simplify@Re)+(simplify@Im)*I)@evalc),[sol]).

The OP posts duplicates parts of his questions (there's this earlier one, and possibly another which might have been removed.)

The OP posts duplicates parts of his questions (there's this earlier one, and possibly another which might have been removed.)

I (sort of) understood it like this:

> restart:

> P:=(n,delta)->Statistics:-PDF(Statistics:-RandomVariable(
>       NonCentralFRatio(3,3*n,delta)),
>       Statistics:-Quantile(Statistics:-RandomVariable(
>       FRatio(3,3*n)),0.95,numeric),numeric):

> Optimization:-Maximize('P'(10,delt),delt=0..20);
             [0.198323174319974010, [delt = 6.70546102796105359]]
 
> #plot('P'(10,delt),delt=0..20);

> Optimization:-Maximize('P'(100000,delt),delt=0..20);
             [0.230643075153861010, [delt = 5.63740270097796525]]
 
> #plot('P'(10000,delt),delt=0..20);
First 46 47 48 49 50 51 52 Last Page 48 of 81