\documentclass[10pt,a4paper,svgnames,openany,utf8,fourier,biblio,pstricks]{trmbookinfo2}
\usepackage{etex}
\usepackage{preambuleTrm}
\usepackage{lcd}
\usepackage{colortbl}
\usepackage{ifplatform}

% \usepackage% [off]
% {auto-pst-pdf}
% \usepackage{pst-tree}
%\usepackage[scaled=0.85]{luximono}
\usepackage{caption,soul}
\captionsetup{labelformat=empty,font=footnotesize}


%\usepackage{bera}
%\usepackage[scaled=0.8]{beramono}
\usepackage{enumitem}

\usepackage{tikz}
\usetikzlibrary{automata,fit,trees,matrix,arrows,decorations.pathmorphing,shapes.arrows,chains,positioning,intersections,backgrounds,calc,through,mindmap}
\newcommand{\myunit}{1.1cm}
\usepackage{tkz-graph}
\usepackage{circuitikz}

\usepackage{Karnaugh}
%\usepackage{pro-probas}
%\usepackage[autolanguage]{numprint}

\usepackage{cclicenses}
\usepackage{cclicence}

\newcolumntype{A}{>{\arraybackslash}X}

\usepackage{textcomp}
\usepackage{ mathtools,xlop}

\hypersetup{
pdftitle={Poly d'Info 1/2 - Mathématiques - IUT de Nantes}, % title
}


\usepackage{algo}

\renewcommand{\algocommentfont}{\footnotesize\ttfamily\itshape}
\renewcommand{\algotextfont}{\footnotesize}
\renewcommand{\algokeywordfont}[1]{{\footnotesize\sffamily\upshape\bfseries#1}}
\renewcommand{\algokeywordfrom}{De}
\newcommand\nor{\downarrow}
\newcommand\nand{\mid}


\setcounter{tocdepth}{2}


\entet{\leftmark }{\rightmark }{\href{http://informathix.tuxfamily.org/}{Licence
    Creative Commons}\byncsa}%g,d,b

\renewcommand{\TR}{\mathcal{T}}


\title{Probabilités pour l'informatique (I)}

\author{ Guillaume \textsc{Connan} }

\date{ IUT INFO 1 / 2011-2012 
}


\newcommand\soustitre{
  Licence Creative Commons
\CcGroupByNcSa{1.25}{1.25ex}

MAJ: \today
}


\coverillustration{\includegraphics[width=6cm]{pomme}}




\renewcommand{\vect}{\ve}




\newcommand\maple{\lstset{numbers=none,language=Maple,xleftmargin=10pt,%
keywordstyle=\color{red!50!black}\usefont{OT1}{cmtt}{b}{n},basicstyle=\ttfamily\color{red!50!black},commentstyle=\normalfont\small\itshape,breaklines=true,frame=trBL,framerule=1pt,framesep=4pt,rulesep=1pt,backgroundcolor=\color{yellow!60!white},showstringspaces=false,stringstyle=\slshape,captionpos=b}}% ,index=[2][keywords],indexstyle=[2]\indexkeywordsmaple} 


\newcommand\Pasc{\lstset{numbers=none,language=Pascal,xleftmargin=10pt,%
keywordstyle =\color{bleu}\bfseries,basicstyle=\ttfamily\color{0.1white},commentstyle=\normalfont\scriptsize\slshape,breaklines=true,backgroundcolor=\color{green!20},frame=trBL,framerule=1pt,framesep=4pt,rulesep=1pt,showstringspaces=false,stringstyle=\slshape,captionpos=b}
}



\newcommand\pasc{\lstset{numbers=none,language=Pascal,xleftmargin=10pt,%
keywordstyle =\color{bleu}\bfseries\footnotesize,basicstyle=\ttfamily\color{0.1white}\footnotesize,commentstyle=\normalfont\scriptsize\slshape,breaklines=true,backgroundcolor=\color{green!20},frame=trBL,framerule=1pt,framesep=4pt,rulesep=1pt,showstringspaces=false,stringstyle=\slshape\footnotesize,captionpos=b}
}




\newcommand\shell{\lstset{numbers=none,language=sh,xleftmargin=10pt,%
keywordstyle =\color{bleu}\bfseries\small,basicstyle=\ttfamily\color{0.1white}\small,commentstyle=\normalfont\footnotesize\slshape,breaklines=true,backgroundcolor=\color{green!20},frame=trBL,framerule=1pt,framesep=4pt,rulesep=1pt,showstringspaces=false,stringstyle=\slshape\small,captionpos=b,escapeinside=?!}
}






\newcommand\caml{\lstset{numbers=none,language=Caml,xleftmargin=10pt,%
keywordstyle =\small\color{blue!70!black}\bfseries,basicstyle=\small\ttfamily\color{0.1white},commentstyle=\normalfont\scriptsize\slshape,breaklines=true,backgroundcolor=\color{blue!10},frame=trBL,framerule=1pt,framesep=4pt,rulesep=1pt,showstringspaces=false,stringstyle=\slshape,captionpos=b}
}



\newcommand\sage{\lstset{numbers=none,language=sage,xleftmargin=10pt,%
keywordstyle =\color{blue!70!black}\bfseries,basicstyle=\ttfamily\color{0.1white},commentstyle=\normalfont\scriptsize\slshape,breaklines=true,backgroundcolor=\color{orange!10},frame=trBL,framerule=1pt,framesep=4pt,rulesep=1pt,showstringspaces=false,stringstyle=\slshape,captionpos=b,emph={sage},emphstyle=\color{blue!60!black}\bfseries\large,mathescape=true% ,delim=**[l][\ttfamily\color{0.1white}]sage:
,moredelim=[il][\slshape\color{black!30}]§}
}



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


\newcommand\scilab[1][\small]{\lstset{numbers=none,language=scilab,xleftmargin=10pt,%
keywordstyle =\small\color{bleu}\bfseries,basicstyle=#1\ttfamily\color{0.1white},commentstyle=\normalfont\scriptsize\slshape,breaklines=true,backgroundcolor=\color{gray!10},frame=trBL,framerule=1pt,framesep=4pt,rulesep=1pt,showstringspaces=false,stringstyle=\slshape,captionpos=b}
}




\graphicspath{{/home/moi/Lycee/TDmaple/2006_7/}{/home/moi/Figures/Arbres_Graphes/}{/home/moi/Figures/FigSTI/}{/home/moi/Figures/FigMaple/}{/home/moi/Photos/Maths/}{/home/moi/Photos/Tehessin/}{/home/moi/Figures/FigSTI/}{/home/moi/Figures/FigSeconde/}{/home/moi/Lycee/Informatique/XCAS/2008_9/}{/home/moi/Lycee/TDmaple/2008_9/}{/home/moi/IUT/Thierry/Conversions/}{/home/moi/Photos/informathix/}{/home/moi/Lycee/Informatique/PafAlgo/}{/home/moi/Figures/figuresAlice/}{/home/moi/Figures/FigSeconde/}{/home/moi/Alice/2009/bcpst/CHAP0/}}


\fvset{%
fontfamily=courier,fontseries=b,formatcom=\color{black}}

%\includeonly{hommage,iut_intro,ens_rel,logic,caml_guide}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\setlength{\headheight}{23pt}


%\renewcommand\chaptername{TP}

\renewcommand\verb{\Verb}



\newcommand{\func}{\mathbf}
\renewcommand\CR{{\complement}}








\begin{VerbatimOut}{XCAStablenorm.cxx}
tablenormale(L):={
local pp,pd,j,k,t,T,u,Ti,Tbis,TT,XCAStablenormx,m,s,x;
m:=L[0];s:=L[1];x:=L[2];
tt:=evalf((x-m)/s);
if(tt<0){tp:=-tt}else{tp:=tt};

pp:=trunc(10*(tp));
pd:=floor((tp-pp*0.1)*100); 
// on fixe le nombre de chiffres après la virgule, ici 5
DIGITS:=5;
pd:=pd+1;
pp:=pp+1;

T:=[[0,seq(0.00+k*0.01,k=0..9)],seq([0.0+j*0.1,seq(evalf(normal_cdf(j*0.1+m*0.01)),m=0..9)],j=0..29)];
u:=seq("c|",k=0..10);
u[pd]:=">{\\columncolor[gray]{0.7}}c|";
Ti:="";
for(k:=0;k<size(u);k++){Ti:=Ti+u[k]};
Tbis:=[seq([seq(10,j=0..ncols(T)-1)],nrows(T)-1)];
Tbis:=for(k:=0;k<nrows(T);k++){Tbis[k]:=[seq(string(T[k,j])+"&",j=0..ncols(T)-2),string(T[k,ncols(T)-1])+if(k
  mod 10 ==0){"\\\\\\hline"}else{" \\\\ "}]};
Tbis[0]:=subsop(Tbis[0],0="t &");
Tbis[pp]:=subsop(Tbis[pp],0="\\rowcolor[gray]{0.7}"+Tbis[pp,0]);
TT:="
%\\setindent{\\indentationcours}
%Voici le tableau donnant $\\Phi(t)=\\mathbb{P}(X<t)$ dans le cas $t\\in[0;2.99]$~:
{\\small
\\setindent{0mm}
\\begin{center}";
TT:=TT+"\\begin{tabular}{|"+Ti+"}\\hline ";
for(k:=0;k<=nrows(Tbis)-1;k++){for(j:=0;j<=ncols(Tbis)-1;j++){TT:=TT+Tbis[k,j]}};
XCAStablenormx:=TT+"\\end{tabular}"+"
\\end{center}
\\setindent{\\indentationcours}
}
\\bigskip
\\setindent{\\indentationcours}
On   veut   calculer    $\\mathbb{P}(X<"+x+")$   sachant   que   $X\\sim
\\mathcal{N}("+m+","+s+")$.
Comme la variable r\\'eduite $T=\\frac{X-"+m+"}{"+s+"}$ suit la loi $\\mathcal{N}(0,1)$ alors $X<"+x+"$
\\'equivaut \\`a $T<"+latex((x-m)/s)+"$.

"+
if(tt<0){"
\\setindent{\\indentationcours}
Comme "+tt+" est n\\'egatif, on utilise le fait que $\\Phi(-t)=1-\\Phi(t)$
On lit dans la table de la loi normale
$\\mathbb{P}(T<"+latex((x-m)/s)+")\\approx
1-\\mathbb{P}(T<"+round((tp)*100)*0.01+")\\approx
"+simplify(1-normal_cdf(round((tp)*100)*0.01)) +"$"}
else{
"
\\setindent{\\indentationcours}

On lit dans la table de la loi normale
$\\mathbb{P}(T<"+latex((x-m)/s)+")\\approx
\\mathbb{P}(T<"+round((tp)*100)*0.01+")\\approx
 "+simplify(normal_cdf(round((tp)*100)*0.01)) +"$"};

//return(XCAStablenormx);

sortix:=fopen("XCAStablenormex.tex");
fprint(sortix,Unquoted,XCAStablenormx);
fclose(sortix);
}:;
\end{VerbatimOut}



\begin{VerbatimOut}{XCAStablenorm.giac}
maple_mode(0);
read("XCAStablenorm.cxx");
Sortie:=fopen("XCAStablenormex.tex");
donnees:=read("XCAStablenorm.user");
fprint(Sortie,Unquoted,donnees);
fclose(Sortie);
\end{VerbatimOut}



\newenvironment{XCAStablenorm}
{\VerbatimEnvironment\begin{VerbatimOut}{XCAStablenorm.user}}
{\end{VerbatimOut}
%% si WINDOWS :
\ifwindows
\immediate\write18{giac XCAStablenorm.giac}
\else
%% si GNU_LINUX ou MAC :
\immediate\write18{giac < XCAStablenorm.giac}
\fi
\input{XCAStablenormex}
}










\begin{document}


\thispagestyle{empty}
\maketitle
\date{Dernière mise à jour: \today}
\tableofcontents
%\setcounter{chapter}{-1}
%\setcounter{page}{131}
%\include{turing_info1}
\scilab
\include{intro_probas}
\include{scilab}
\include{denomb_info}
\scilab
\include{probas_discretes}
\include{markov_info1}
\include{loi_normale_info1}
\include{simul_loi}
%annexes
%\appendix
%\setcounter{chapter}{-1}
%\renewcommand{\chaptername}{Annexe}
%\include{caml_guide}

%%% biblio et fin 

%\nocite{*}
%\bibliography{PolyInfo1}


\end{document}

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