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

116 lines
3.8 KiB
TeX

\documentclass[a4paper,10pt]{article}
\usepackage{myXsim}
\title{Loi à densité - }
\tribe{Terminale ES}
\date{Février 2020}
\pagestyle{empty}
\geometry{left=10mm,right=10mm, top=10mm}
\usepackage{pgfplots}
\pgfplotsset{compat=1.7}
\pgfmathdeclarefunction{gauss}{2}{%
\pgfmathparse{1/(#2*sqrt(2*pi))*exp(-((x-#1)^2)/(2*#2^2))}%
}
\newcommand{\graphs}{%
\begin{tabular}{cc}
X \sim \mathcal{B}(40;0.5) & 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}[
yscale=0.5,
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 [] {binom(x,40,0.5)};
\end{axis}
\end{tikzpicture}
&
\begin{tikzpicture}
\begin{axis}[
yscale=0.5,
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.16)};
\end{axis}
\end{tikzpicture}
\\
X \sim \mathcal{B}(40;0.4) & Y \sim \mathcal{N}(...; ...) \\
\begin{tikzpicture}[
declare function={binom(\k,\n,\p)=\n!/(\k!*(\n-\k)!)*\p^\k*(1-\p)^(\n-\k);},
]
\begin{axis}[
yscale=0.5,
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 [] {binom(x,40,0.4)};
\end{axis}
\end{tikzpicture}
&
\begin{tikzpicture}
\begin{axis}[
yscale=0.5,
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(16,3)};
\end{axis}
\end{tikzpicture}
\end{tabular}
}
\begin{document}
\graphs
\vfill
\graphs
\vfill
\graphs
\vfill
\end{document}