Carlo Carminati

35 Reputation

6 Badges

11 years, 101 days
Universita' di Pisa
Dr.

I am a researcher working in Pisa.

In a nutshell, I am interested in dyanamical systems, ergodic theory and number theory (expecially issues connected with continued fractions).

I am using Maple (mostly in a naive way :) to investigate some combinatorial issues arising from my research.

MaplePrimes Activity


These are replies submitted by Carlo Carminati

Thank you for the hint: it was useful (even if -unfortunately- my version of Maple hasn't got the Statistics pakage - quite old, indeed ;)

Thank you for the hint: it was useful (even if -unfortunately- my version of Maple hasn't got the Statistics pakage - quite old, indeed ;)

@grelade 

Ah, now is more clear. At first, I was thinking of "proportional" meaning "integer multiple".

@grelade 

Ah, now is more clear. At first, I was thinking of "proportional" meaning "integer multiple".

 

Be careful! "proportional" is different from algebraic.

for instance if

a:=2*sqrt(5); b:=2;
then
type(a/b, algebraic);

happens to be true!

 

Be careful! "proportional" is different from algebraic.

for instance if

a:=2*sqrt(5); b:=2;
then
type(a/b, algebraic);

happens to be true!

Thank you all.

In fact I remembered there was a way, but I could not remember the right syntax.

Unfortunately it seems that the syntax using the ~ operator does not work with my version of Maple, but the alternative suggested by Markyan is just what I needed.

Thank you all.

In fact I remembered there was a way, but I could not remember the right syntax.

Unfortunately it seems that the syntax using the ~ operator does not work with my version of Maple, but the alternative suggested by Markyan is just what I needed.

Thanks, Joe!

In fact yesterday, after posting my question, I ended up with a naive (but  even simpler) solution, namely:
###

for j from 1 to 5 do
writedata(cat("P",j,".dat"),[op(j,P)]):
od;
###

The [] embracing my list make it look like a list of lists, so it works!

Thanks, Joe!

In fact yesterday, after posting my question, I ended up with a naive (but  even simpler) solution, namely:
###

for j from 1 to 5 do
writedata(cat("P",j,".dat"),[op(j,P)]):
od;
###

The [] embracing my list make it look like a list of lists, so it works!

Are you sure GraphTheory is available for Maple 9?

Is it possible to retrieve and install this module without upgrading to a newer version?

 

Are you sure GraphTheory is available for Maple 9?

Is it possible to retrieve and install this module without upgrading to a newer version?

 

To continue on what Joe Riel said, please note that because Maple has three-valued logic, the result of evaluating a boolean expression may be true, false, or FAIL. So if you do want to project this onto {0,1} you'll have to think of what you would want FAIL to map to, or perhaps extend your destination range to {-1,0,1}.

That would be perfect. Indeed, why has Maple not an option allowing to choose the output which is more convenient for me?

If you prefer to work with integers and not evalhf as in Joe's answer, a slightly simpler implementation of your evalbb procedure which maps false and FAIL to the same place (which may or may not be what you want) is the following:

evalbb := proc(PP) option inline;
`if`(evalb(PP),1,0);
end proc:

I tried it: it is shorter, nicer,  but it is not any faster.

To continue on what Joe Riel said, please note that because Maple has three-valued logic, the result of evaluating a boolean expression may be true, false, or FAIL. So if you do want to project this onto {0,1} you'll have to think of what you would want FAIL to map to, or perhaps extend your destination range to {-1,0,1}.

That would be perfect. Indeed, why has Maple not an option allowing to choose the output which is more convenient for me?

If you prefer to work with integers and not evalhf as in Joe's answer, a slightly simpler implementation of your evalbb procedure which maps false and FAIL to the same place (which may or may not be what you want) is the following:

evalbb := proc(PP) option inline;
`if`(evalb(PP),1,0);
end proc:

I tried it: it is shorter, nicer,  but it is not any faster.

@ Joe Riel

However, for your purposes, you might be able to use ?evalhf, depending on the boolean expression. For example,

evalhf(3 < Pi);
                      1.0

Note that the result is float, not an integer.

As a matter of fact what I am checking is an identity of matrices in SL(2,Z); and the evalhf displays strange behaviour with matrices... should I write a short script to ask maple to check the identity componentwise, or is there a more clever way to proceed?

1 2 Page 1 of 2