vv

2152 Reputation

9 Badges

1 years, 213 days

MaplePrimes Activity


These are replies submitted by vv

Provided that Digits is >=3.  That's why I have used:
evalf[3](151/11);
convert(%,rational,3);

@taro 

@Axel Vogt 

This is exactly the same but a bit longer (due to the change and restore Digits)..

((t->[1,t[]])~)~(Tours);

@Kitonum 

@tomleslie 

In this context almost nothing can be guaranteed by a CAS: a zero of a continuous function, the convergence of a numerical sequence, ...
is(exp(1)+Pi, rational);
returns false, but this is not known. etc.

@acer 

You are right, I forgot (or maybe did not know) that for one variable method=branchandbound is able to find global extrema.

@dellair 

So, are you saying that Maple crashes is you copy&paste the above code in a fresh session?
In Maple 2016.2, 64 bit, Win 7 it works.

ok.mw

@dellair 

Note that Maximize also finds (generally) only local maxima. In your example the function was (almost) concave, that is why the command worked. Try:

Optimization:-Maximize(sin(x)*sin(x^2),x=1..7);

 

@Markiyan Hirnyk 

Your a  should be
a := int(eval(f,x=t)*exp(t), t = 0 .. x);

instead of

a := int(f*exp(t), t = 0 .. x);
Idem for b.
And Maple cannot compute them.

In Maple 2016.2 (64 bit) I obtain the correct result (for any value of UseHardwareFloats).

OK, but I don't see any collecting rule here. From a Maple point of view this would make sense if you want e.g. to extract some subexpression. But this subexpression must be somehow defined.

@taro 

@tomasmedici 

Yes, Carl found a counterexample for 4x4.
You have 2 options.
1. Use

IsI := proc(G1::GRAPHLN, G2::GRAPHLN, phi::name)
try  GraphTheory:-IsIsomorphic(args); 
  catch: false;  # actually FAIL
end try;
end proc:

It is OK for 4x4 (I have have checked it for graphs without loops).

2. Use the "from scratch" version. It works in all situations but is slower.
Note that for 5x5 there are too many graphs:  > 10^6 without loops and > 3*10^7 including loops, so you cannot list them.

@Carl Love 

Yes, for the proper digraphs (no loops) with 4 vertices I counted 110 counterexamples. It seems that for all of the pairs the graphs are not isomorphic. So, a better workaround for the moment would be:

IsI := proc(G1::GRAPHLN, G2::GRAPHLN, phi::name)
try  GraphTheory:-IsIsomorphic(args); 
  catch: FAIL;
end try;
end proc:

where FAIL should (probably) be interpreted as false.
 

@tomleslie 

1. The "extraneous crap" inverts the isomorphism G2-->G1. This would be necessary when IsIsomorphic(G1,G2,f) gives an error but  G1 and G2 are still isomorphic and f is wanted.
2. I said: seems to work. Anyway it works for the original question.
3. Do you have an example of a workaround for a Maple command which is guaranteed to work in each and every situation? I'd say that IsIso it's a typical workaround; do you have a counterexample for it?


 

 

@tomleslie 

It seems that my workaround is invisible :-)

IsIso(G1,G2);
      false

 

1 2 3 4 5 6 7 Last Page 1 of 57