Items tagged with list list Tagged Items Feed

How to reverse the order in a list?

example:

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

block[i][j]:=block[i+1][j];

end do;

new_block[i]:=block[i];

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?

 

Regards,

Erik

>nombor1:=[4,6,2];

nombor1:=[4,6,2]

 

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

Thank you~=]]

>mylist:=468;

mylist:=468

 

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

Thank you~=]]

>teksbiasa:=`Kriptografi`;

teksbiasa:=Kriptografi

>nilaiASCI:=convert(teksbiasa,bytes);

nilaiASCII:=[75,114,105,112,116,111,103,114,97,102,105]

>kekuncirahsia:=3;

kekuncirahsia:=3

 

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`;

teksbiasa:=Kriptografi

>len:=length(teksbiasa);

len:=11

>nilaiASCII:=convert(teksbiasa, bytes);

nilaiASCII:=[75,114,105,112,116,111,103,114,97,102,105]

>L:=[seq(i,i=nilaiASCII)]

L:=[75,114,105,112,116,111,103,114,97,102,105]

 

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:

[86,125,116,123,127,122,114,125,108,113,116]

Thank you~=]]

[75,114,105,112,116,111,103,114,97,102,105]

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.

Thanks.

 

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

would like to apply op recurively 

and output list

[2,t,exp(t),2,t]

Hy

I have a list

A:=[[2,1],[1,2],[3,5],[7,6]]

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

I'm using

member([3,5],A,'t')

is there anything faster

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

thankyou for your time

Hello,

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

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

lhsEq2:=(trigsubs(2*combine(lhsEq2))[])/2;

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:

index(A,6) 
                      3

 

EDIT:

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

Now say I had two lists:

A:=[5,10,15,20,25,30,35,40,45,50]

B:=[7,14,21,28,35,42]

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:

FirstMatch(B,A)
                        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])

Hello, 

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

P.S:

If I can use Flatten, it would be fine

Hello,

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:

>MipEq(10);
{[0,[1,4,2,1]],[1,[2,1,4,2]],[2,[3,6,4,3]],[3,[3,6,4,3]],[4,[4,2,1,4]],[5,[4,3,6,4]],[6,[4,3,6,4]],[7,[5,8,6,5]],[8,[5,8,6,5]],[9,[5,8,6,5]],[10,[6,4,3,6]]}.

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:

{[0,[1,4,2,1]],[1,[2,1,4,2]],[[2,3],[3,6,4,3]],[4,[4,2,1,4]],[[5,6],[4,3,6,4]],[[7,8,9],[5,8,6,5]],[[10,[6,4,3,6]]}.

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;

Intervals:

> 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