Items tagged with list list Tagged Items Feed

How to reverse the order in a list?


i have m := [1, 1, 0, 0, 1, 1, 1, 0]

I want to get the output like newm:=[0,1,1,1,0,0,1,1].

How to solve? Any command can help?

If L is a list [a,c,b,d,f,e]

S is a list [b,c,f,e]

I want to use the permutation opf S to rearrange L [b,c,f,e,a,d]

In my case a,b,c,d,e,f are equations.

Does anyone know how to do crossover between block of binary number?

Example :

If I have 4 blocks, [0011001],[0011100], [0101010], and [1001110].

the first block will crossover with the second block, the second block will crossover with the third block, the third block will crossover with the last block and the last block must crossover with the first block. 

I had tried the code as below. 

for i from 1 to 4 do

for j from 1 to 7 do


end do;


end do;

The problem is the crossover can be done from 1 with 2, 2 with 3 and 3 with 4. But this code unwork for crossover for last block with the first block. Can someone help me? thank you in advance.

Dear Maple users

I wanted to use the zip-command to muliply two lists with units. It works without units, but not with units:



If I add units to each entrance it works too, but not very convenient. How is it done with units in the best way?







Hi, anyone know hot i need to continue my command to get 462 from [4,6,2]?

Thank you~=]]




Hi, how i need to continue my command to get [4,6,8] from 468?

Thank you~=]]








Hi, anyone know how i need to continue my command to add in kekuncirahsia(3) into nilaiASCII?
What i want to get>>[78,117,108,115,119,115,106,117,100,105,108]

Thank you, Have a nice day~=]]

Here is my command


> teksbiasa:=`Kriptografi`;




>nilaiASCII:=convert(teksbiasa, bytes);





Anyone know how i need to write the command to add the lenght of the text (len) into each of the number in nilaiASCII?

What is want to get is:


Thank you~=]]


Is there a way in Maple to convert a list into a string of numbers?

So [1,2,3,4,5] -> 12345

I have tried Maple help, but there are too many convert commands to try them all.
And the ones I have tried didn't work.



2*t*exp(t) + 2*t

would like to apply op recurively 

and output list



I have a list


I want to be able to tell what position the element [3,5] is in the list

I'm using


is there anything faster

maybe instead of storing as a list, I can use rtables or something?

thankyou for your time


A small question : what does [] mean at the end of a function or a list ? 

constants:= ({constants} minus {gamma})[]:


Thank you for your help

Hi, I need help finding the index of a given element in a list?

Say I have A:=[2,4,6,8,10,12], I want something that can do something like this:




Thanks, and sorry if my questions are trivial but I'm (clearly) not great with maple.

Now say I had two lists:



How would I get maple to return the index of the first element in list B that matches an element in list A, and the index of said element in list A? 

So something (remotely) like:

                        B[5], A[7]

(So I'm not looking for the first case of A[i]=B[i]. I just want i, j where A[i]=B[j])


How can I flatten this list ? [1,2,3, {4,5,6}]

I tried this :

Flatten([1,2,3, {4,5,6}]); But it doesn't work.

Flatten seems to work only on this kind of list [1,2,3, [4,5,6]]

and I would like to obtain this :[1,2,3,4,5,6]

Thank you for your help


If I can use Flatten, it would be fine


I need help to classify my output. If somebody can help me to do that. I want to write the procedure MipEq where
I am interested to extract the first entries for every lists and categorize them. If the second entries are the same, then I want to classify the first entries into one output. Say, I have this output:


The bold output, its second entries are the same. Therefore I want to classify all the first entries so that it doesnt repeat.

I would like to have the new output:


If the output is quite complicated to obtain, I can provide the procedures that involved in MipEq.
There are:
for parameter a,b:=3,1; 

The function F:

> Fp := proc (x) local Up, up; global a, b; Up := simplify((1/2)*(2*b-a+sqrt((2*b-a)^2+8*a*x))/a); if type(Up, integer) then up := Up+1 else up := ceil(Up) end if; return x+2*up*b-a*up^2 end proc;
> Fm := proc (x) local Um, um; global a, b; Um := simplify((1/2)*(-2*b-a+sqrt((2*b+a)^2-8*a*x))/a); um := ceil(Um); return x+2*um*b+a*um^2 end proc;
> F := proc (x) global Fp, Fm; Fm(Fp(x)); return % end proc;

The orbitPeriodic:

>OrbitPeriodic := proc (Map, ic) local orbit, t, z; z := ic; orbit[0] := z; for t while z <> ic or t = 1 do orbit[t] := z; z := Map(z); orbit[t] := z end do; return [seq(orbit[t], t = 0 .. t-1)] end proc;

The code:

>C := proc (x, Intvl) local i, n; n := nops(Intvl); if x = 0 then return 1 else for i from 2 to n do if x < Intvl[i] and Intvl[i-1] < x then return i-1 end if; if x = Intvl[i] then return i end if end do end if; "ERROR! YOU HAVE TO ADD THE INTERVALS" end proc;


> X := proc (m::integer) local D; D := (1/2)*a*m^2-b*m+(1/2)*a*m; return % end proc;
> Xp := proc (m::integer) local d; if 2*b < a then d := (1/2)*a*m^2-3*b*m+(3/2)*a*m-2*b+a else d := (1/2)*a*m^2+(7/2)*a*m-3*b*m+4*a-4*b end if; return % end proc;
>E := {seq(X(m), m = 0 .. 200)}; H := {seq(Xp(m), m = 0 .. 200)}; Intvl := `union`(E, H);

Equivalence Classes:

MipEq := proc (N) local Used, MinPts, IcCode, AllCodes, Codes, AC, q, ic, x, z, RT, AllPoints, Extract, EqClasses, EqClasses1; global F, C, OrbitPeriodic; Used := array(0 .. N); MinPts := array(0 .. N); IcCode := array(0 .. N); for ic from 0 to N do MinPts[ic] := true; for x in OrbitPeriodic(F, ic) do if x <= N then Used[x] := true end if end do end do; for ic from 0 to N do OrbitPeriodic(F, ic); IcCode[ic] := [ic, map(C, %, Intvl)] end do; Codes := {seq(IcCode[ic], ic = 0 .. N)}; AC := {seq(IcCode[ic][2], ic = 0 .. N)}; AllCodes := convert(AC, 'list'); RT := select(proc (x) options operator, arrow; `in`(x[1], AllCodes) end proc, Codes); return Codes, AllCodes end proc;

I hope somebody can help me.
Thank you very much for the help!

1 2 3 4 Page 1 of 4