12810 Reputation

8 years, 325 days

Deleted questions again...

MaplePrimes

Two days ago I have answered a question about using numapprox:-infnorm for functions of several variables. The question is now deleted. Is it possible to find whether it was deleted by the author (even if she/he has used the "best answer" tag)?

Measuring execution time...

Maple

The simple test procedure P constructs a large matrix.
Measuring the real time twice  (t1 and t2), t2 was by about 25% larger!
Now, if we remove the comment  before "Start",  t1 increases by 25% and t2 ~ t1.
So, the timing depends on whether some output is already on screen (standard interface).
Can you explain this?

```restart;
P := proc(n,A)
local i, j;
for i from 1 to n do  for j from 1 to n do
A[i,j]:=sin(arcsin(1/i-1/j+1/n))-1/i+1/j-1/n+i+j
od od;
NULL  #A;
end proc:

# "Start";
n := 300:
s := time[real]():
A:=Matrix(n,datatype=float[8]):
P(n,A):
t1:=time[real]()-s;

s := time[real]():
A:=Matrix(n,datatype=float[8]):
P(n,A):
t2:=time[real]()-s;
t2/t1;  # 1.24   WHY?
```

(For one of my programs, I found t2/t1 = 1.7)

Psi(rational) ...

Maple

During the computation of a series, I needed the value Psi(1/12)  of the digamma function at a rational point.

simplify, convert/elementary or other usual convertions do not help.

But Maple knows the formula for Psi(r) when r is rational:

 (1)
 > (simplify@value)(eval(%, [n=0, p=1, q=12]));
 (2)
 > evalf(%);
 (3)

The question is: why does not Maple use this formula when asked? Or, is there a convertion which I was missing?

A probability riddle...

Maple

Here is a known probability riddle:

A and B are two lists of 100 binary numbers:

```A:=[0,1,0,1,0,1,1,0,1,1,1,0,0,1,1,1,1,0,1,0,1,0,1,0,1,0,1,1,0,1,0,1,0,0,0,1,0,1,0,1,0,1,1,1,1,1,0,0,1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0,0,0,1,1,1,1,0,0,0,1,0,1,0,0,0,0,0,1,1,1,0,1,0,1,0,1,0,1,0,0,0,1,1,0,1,0]:
B:=[0,1,1,0,1,1,0,1,1,1,0,1,0,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,0,0,1,0,1,0,1,1,0,1,1,0,0,0,0,0,0,1,0,1,1,1,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,1,0,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,0,0,1,0]:
```

One was obtained by tossing a coin (1 for a head, 0 for a tail), and the other by a human, who was asked to simulate tossing a coin.

Question: which one comes from a human brain?
The standard answer: B was produced using a coin, because (among other things) the probabilty of obtaining a "000000" or "111111" is about 80%, but a humain brain tends to avoid such "simulations".

My Question: what (if any) statistical test can be used in Maple for an answer?
(I have tried ChiSquareSuitableModelTest but both lists were accepted).

An unexpected PLOT bug...

Maple
```restart;
plot([sin(x), sin(x), x=0..420]);
```

The matrix A := op([1,1], %)  has equal columns, so the bug is in the PLOT engine.
plot(A) generates the same plot.