## 35 Reputation

13 years, 21 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.

## Thanks!...

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

## Thanks!...

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

## OK...

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

## OK...

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

## too easy? :(...

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!

## too easy? :(...

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!...

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!...

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.

## Alternative solution...

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!

## Alternative solution...

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!

## maple 9...

Are you sure GraphTheory is available for Maple 9?

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

## maple 9...

Are you sure GraphTheory is available for Maple 9?

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

## evalb...

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.

## evalb...

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.

## evalhf vs. matrices...

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
﻿