2019-2020/TES/Probabilte_statistiques/Loi_densite/1P_tableur.tex

129 lines
4.1 KiB
TeX

\documentclass[10pt,xcolor=table]{classPres}
%\usepackage{myXsim}
\usepackage{pgfplots}
\pgfplotsset{compat=1.7}
\pgfmathdeclarefunction{gauss}{2}{%
\pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}%
}
\title{}
\author{}
\date{Févier 2020}
\begin{document}
\begin{frame}{Représentation de la loi binomiale}
\begin{enumerate}
\item Rédiger une situation modélisable avec une loi binomiale.
\item Construire avec le tableur le tableau des valeurs de cette loi.
\begin{center}
\texttt{LOI.BINOMIALE(k; n; p; 0)}
\end{center}
\item Représenter avec un diagramme barre ces probabilités
\item Reporter dessus l'espérance et l'écart-type.
\end{enumerate}
\end{frame}
\begin{frame}[fragile]{Loi binomiale vers la loi normale}
Dans ces 2 représentations $n = 40$.
\begin{tikzpicture}[
declare function={binom(\k,\n,\p)=\n!/(\k!*(\n-\k)!)*\p^\k*(1-\p)^(\n-\k);},
]
\begin{axis}[
xscale=0.65,
samples at={0,...,40},
yticklabel style={
/pgf/number format/fixed,
/pgf/number format/fixed zerofill,
/pgf/number format/precision=1
},
ybar=0pt, bar width=1
]
%\addplot [fill=cyan, fill opacity=0.5] {binom(x,40,0.2)}; \addlegendentry{$p=0.2$}
\node[draw=black,fill=white,anchor=north west] at (rel axis cs:0,1) {$p=0.5$};
\addplot [fill=orange, fill opacity=0.5] {binom(x,40,0.5)};
\end{axis}
\end{tikzpicture}
\hfill
\begin{tikzpicture}[
declare function={binom(\k,\n,\p)=\n!/(\k!*(\n-\k)!)*\p^\k*(1-\p)^(\n-\k);},
]
\begin{axis}[
xscale=0.65,
samples at={0,...,40},
yticklabel style={
/pgf/number format/fixed,
/pgf/number format/fixed zerofill,
/pgf/number format/precision=1
},
ybar=0pt, bar width=1
]
\node[draw=black,fill=white,anchor=north west] at (rel axis cs:0,1) {$p=0.2$};
\addplot [fill=cyan, fill opacity=0.5] {binom(x,40,0.2)};
%\addplot [fill=orange, fill opacity=0.5] {binom(x,40,0.5)}; \addlegendentry{$p=0.5$}
\end{axis}
\end{tikzpicture}
\end{frame}
\begin{frame}[fragile]{Calculer probabilité}
Que représente $P(X > 10)$?
\hfill
Comment interpréter $P(Y>10)$?
\[
X \sim \mathcal{B}(40;0.5) \qquad Y \sim \mathcal{N}(20; 10)
\]
\begin{tikzpicture}[
declare function={binom(\k,\n,\p)=\n!/(\k!*(\n-\k)!)*\p^\k*(1-\p)^(\n-\k);},
]
\begin{axis}[
xscale=0.6,
yscale=0.9,
samples at={0,...,40},
yticklabel style={
/pgf/number format/fixed,
/pgf/number format/fixed zerofill,
/pgf/number format/precision=2
},
enlargelimits=false, clip=false, axis on top,
ybar=0pt, bar width=1
]
%\addplot [fill=cyan, fill opacity=0.5] {binom(x,40,0.2)}; \addlegendentry{$p=0.2$}
\addplot [fill=orange, fill opacity=0.5] {binom(x,40,0.5)};
\end{axis}
\end{tikzpicture}
\hfill
\begin{tikzpicture}
\begin{axis}[
xscale=0.6,
yscale=0.9,
no markers, domain=0:40, samples=100,
yticklabel style={
/pgf/number format/fixed,
/pgf/number format/fixed zerofill,
/pgf/number format/precision=2
},
%axis lines*=left, xlabel=$x$, ylabel=$y$,
%every axis y label/.style={at=(current axis.above origin),anchor=south},
%every axis x label/.style={at=(current axis.right of origin),anchor=west},
%height=5cm, width=12cm,
enlargelimits=false,
clip=false, axis on top,
%grid = major
]
\addplot [very thick,cyan!50!black] {gauss(20,3)};
\end{axis}
\end{tikzpicture}
\end{frame}
\end{document}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "master"
%%% End: