clementine

10 Reputation

One Badge

8 years, 43 days

MaplePrimes Activity


These are questions asked by clementine

I have the following maple code. 

R11 := x -> (x+2*a_1)*(product(x+b[j], j = 1 .. k-n))/(x+a_1);

T_4 :=  (z_1, z_2, z_3, z_4) -> R11(z_1)*z_2*z_3*z_4;

%*(z_1+a_1);

I would like maple to simplify (z_1+a_1) in the denominator of R11(z_1) with the (z_1+a_1) from the last line, but it does not do that. Simplify command also does not help.

Dear all, 

I have a procedure in Maple. Input is a list. The procedure should add to a list the list [6,5,4,3,2,1] and find if there are repetitions in this new list. After, if there are repetitions, it should return [NO, initial list] and if there are no repetitions, it should find how many elements of the first 5 are larger than the 6th element and return this number together with the sorted list - [6,5,4,3,2,1] in reverse order. (It sounds a bit strange but it's actually computing some sheaf cohomologies).

The problem is, when there are repetitions, the procedure returns an array, and if there are no repetitions, it returns exprseq. I would like both to be an array. Where's the mistake?

For example, coh([4, 0, 0, 0, 0, 4]) is an array and coh([0, 0, 0, 0, 0, 12]) is exprseq.

Here's the text of the program:


restart;
with(combinat);
with(ListTools);
n:=6;

coh := proc (L::list)

Hm := Array([0, 0]);

b := 0;

M := L+[6, 5, 4, 3, 2, 1];

a := evalb(ListTools:-FindRepetitions(M) = []);

if a = false then Hm := Array(['NO', L]) else

for i to 5 do if M[i] < M[6] then b := b+1

end if; 

end do;

K := sort(M);

KK := K+[-1, -2, -3, -4, -5, -6];

for j to n do

M[j] := KK[n-j+1]

end do;

Hm[1] := b;

Hm[2] := M;

print(Hm)

end if

end proc

Page 1 of 1