JessyOw

55 Reputation

5 Badges

9 years, 115 days

MaplePrimes Activity


These are questions asked by JessyOw

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]

Here is my command..

 

> mylist:=[4,6,2]: for x from 1 to nops (mylist) do convert (mylist[x], binary) end do;

> z:=map(convert, mylist, binary);

[100, 110, 10]

> map2(nprintf,"%08d",z);

[00000100, 00000110, 00000010]

 

how I need to continue the command to get the number of 1s in each of the binary number? 

Thank you~=]]

`00000100`, `00000110`, `00000010`

Hi, anyone know the command to convert a digit to 8 bits binary number ?

Thanks for help..

Hi, may I know how I should write the commands after I convert my 'Hello' to 34 and 27 by using the commands below..

Hope someone can help me, thanks a lot..=]] Have a nice day~

 

message:=’Hello’;

>Hello

plaintext:=convert(message,bytes);

>[72, 101, 108, 108, 111]

P:=numtheory[cfrac](plaintext);

>9418838187/130799212

M1:=numer(P);

>9418838187

M2:=denom(P);

>130799212

with(Bits):

bitM1:=Split(M1);

>[1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1]

bitM2:=Split(M2);

>[0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1]

with(Statistics):

Count(bitM1);

>34

Count(bitM2);

>27

[72, 101, 108, 108, 111]

1 2 3 Page 3 of 3