## 2473 Reputation

1 years, 275 days

## displayprecision and typesetting...

Maple

According to the help page:
interface(displayprecision=n)
sets the number of decimal places to be displayed to n.
But this is true only if interface(typesetting=extended).
For interface(typesetting=standard),  n represents the number of decimal places after the decimal point.
Is there any reason for this decision?

restart;
x:=123.456789012345:
interface(displayprecision=4):
interface(typesetting=standard): x;

123.4568
interface(typesetting=extended): x;
123.5

## A simple limit - bug...

Maple

L := sum( 1/ln(k), k=2..n ) * ln(n)/n;

limit(L, n=infinity);
0
# Should be 1

Just curious: in Maple 2017, is it OK?

## TravelingSalesman - speed...

Maple

How is it possible that  GraphTheory:-TravelingSalesman
is much slower than a simple brute-force solution?

 > restart;
 > n:=10:
 > A:=Matrix(n, (i,j)->`if`(i=j,0,n*(n-i)^4+2*j+(n-i)^2+j^3)):A[1,2]:=100*n^3:A;
 (1)
 > with(GraphTheory):
 > G:=Graph(A);
 (2)
 > t:=time[real](): TravelingSalesman(G); 'time'=time[real]()-t;
 (3)
 > ############### brute-force #############
 > t:=time[real](): P:=Iterator:-Permute([seq(2..n)]): cmin:=infinity: ord:=<"none">: for  v in P do   f:=add(A[v[k],v[k+1]],k=1..n-2) + A[1,v[1]]+A[v[n-1],1];   if f
 (4)
 > # And for n=11 I had to interrupt TravelingSalesman; # brute-force still works for n=12.

## evalf random results - serious bug...

Maple

 > restart;
 > Digits:=10; to 10 do evalf(add(sin(k), k = 1 .. 10000)) od;
 (1)
 > restart;   # execute several times to obtain randomness
 > interface(version);
 (2)
 > Digits:=18;
 (3)
 > to 10 do   evalf(add(sin(k), k = 1 .. 10000)) od;
 (4)
 >

## Solving with Groebner basis...

Maple

Suppose that a finite set of polynomials in C[x,y,z] has a finite number of solutions (i.e. the generated ideal is 0-dimensional).

Suppose also that the Groebner basis wrt plex(x,y,z) is

[f(z), g(y,z), h(y,z), k(x,y,z)]

As well known, the system can be now easily solved: choose a root z0 of f, plug it into g and h and look for a common root (y0) etc.

The question is the following:
Is it true that for EVERY root z0 of f there exist y0, z0 such that (x0,y0,z0) satisfy the system?

In all the examples I have seen this is true, but I don't know whether this is true in general or there is a counterexample.

[This is not a pure Maple question but I know that some members here work in this area].

Thank you.

 1 2 3 4 Page 1 of 4
﻿