\documentclass[xcolor=hyperref,hyperef={naturalnames,pdfpagelabels},french]{beamer}
\usepackage{etex}
\usepackage[beamer]{preambule}
\usepackage[french,vlined,boxed]{algorithm2e}
\usepackage{bookmark}
\usepackage{movie15}
%\usepackage{multimedia}
% \usepackage{cclicenses}
% \usepackage{cclicence}


\setlength{\columnseprule}{0pt}

\graphicspath{{/home/moi/Lycee/2nde/2009_10/}{/home/moi/Photos/Maths/}{/home/moi/Figures/FigSTI/}{/home/moi/Figures/FigSeconde/}{/home/moi/Figures/figuresTS/}{/home/moi/Lycee/TDmaple/2007_8/}{/home/moi/IREM/IREM10_06_09/}}

%\usefont{OT1}{cmtt}{b}{n}

\newcommand\xc{\lstset{numbers=none,language=XCAS,xleftmargin=10pt,%
keywordstyle =\color{orange!60}\bfseries,basicstyle=\ttfamily\color{white},commentstyle=\normalfont\scriptsize\slshape,breaklines=true,backgroundcolor=\color{black!90!red},frame=trBL,framerule=1pt,framesep=4pt,rulesep=1pt,showstringspaces=false,stringstyle=\slshape,captionpos=b}
}


\newcommand\caml{
\lstset{numbers=none,language=Caml,xleftmargin=10pt,%
keywordstyle =\color{blue!40}\bfseries,basicstyle=\ttfamily\color{white},commentstyle=\normalfont\scriptsize\slshape,breaklines=true,backgroundcolor=\color{black!90!blue},frame=trBL,framerule=1pt,framesep=4pt,rulesep=1pt,showstringspaces=false,stringstyle=\slshape,captionpos=b}
}
\renewcommand\FancyVerbFormatLine[1]{\colorbox{green}{#1}}



\newcommand{\reponse}[1]{
\begin{center}
\textcolor{blue!70}{\texttt{#1}}
\end{center}
}





\mode<presentation>
{
  \usetheme[secheader]{Madrid}
  % or ...Warsaw

  \setbeamercovered{highly dynamic}
  % or whatever (possibly just delete it)
}
\usepackage{elephantbird}

\title[] % (optional, use only with long paper titles)
{Algorithmes de résolutions de systèmes}

\subtitle{ Illustrations avec XCAS et CAML}

\author[] % (optional, use only with lots of authors)
{Guillaume CONNAN  }
% - Give the names in the same order as the appear in the paper.
% - Use the inst{?} command only if the authors have different
%   affiliation.

\institute{\textsc{IREM} de Nantes}% (optional, but mostly needed)

\logo{\includegraphics[scale=0.15]{logoirem}}

\date[] % (optional, should be abbreviation of conference name)
{\today}
% - Either use conference name or its abbreviation.
% - Not really informative to the audience, more for people (including
%   yourself) who are reading the slides online

\subject{Algorithmes de résolution de sytèmes}


\beamerdefaultoverlayspecification{<+->}

\AtBeginSubsubsection[]
{
  \begin{frame}<beamer>
    \frametitle{Sommaire}
 {\scriptsize
\begin{multicols}{2}
    \tableofcontents[currentsection,currentsubsection]
       \end{multicols}
}

  \end{frame}
}




\AtBeginSubsection[]
{
  \begin{frame}<beamer>
    \frametitle{Sommaire}
 {\scriptsize
\begin{multicols}{2}
    \tableofcontents[currentsection,currentsubsection]
       \end{multicols}
}

  \end{frame}
}





\AtBeginSection[]
{
  \begin{frame}<beamer>
    \frametitle{Sommaire}
 {\scriptsize
\begin{multicols}{2}
    \tableofcontents[currentsection]
       \end{multicols}
}

  \end{frame}
}


% If you wish to uncover everything in a step-wise fashion, uncomment
% the following command: 

\beamerdefaultoverlayspecification{<+->}


% \usepackage[scaled]{helvet} % With " scaled " option
% \usepackage{eulervm} %


\begin{document}


\begin{frame}
  \titlepage
\end{frame}

\begin{frame}
 \frametitle{Sommaire}
{\scriptsize
\begin{multicols}{2} 
 \tableofcontents
\end{multicols}
}

 
 \end{frame}




\section{Systèmes de \textsc{Cramer} 2$\times$2}






\begin{frame}
  Soit un système $\bsys a_{11}x+a_{12}y=b_1\\ a_{21}x+a_{22}y=b_2\esys$.

\pause

Soit D le déterminant du sytème : $D=a_{11}a_{22}-a_{21}a_{12}$. 

\pause

S'il
est non nul,  il est assez aisé de montrer en  Seconde que les solutions
sont~:


$$x=\frac{b_{1}a_{22}-b_{2}a_{12}}{D}\qquad y=\frac{a_{11}b_{2}-a_{21}b_{1}}{D}$$


\pause

Cela   peut  mettre   en   évidence  les   rôles   des  inconnues   (qui
n'apparaissent pas en entrée dans l'algorithme) et des coefficients.

\end{frame}


\begin{frame}[fragile]
              
\begin{algorithm}[H]
\Entree{Les coefficients}
\Deb{
\eSi{D=0}{pas de solution unique}{$x=\frac{b_{1}a_{22}-b_{2}a_{12}}{D}\qquad y=\frac{a_{11}b_{2}-a_{21}b_{1}}{D}$}
 } 
\end{algorithm}
\end{frame}


\begin{frame}[fragile]
\xc
\begin{lstlisting}
cramer(a11,a12,b1,a21,a22,b2):={
 si a11*a22-a21*a12==0 
   alors return("Pas de solution unique")
   sinon return((b1*a22-b2*a12)/(a11*a22-a21*a12), (a11*b2-a21*b1)/(a11*a22-a21*a12))
 fsi
}:;
\end{lstlisting}

\end{frame}



\section{Pivot de \textsc{Gauss}}




\begin{frame}
  
Nous  traiterons le  cas  d'un  système $3\times3$  mais  rien n'empèche  de
généraliser.

\pause

Comme nous sommes entre nous, nous \og parlerons matrice\fg{}. 

\end{frame}



\begin{frame}
  
Nous  disposons donc  d'une matrice  carrée A  de dimension  3  et d'une
matrice   colonne  B  de   longueur  3.   Nous  voulons   résoudre  dans
$\mathfrak M_{13}(\bbr)$ le système $A\cdot X=B$.

Nous noterons T le tableau~:

$$
  \left[\begin{array}{ccc|c}
  a_{11}&a_{12}&a_{13}&b_1\\
  a_{21}&a_{22}&a_{23}&b_2\\
  a_{31}&a_{32}&a_{33}&b_3  
  \end{array}\right]
$$

\end{frame}


\begin{frame}
  
Si  la  matrice est  inversible,  alors,  en  effectuant des  opérations
élémentaires sur  les lignes, on peut  se ramener à  la matrice identité
dans la partie gauche du tableau et on obtient X dans la partie droite.

\end{frame}


\begin{frame}
  

Pour y arriver, l'idée est de balayer le tableau par colonne.

Étant donné  une colonne, on cherche un  élément non nul. S'il  n'y en a
pas,  la matrice  n'est pas  inversible et  le système  n'admet  pas une
unique solution (on  ne s'occupe pas trop du  rang au lycée...)~;~sinon,
on permute éventuellement  deux lignes pour placer l'élément  non nul de
la colonne  $k$ sur la ligne  $k$ et on  divise tous les éléments  de la
ligne par le nouveau $a_{kk}$ pour obtenir 1.

Il reste ensuite à remplacer chaque ligne (autre que $L_k$) dont l'élément de la colonne
$k$ est non nul par $L_i-a_{ik}\times L_k$.

\end{frame}


% \begin{frame}[fragile]
              
% \begin{algorithm}[H]
% \Entree{Le tableau T}
% \Ini{S\aff T}
% \Deb{
% \Pour{col de 1 jusqu'à 3}{
% line\aff col\;
% \Tq{S[line][col]=0}{
% line\aff line +1
% \Si{line=4}{\Retour{Le système n'admet pas de solution unique}}
% }%fin tant que

% \tcp{On échange les lignes "line" et "col"}

% temp\aff S[ligne]
% S[line]\aff S[col]
% S[colonne]\aff 1/temp[colonne]*temp

% \Pour{k dans $\{1,2,3\} \setminus\{col\} $}
% {S[k]\aff S[k]-S[k][col]*S[col]}

% }%fin pour col
% } 
% \Retour{la dernière colonne}
% \end{algorithm}
% \end{frame}



\begin{frame}[fragile]
\xc
\footnotesize
 \begin{lstlisting}
Gauss(T):={
local S,NoColonne,NoLigne,temp,E,k,j;
S:=T;
pour NoColonne de 0  jusque 2  faire
  NoLigne:=NoColonne;
  tantque S[NoLigne][NoColonne]==0 faire
    NoLigne:=NoLigne+1;
    si NoLigne==3 alors return("pas de solution unique");
    fsi; 
  ftantque;
 
 temp:=S[NoLigne];
 S[NoLigne]:=S[NoColonne];
 S[NoColonne]:=1/temp[NoColonne]*temp;

 E:=%{0,1,2%} minus %{NoColonne%};

 pour k in E faire 
   S[k]:=S[k]-S[k][NoColonne]*S[NoColonne];
 fpour;
fpour;
return([seq(S[j][3],j=0..2)])
}:;
\end{lstlisting}


\end{frame}


\end{document}

%%% Local Variables: 
%%% TeX-master: t
%%% End: 
