19974 Reputation

15 years, 237 days

Why does the code not work in Maple 201...

Maple 2018

For some unknown reason, the code below does not work in Maple 2018.1, but works in Maple 2015 and Maple 2017 (the idea is taken from here

```restart;
with(plottools): with(plots):
V1,V2,V3,V4,V5,V6,V7,V8:=[0,-1,0],[0,0,0],[1,0,0],[1,-1,0],[0,-1,1],[0,0,1],[1,0,1],[1,-1,1]:  # The vertices of the cube
Faces:=[[V1,V4,V8,V5],[V5,V6,V7,V8],[V2,V3,V7,V6],[V1,V2,V3,V4],[V3,V4,V8,V7],[V1,V2,V6,V5]]: # The list of the faces
Colors:=[green, red,RGB(1, 0, 4),blue,grey,gold]: # The list of the colors
Cube[0]:=display([seq(polygon(Faces[i],color=Colors[i]),i=1..6)]):

for n from 1 to 7 do
F[n]:=t->rotate(Cube[n-1],t, [[0,n-1,0],[1,n-1,0]]):
Cube[n]:=rotate(Cube[n-1],-Pi/2, [[0,n-1,0],[1,n-1,0]]):
A[n]:=animate(display,[F[n](t)], t=0..-Pi/2,paraminfo=false);
od:

for m from 6 to 0 by -1 do
G[m]:=t->rotate(Cube[m+1],t, [[0,m,0],[1,m,0]]):
B[m]:=animate(display,[G[m](t)], t=0..Pi/2,paraminfo=false);
od:

C1:=display([seq(A[k], k=1..7)], insequence):
C2:=display([seq(B[k], k=6..0, -1)], insequence):
display([C1,C2], insequence, scaling=constrained, axes=normal);
```

Matrices of zeros and ones...

How to most effectively generate all matrices from zeros and ones (matrices size 6 by 6), such that in each row and in each column exactly 4 units. This problem was encountered in solving one problem in the field of entertaining mathematics. I know how to solve it in about 100 seconds, but I so far do not give my solution so that everyone can enjoy solving it.

How to put programmatically dots above s...

Maple 2016

How to put programmatically 2 dots above the first and the last digit  as in the example?

Since the new editor for some reason I cannot upload any pictures or files from my computer.

Incorrect calculation of definite integr...

Maple 2016

Quite accidentally I discovered incorrect calculation of the simple definite integral:

int(1/(x^4+4), x=0..1);

evalf(%);

1/8*ln(2)-1/16*ln(5)+1/32*Pi+1/8*arctan(1/3)   # This is incorrect result

0.1244471178

Is this a known bug?

If  first we calculate corresponding indefinite integral, and then by the formula of Newton - Leibniz, that everything is correct:

F:=int(1/(x^4+4), x):

eval(F, x=1)-eval(F, x=0);

evalf(%);

1/16*ln(5)+1/8*arctan(2)

0.2389834593

Why does Maple fail with this?...

Maple 2016

When generating the list of all the permutations of  [\$1..10]  we get an error:

combinat[permute]([\$ 1 .. 10]);

Error, (in combinat:-permute) Maple was unable to allocate enough memory to complete this computation. Please see ?alloc

But if the same problem to solve using a simple custom procedure, there is no any problems:

restart;

Permute := proc (L::list)

local n;

n := nops(L);

if nops(L) = 1 then return [L[1 .. 1]] else

[seq(seq([op(p[1 .. k-1]), L[1], p[k .. n-1][]], k = 1 .. n), p = Permute(L[2 .. n]))] end if;

end proc:

L := CodeTools[Usage](Permute([\$ 1 .. 10])):

nops(L);

 1 2 3 4 5 6 7 Page 3 of 9
﻿