\documentclass[10pt,a4paper,svgnames,openany,utf8,fourier,biblio,pstricks]{trmbookinfo2}
\usepackage{etex}
\usepackage{preambuleTrm}
\usepackage{lcd}
\usepackage[off]{auto-pst-pdf}
%\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[autolanguage]{numprint}

\usepackage{cclicenses}
\usepackage{cclicence}

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

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

\hypersetup{
pdftitle={Poly d'Info 1 - Mathématiques - IUT de Nantes}, % title
}
\usepackage[xcas]{pro-mat}

\usepackage{algo}

\renewcommand{\algocommentfont}{\small\ttfamily\itshape}

\newcommand\nor{\downarrow}
\newcommand\nand{\mid}


\setcounter{tocdepth}{2}


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




\title{Probabilités et informatique
}

\author{ Guillaume \textsc{Connan} }

\date{ IUT INFO 1 / 2012-2013 }



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

MAJ: \today
}


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



\newcommand{\Sage}{\textsf{Sage}\xspace}
\newcommand{\Python}{\textsf{Python}\xspace}
\newcommand{\Caml}{\textsf{CAML}\xspace}


\renewcommand{\vect}{\ve}


%%% matrice dans une base

\renewcommand\mat[1][]{\ensuremath{{\rm mat}_{\BR#1}}}

\newcommand\mn[1][3]{ \ensuremath{\mathfrak{M}_{#1}(\bbr)\ }}



\lstset{
 language=sage,
        escapeinside={(*@}{@*)},
        %numbers=left,
        commentstyle={\small\sffamily\color{gray}},
        keywordstyle={\small\ttfamily\color{black!70!blue}\bfseries},
        stringstyle={\small\ttfamily\color{gray}\itshape},
        basicstyle={\small\ttfamily},
        breaklines=true,
        breakatwhitespace=true,
        showtabs=False,
        showspaces=False,
        showstringspaces=False,
        extendedchars=true,
        %aboveskip=1em,
        %belowskip=1em,
        rulecolor=\color{gray},
        %rulesepcolor=\color{gray},
        %frame=trBL,
        frame=single,
        frameround=tttt,
        framerule=0.3pt,
        framesep=4pt,
        belowcaptionskip=2.1pt,
title={{\setlength{\fboxsep}{1pt}\fcolorbox{gray}{gray!10}{\sffamily\scriptsize
      \textcolor{gray!10}{\_}Sage \textcolor{gray!10}{\_}}}}}

\newcommand\caml{
\lstset{
 language=caml,
        escapeinside={(*@}{@*)},
        %numbers=left,
        commentstyle={\small\sffamily\color{gray}},
        keywordstyle={\small\ttfamily\color{black!70!blue}\bfseries},
        stringstyle={\small\ttfamily\color{gray}\itshape},
        basicstyle={\small\ttfamily},
        breaklines=true,
        breakatwhitespace=true,
        showtabs=False,
        showspaces=False,
        showstringspaces=False,
        extendedchars=true,
        emph=[2]{In},
        emphstyle=[2]\color{black!70},
        morecomment=[l][\color{blue}]{Out},
        %aboveskip=1em,
        %belowskip=1em,
        rulecolor=\color{gray},
        %rulesepcolor=\color{gray},
        %frame=trBL,
        frame=single,
        frameround=tttt,
        framerule=0.3pt,
        framesep=4pt,
        belowcaptionskip=2.1pt,
title={{\setlength{\fboxsep}{1pt}\fcolorbox{gray}{gray!10}{\sffamily\scriptsize
      \textcolor{gray!10}{\_}OCaml \textcolor{gray!10}{\_}}}}}
}
\newcommand\scilab{
\lstset{
 language=caml,
        escapeinside={(*@}{@*)},
        %numbers=left,
        commentstyle={\small\sffamily\color{gray}},
        keywordstyle={\small\ttfamily\color{black!70!blue}\bfseries},
        stringstyle={\small\ttfamily\color{gray}\itshape},
        basicstyle={\small\ttfamily},
        breaklines=true,
        breakatwhitespace=true,
        showtabs=False,
        showspaces=False,
        showstringspaces=False,
        extendedchars=true,
        emph=[2]{In},
        emphstyle=[2]\color{black!70},
        morecomment=[l][\color{blue}]{Out},
        %aboveskip=1em,
        %belowskip=1em,
        rulecolor=\color{gray},
        %rulesepcolor=\color{gray},
        %frame=trBL,
        frame=single,
        frameround=tttt,
        framerule=0.3pt,
        framesep=4pt,
        belowcaptionskip=2.1pt,
title={{\setlength{\fboxsep}{1pt}\fcolorbox{gray}{gray!10}{\sffamily\scriptsize
      \textcolor{gray!10}{\_}Scilab \textcolor{gray!10}{\_}}}}}
}


\newcommand\pyth{
\lstset{
 language=sage,
        escapeinside={(*@}{@*)},
        %numbers=left,
        commentstyle={\small\sffamily\color{gray}},
        keywordstyle={\small\ttfamily\color{black!70!blue}\bfseries},
        stringstyle={\small\ttfamily\color{gray}\itshape},
        basicstyle={\small\ttfamily},
        breaklines=true,
        breakatwhitespace=true,
        showtabs=False,
        showspaces=False,
        showstringspaces=False,
        extendedchars=true,
        emph=[2]{In},
        emphstyle=[2]\color{black!70},
        morecomment=[l][\color{blue}]{Out},
        %aboveskip=1em,
        %belowskip=1em,
        rulecolor=\color{gray},
        %rulesepcolor=\color{gray},
        %frame=trBL,
        frame=single,
        frameround=tttt,
        framerule=0.3pt,
        framesep=4pt,
        belowcaptionskip=2.1pt,
title={{\setlength{\fboxsep}{1pt}\fcolorbox{gray}{gray!10}{\sffamily\scriptsize
      \textcolor{gray!10}{\_}Python \textcolor{gray!10}{\_}}}}}
}


\newcommand{\pythonc}{%
\lstset{
 language=sage,
        escapeinside={(*@}{@*)},
        %numbers=left,
        commentstyle={\small\sffamily\color{gray}},
        keywordstyle={\small\ttfamily\color{black!70!blue}\bfseries},
        stringstyle={\small\ttfamily\color{gray}\itshape},
        basicstyle={\small\ttfamily},
        breaklines=true,
        breakatwhitespace=true,
        showtabs=False,
        showspaces=False,
        showstringspaces=False,
        extendedchars=true,
        emph=[2]{In},
        emphstyle=[2]\color{black!70},
        morecomment=[l][\color{blue}]{Out},
        %aboveskip=1em,
        %belowskip=1em,
        rulecolor=\color{gray},
        %rulesepcolor=\color{gray},
        %frame=trBL,
        frame=single,
        frameround=tttt,
        framerule=0.3pt,
        framesep=4pt,
        belowcaptionskip=2.1pt,
title={{\setlength{\fboxsep}{1pt}\fcolorbox{gray}{gray!10}{\sffamily\scriptsize
      \textcolor{gray!10}{\_}Python \textcolor{gray!10}{\_}}}}}
}
\newcommand{\sagec}{%
\lstset{
 language=sage,
        escapeinside={(*@}{@*)},
        %numbers=left,
        commentstyle={\small\sffamily\color{gray}},
        keywordstyle={\small\ttfamily\color{black!70!blue}\bfseries},
        stringstyle={\small\ttfamily\color{gray}\itshape},
        basicstyle={\small\ttfamily},
        breaklines=true,
        breakatwhitespace=true,
        showtabs=False,
        showspaces=False,
        showstringspaces=False,
        extendedchars=true,
        emph=[2]{In},
        emphstyle=[2]\color{black!70},
        morecomment=[l][\color{blue}]{Out},
        %aboveskip=1em,
        %belowskip=1em,
        rulecolor=\color{gray},
        %rulesepcolor=\color{gray},
        %frame=trBL,
        frame=single,
        frameround=tttt,
        framerule=0.3pt,
        framesep=4pt,
        belowcaptionskip=2.1pt,
title={{\setlength{\fboxsep}{1pt}\fcolorbox{gray}{gray!10}{\sffamily\scriptsize
      \textcolor{gray!10}{\_}Sage \textcolor{gray!10}{\_}}}}}
}

\newcommand{\shell}{%
\lstset{
 language=sh,
        escapeinside={(*@}{@*)},
        %numbers=left,
        commentstyle={\small\sffamily\color{gray}},
        keywordstyle={\small\ttfamily\color{black!70!blue}\bfseries},
        stringstyle={\small\ttfamily\color{gray}\itshape},
        basicstyle={\small\ttfamily},
        breaklines=true,
        breakatwhitespace=true,
        showtabs=False,
        showspaces=False,
        showstringspaces=False,
        extendedchars=true,
        emph=[2]{In},
        emphstyle=[2]\color{black!70},
        morecomment=[l][\color{blue}]{Out},
        %aboveskip=1em,
        %belowskip=1em,
        rulecolor=\color{gray},
        %rulesepcolor=\color{gray},
        %frame=trBL,
        frame=single,
        frameround=tttt,
        framerule=0.3pt,
        framesep=4pt,
        belowcaptionskip=2.1pt,
title={{\setlength{\fboxsep}{1pt}\fcolorbox{gray}{gray!10}{\sffamily\scriptsize
      \textcolor{gray!10}{\_}Shell \textcolor{gray!10}{\_}}}}}
}

\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/Biocam/robot/}{/home/moi/Biocam/CoursIni3d/}{/home/moi/Biocam/central/figures/}{/home/moi/Biocam/central/}{/home/moi/IUT/INFO2/Images/}{/home/moi/IUT/INFO2/2011_12/graphes/}}


\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}













\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

%\renewcommand\chaptername{TD \No}
\include{intro_probas}
%\include{generateurs_aleatoires}
\include{denomb_info}
\include{probas_discretes}
\include{markov_info1}
\include{loi_normale_info1}
%\include{simul_loi}

%%% biblio et fin 

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


\end{document}

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