%% Created by Maple V Release 4 (IBM INTEL NT)
%% Source Worksheet: TD_7corr.mws
%% Generated: Sun Mar 16 23:09:32 2008
\documentclass{article}
\usepackage{maple2e}
\DefineParaStyle{Maple Output}
\DefineCharStyle{2D Math}
\DefineCharStyle{2D Output}
\begin{document}




\section{Code bibinaire}


\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{bine:=proc(n)
local q,L,B,k;
q:=iquo(n,2);
L:=irem(n,2);
while q>0 do
  L:=L,irem(q,2);
  q:=iquo(q,2);
od;
#L:=[L];
#B:=NULL;
#for k to nops(L) do B:=B,L[-k];od;
#[B];
[L];
end:  
   
}{%
}
\end{mapleinput}

\begin{mapleinput}
\mapleinline{active}{1d}{

bibine:=proc(n)
local bi,ib,bibi,k;
ib:=bine(n);
   while evalb(irem(nops(ib),4)=0)=false do ib:=[(op(ib),0)]; od;
bibi:=NULL;
for k from 1 to nops(ib) by 4 do
       if evalb(ib[k..k+1]=[0,0])=true then bibi:=bibi,O;
         else if evalb(ib[k..k+1]=[1,0])=true then bibi:=bibi,A; 
         else if evalb(ib[k..k+1]=[0,1])=true then bibi:=bibi,E;
         else  bibi:=bibi,I;
 fi;
 fi;
 fi;
       if evalb(ib[k+2..k+3]=[0,0])=true then bibi:=bibi,H;
         else if evalb(ib[k+2..k+3]=[1,0])=true then bibi:=bibi,B; 
         else if evalb(ib[k+2..k+3]=[0,1])=true then bibi:=bibi,K;
         else  bibi:=bibi,D;
 fi;
 fi;
 fi;

od;
bi:=seq(ib[-k],k=1..nops(ib));
bibi:=seq(bibi[-k],k=1..nops([bibi]));
[bibi];
end:}{%
}
\end{mapleinput}

\begin{mapleinput}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{bine(0);}{%
}
\end{mapleinput}

\mapleresult
\begin{maplettyout}
                                                                      
    [0]
\end{maplettyout}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{bibine(2751);}{%
}
\end{mapleinput}

\mapleresult
\begin{maplettyout}
                                                                   [K,
E, K, I, D, I]
\end{maplettyout}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{bibine(1177);}{%
}
\end{mapleinput}

\mapleresult
\begin{maplettyout}
                                                                   [B,
O, K, A, K, A]
\end{maplettyout}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{decod=table([seq(bibine(k)=k,k=0..15)]):}{%
}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{enibib:=proc(L)
local N,k;
N:=0;
for k from 1 to nops(L)-1 by 2 do
   N:=N+decod[L[k..k+1]]*16^((nops(L)-(k-1))/2-1);
od;
N;
end:}{%
}
\end{mapleinput}

\begin{mapleinput}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{enibib([K,E,K,I,D,I]);}{%
}
\end{mapleinput}

\mapleresult
\begin{maplettyout}
                                                                      
                              2751
\end{maplettyout}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{enibib([B,O,K,A,K,A]);}{%
}
\end{mapleinput}

\mapleresult
\begin{maplettyout}
                                                                      
                              1177
\end{maplettyout}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{enibib(bibine(123456));}{%
}
\end{mapleinput}

\begin{mapleinput}
\end{mapleinput}

\mapleresult
\begin{maplettyout}
                                                                      
                             123456
\end{maplettyout}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{bibine(enibib([K,E,B,O,K,A,D,O]));}{%
}
\end{mapleinput}

\mapleresult
\begin{maplettyout}
                                                                      
                    [K, E, B, O, K, A, D, O]
\end{maplettyout}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{L:=[1,2,3]:}{%
}
\end{mapleinput}

\end{maplegroup}






\section{Groupes finis}


\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{ordre:=proc(k,U)
local j;
j:=1;
while evalc((U[k])^j)<>1 do
j:=j+1:
od;
j;
end:}{%
}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{GroupeFini:=proc(n)
local U,A,T,k,i,j,o,x;
 U:=[seq(exp(2*I*k*Pi/n),k=0..n-1)]:
A:=[seq([seq(evalc(U[i]*U[j]),j=1..n)],i=1..n)]:
T:=convert(A,array):
o:=seq(ordre(x,U),x=1..n);
print(U);
print(o);
print(T);
end:


}{%
}
\end{mapleinput}

\begin{mapleinput}
\end{mapleinput}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\mapleinline{active}{1d}{GroupeFini(3);}{%
}
\end{mapleinput}

\mapleresult
\begin{maplelatex}
\[
[1, \, - {\displaystyle \frac {1}{2}}  + {\displaystyle \frac {1
}{2}} \,I\,\sqrt{3}, \, - {\displaystyle \frac {1}{2}}  - 
{\displaystyle \frac {1}{2}} \,I\,\sqrt{3}]
\]
\end{maplelatex}

\begin{maplelatex}
\[
1, \,3, \,3
\]
\end{maplelatex}

\begin{maplelatex}
\[
 \left[ 
{\begin{array}{ccc}
1 &  - {\displaystyle \frac {1}{2}}  + {\displaystyle \frac {1}{2
}} \,I\,\sqrt{3} &  - {\displaystyle \frac {1}{2}}  - 
{\displaystyle \frac {1}{2}} \,I\,\sqrt{3} \\ [2ex]
 - {\displaystyle \frac {1}{2}}  + {\displaystyle \frac {1}{2}} 
\,I\,\sqrt{3} &  - {\displaystyle \frac {1}{2}}  - 
{\displaystyle \frac {1}{2}} \,I\,\sqrt{3} & 1 \\ [2ex]
 - {\displaystyle \frac {1}{2}}  - {\displaystyle \frac {1}{2}} 
\,I\,\sqrt{3} & 1 &  - {\displaystyle \frac {1}{2}}  + 
{\displaystyle \frac {1}{2}} \,I\,\sqrt{3}
\end{array}}
 \right] 
\]
\end{maplelatex}

\end{maplegroup}
\begin{maplegroup}
\begin{mapleinput}
\end{mapleinput}

\end{maplegroup}
\end{document}
%% End of Maple V Output
