#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass amsart
\begin_preamble

\usepackage{a4wide}
\usepackage{bbm}
\newcommand{\1}{\mathbbm{1}}
\newcommand{\E}{\mathbb{E}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\var}{\mathbb{V}}
\newcommand{\p}{\mathbb{P}}
\newcommand{\N}{\mathbb{N}}

\newcommand{\convps}{\overset{\text{p.s.}}{\underset{n\rightarrow +\infty}{\longrightarrow}}}



    \newcommand\independent{\protect\mathpalette{\protect\independenT}{\perp}}
    \def\independenT#1#2{\mathrel{\rlap{$#1#2$}\mkern2mu{#1#2}}}
\end_preamble
\use_default_options false
\begin_modules
theorems-ams
eqs-within-sections
figs-within-sections
\end_modules
\maintain_unincluded_children false
\language french
\language_package none
\inputencoding auto
\fontencoding T1
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize 11
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
\use_package amsmath 2
\use_package amssymb 2
\use_package cancel 1
\use_package esint 1
\use_package mathdots 0
\use_package mathtools 1
\use_package mhchem 0
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 0
\use_minted 0
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style swiss
\dynamic_quotes 0
\papercolumns 1
\papersides 2
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Standard
\align left
Université Nice Sophia Antipolis - M1 IM - Méthodes de simulation stochastique
 (Monte Carlo)
\begin_inset Newline newline
\end_inset

 
\family typewriter

\begin_inset Flex URL
status open

\begin_layout Plain Layout

http://math.unice.fr/rubentha/cours.html
\end_layout

\end_inset


\family default

\begin_inset Newline newline
\end_inset


\begin_inset VSpace medskip
\end_inset


\end_layout

\begin_layout Title
Corrigés pour le chapitre 1
\end_layout

\begin_layout Exercise
Nous écrivons par exemple
\begin_inset Formula 
\begin{eqnarray*}
I_{1} & = & \int_{0}^{1}\cos(x^{3})e^{-x}dx\\
 & = & \int_{\R}\cos(x^{3})e^{-x}\times\1_{[0;1]}(x)dx\,.
\end{eqnarray*}

\end_inset

Donc 
\begin_inset Formula $I_{1}=\E(\cos(U^{3})e^{-U})$
\end_inset

 avec 
\begin_inset Formula $U\sim\mathcal{U}([0;1])$
\end_inset

.
 Donc, si 
\begin_inset Formula $U_{1},U_{2},\dots$
\end_inset

 sont i.i.d.
 
\begin_inset Formula $\sim\mathcal{U}([0;1])$
\end_inset

, alors
\begin_inset Formula 
\[
\frac{\cos(U_{1}^{3})e^{-U_{1}}+\dots+\cos(U_{n}^{3})e^{-U_{n}}}{n}\convps I_{1}\,.
\]

\end_inset

Voir l'algorithme 
\begin_inset CommandInset ref
LatexCommand ref
reference "alg:Calcul-de"

\end_inset

 pour une implémentation.
 
\begin_inset Float algorithm
placement h
wide false
sideways false
status open

\begin_layout Plain Layout
\align left

\family typewriter
n=1000
\begin_inset Newline newline
\end_inset

s=0 
\begin_inset Newline newline
\end_inset

for (i in 1:n) 
\begin_inset Newline newline
\end_inset

{ 
\begin_inset Newline newline
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset

u=runif(1,0,1) 
\begin_inset Newline newline
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset

s=s+cos(u^3)*exp(-u) 
\begin_inset Newline newline
\end_inset

} 
\begin_inset Newline newline
\end_inset

cat("valeur approchée : ",s/n)
\family default
 
\begin_inset Caption Standard

\begin_layout Plain Layout
Calcul de 
\begin_inset Formula $I_{1}$
\end_inset


\begin_inset CommandInset label
LatexCommand label
name "alg:Calcul-de"

\end_inset


\end_layout

\end_inset


\end_layout

\end_inset

Nous pouvons aussi écrire
\begin_inset Formula 
\[
I_{1}=\int_{\R}\cos(x^{3})\1_{[0;1]}(x)\times\1_{[0;+\infty[}(x)e^{-x}dx\,.
\]

\end_inset

Donc 
\begin_inset Formula $I_{1}=\E(\cos(X^{3})\1_{[0;1]}(X))$
\end_inset

 avec 
\begin_inset Formula $X\sim\mathcal{E}(1)$
\end_inset

.
 Donc, si 
\begin_inset Formula $X_{1},X_{2},\dots$
\end_inset

 sont i.i.d.
 
\begin_inset Formula $\sim\mathcal{E}(1)$
\end_inset

, alors
\begin_inset Formula 
\[
\frac{\cos(X_{1}^{3})\1_{[0;1]}(X_{1})+\dots+\cos(X_{n}^{3})\1_{[0;1]}(X_{n})}{n}\convps I_{1}\,.
\]

\end_inset


\end_layout

\begin_layout Exercise
De même,
\begin_inset Formula 
\[
I_{2}=\int_{\R}\sqrt{2\pi}\sin(x^{4})e^{-2x}\1_{[0;+\infty[}(x)\times\frac{e^{-x^{2}/2}}{\sqrt{2\pi}}dx=\E(\sqrt{2\pi}\sin(Z^{4})e^{-2Z}\1_{[0;+\infty[}(Z)\,,
\]

\end_inset

avec 
\begin_inset Formula $Z\sim\mathcal{N}(0;1)$
\end_inset

.
 Et
\begin_inset Formula 
\[
I_{2}=\int_{\R}\sin(x^{4})e^{-x^{2}/2}\frac{1}{2}\times2\1_{[0;+\infty[}(x)e^{-2x}dx=\E(\sin(Y^{4})e^{-Y^{2}/2}\frac{1}{2})\,,
\]

\end_inset

avec 
\begin_inset Formula $Y\sim\mathcal{E}(2)$
\end_inset

.
 
\end_layout

\begin_layout Exercise
De même,
\begin_inset Formula 
\[
I_{3}=\int_{\R}\sqrt{\pi}\ln(1+x^{2})\1_{[0;1]}(x)\times\frac{\exp\left(-\frac{x^{2}}{2(1/2)}\right)}{\sqrt{2\pi(1/2)}}=\E(\sqrt{\pi}\ln(1+Z^{2})\1_{[0;1]}(Z))\,,
\]

\end_inset

avec 
\begin_inset Formula $Z\sim\mathcal{N}(0;1/2)$
\end_inset

.
 Et
\begin_inset Formula 
\[
I_{3}=\int_{\R}\ln(1+x^{2})e^{-x^{2}}\times\1_{[0;1]}(x)dx=\E(\ln(1+X^{2})e^{-X^{2}})\,,
\]

\end_inset

avec 
\begin_inset Formula $X\sim\mathcal{U}([0;1])$
\end_inset

.
 
\end_layout

\begin_layout Standard
\begin_inset Separator parbreak
\end_inset


\end_layout

\begin_layout Exercise
\begin_inset ERT
status open

\begin_layout Plain Layout

\end_layout

\end_inset


\begin_inset Separator latexpar
\end_inset


\end_layout

\begin_deeper
\begin_layout Enumerate
Si on tire 
\begin_inset Formula $U_{1}$
\end_inset

, 
\begin_inset Formula $U_{2}$
\end_inset

 indépendantes et uniformes dans 
\begin_inset Formula $[-1;1]$
\end_inset

 alors 
\begin_inset Formula $(U_{1},U_{2})$
\end_inset

 est de loi uniforme dans 
\begin_inset Formula $C$
\end_inset

.
 Si on tire 
\begin_inset Formula $((U_{1}^{(n)},U_{2}^{(n)}))$
\end_inset

 i.i.d., tous de même loi que 
\begin_inset Formula $(U_{1},U_{2})$
\end_inset

, alors, par la loi des grands nombres (les variables 
\begin_inset Formula $\1_{\dots}$
\end_inset

 sont bornées donc les hypothèses sont bien vérifiées)
\begin_inset space ~
\end_inset

:
\begin_inset Formula 
\[
\frac{1}{n}\sum_{k=1}^{n}\1_{(U_{1}^{(k)},U_{2}^{(k)})\in D}\convps\E(\1_{X\in D})\,.
\]

\end_inset

Voici un exemple de code
\begin_inset space ~
\end_inset

: algorithme 
\begin_inset CommandInset ref
LatexCommand ref
reference "alg:2.1"

\end_inset

.
\begin_inset Newline newline
\end_inset


\family typewriter

\begin_inset Float algorithm
placement h
wide false
sideways false
status open

\begin_layout Plain Layout
\align left

\family typewriter
n=1000 
\begin_inset Newline newline
\end_inset

s=0 
\begin_inset Newline newline
\end_inset

for (i in 1:n) 
\begin_inset Newline newline
\end_inset

{ 
\begin_inset Newline newline
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset

u=runif(1,-1,1) 
\begin_inset Newline newline
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset

v=runif(1,-1,1) 
\begin_inset Newline newline
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset

if (u^2+v^2<1) 
\begin_inset Newline newline
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset

{ 
\begin_inset Newline newline
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset

s=s+1 
\begin_inset Newline newline
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset

} 
\begin_inset Newline newline
\end_inset

} 
\begin_inset Newline newline
\end_inset

cat("valeur approchée : ",s/n)
\end_layout

\begin_layout Plain Layout

\family typewriter
\begin_inset Caption Standard

\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "alg:2.1"

\end_inset


\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Enumerate
Par la loi des grands nombres (qui s'applique pour la même raison que ci-dessus)
\begin_inset Formula 
\[
\frac{1}{2n}\sum_{k=1}^{n}(\1_{(U_{1}^{(2k)},U_{2}^{(2k)})\in D}-\1_{(U_{1}^{(2k-1)},U_{2}^{(2k-1)})\in D})^{2}\convps\var(X)\,.
\]

\end_inset

Voici un exemple de code
\begin_inset space ~
\end_inset

: algorithme 
\begin_inset CommandInset ref
LatexCommand ref
reference "alg:2.2"

\end_inset

.
\begin_inset Newline newline
\end_inset


\family typewriter

\begin_inset Float algorithm
placement h
wide false
sideways false
status open

\begin_layout Plain Layout
\align left

\family typewriter
indi<-function(u,v) 
\begin_inset Newline newline
\end_inset

{ 
\begin_inset Newline newline
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset

z=0 
\begin_inset Newline newline
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset

if (u^2+v^2<1) 
\begin_inset Newline newline
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset

{ z=1 } 
\begin_inset Newline newline
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset

return(z) 
\begin_inset Newline newline
\end_inset

}
\begin_inset Newline newline
\end_inset

n=1000 
\begin_inset Newline newline
\end_inset

s=0 
\begin_inset Newline newline
\end_inset

for (i in 1:n) 
\begin_inset Newline newline
\end_inset

{ 
\begin_inset Newline newline
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset

u=runif(1,-1,1); v=runif(1,-1,1) 
\begin_inset Newline newline
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset

w=runif(1,-1,1); x=runif(1,-1,1) 
\begin_inset Newline newline
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset

s=s+(indi(u,v)-indi(w,x))^2 
\begin_inset Newline newline
\end_inset

} 
\begin_inset Newline newline
\end_inset

cat("valeur approchée de la variance : ",s/(2*n))
\end_layout

\begin_layout Plain Layout

\family typewriter
\begin_inset Caption Standard

\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "alg:2.2"

\end_inset


\end_layout

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Enumerate
Par le même calcul que dans la section sur la vitesse de convergence (1.2.2)
 (refaire le calcul), on voit qu'il faut choisir 
\begin_inset Formula $n$
\end_inset

 tel que 
\begin_inset Formula 
\[
n\geq\frac{(1,96\sigma)^{2}}{0,01^{2}}
\]

\end_inset

(où 
\begin_inset Formula $\sigma^{2}$
\end_inset

 est la variance).
 On trouve 
\begin_inset Formula 
\[
\frac{(1,96\sigma)^{2}}{0,01^{2}}\approx6608\,.
\]

\end_inset


\end_layout

\end_deeper
\begin_layout Standard
\begin_inset Separator parbreak
\end_inset


\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
setcounter{thm}{3}
\end_layout

\end_inset


\end_layout

\begin_layout Exercise
\begin_inset ERT
status open

\begin_layout Plain Layout

\end_layout

\end_inset


\begin_inset Separator latexpar
\end_inset


\end_layout

\begin_deeper
\begin_layout Enumerate
Si on prend 
\begin_inset Formula $X_{1}$
\end_inset

, 
\begin_inset Formula $X_{2}$
\end_inset

, … i.i.d.
 de loi 
\begin_inset Formula $\mathcal{U}([0;1])$
\end_inset

, alors 
\begin_inset Formula $\E(\sin(\sqrt{X_{1}}))=I$
\end_inset

 (on a bien 
\begin_inset Formula $\E(|\sin(\sqrt{X_{1}})|)<+\infty$
\end_inset

 puisque la variable intégrée est bornée par 
\begin_inset Formula $1$
\end_inset

).
 Donc par la loi des grands nombres
\begin_inset Formula 
\[
I_{n}=\frac{1}{n}\sum_{k=1}^{n}\sin(\sqrt{X_{k}})\convps I\,.
\]

\end_inset


\end_layout

\begin_layout Enumerate
Voici un exemple de code
\begin_inset space ~
\end_inset

: algorithme 
\begin_inset CommandInset ref
LatexCommand ref
reference "alg:4.2"

\end_inset

.
 
\begin_inset Float algorithm
placement h
wide false
sideways false
status open

\begin_layout Plain Layout
\align left

\family typewriter
n=1000 
\begin_inset Newline newline
\end_inset

for (i in 1:n) 
\begin_inset Newline newline
\end_inset

{ 
\begin_inset Newline newline
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset

u=runif(1,0,1) 
\begin_inset Newline newline
\end_inset


\begin_inset space ~
\end_inset


\begin_inset space ~
\end_inset

s=s+sin(sqrt(u)) 
\begin_inset Newline newline
\end_inset

} 
\begin_inset Newline newline
\end_inset

cat("valeur approchée de la variance : ",s/n)
\end_layout

\begin_layout Plain Layout
\begin_inset Caption Standard

\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "alg:4.2"

\end_inset


\end_layout

\end_inset


\end_layout

\begin_layout Plain Layout

\end_layout

\end_inset


\end_layout

\begin_layout Enumerate
On veut 
\begin_inset Formula 
\[
\p\left(|I_{n}-I|\geq0,01\right)\leq0,01\,.
\]

\end_inset

Calculons
\begin_inset Formula 
\begin{eqnarray*}
\p(|I_{n}-I|\geq0,01) & = & \p(\sqrt{n}|I_{n}-I|\geq\sqrt{n}\times0,01)\\
\mbox{(TCL)} & \approx & \p(\sigma|Z|\geq\sqrt{n}\times0,01)\,,
\end{eqnarray*}

\end_inset

avec 
\begin_inset Formula $Z\sim\mathcal{N}(0;1)$
\end_inset

.
 On veut donc
\begin_inset Formula 
\[
\p\left(Z\leq\frac{\sqrt{n}0,01}{\sigma}\right)\leq1-\frac{0,01}{2}=0,995\,.
\]

\end_inset

On voit sur la table qu'il faut choisir 
\begin_inset Formula $n$
\end_inset

 tel que
\begin_inset Formula 
\[
\sqrt{n}\times\frac{0,01}{\sigma}\geq2,58\,,
\]

\end_inset

c'est à dire 
\begin_inset Formula 
\[
n\geq\left(\frac{2,58\sigma}{0,01}\right)^{2}\,.
\]

\end_inset


\end_layout

\end_deeper
\begin_layout Standard
\begin_inset Separator parbreak
\end_inset


\end_layout

\begin_layout Exercise
Il y a intersection si 
\begin_inset Formula $X\leq\sin(\Theta)$
\end_inset

.
 Donc la probabilité qui nous intéresse vaut 
\begin_inset Formula 
\begin{eqnarray*}
\int_{0}^{\pi/2}\int_{0}^{\sin(t)}1dx\frac{dt}{(\pi/2)} & = & \int_{0}^{\pi/2}\frac{2}{\pi}\sin(t)dt\\
 & = & \frac{2}{\pi}\left[-\cos(t)\right]_{0}^{\pi/2}=\frac{2}{\pi}\,.
\end{eqnarray*}

\end_inset

 
\end_layout

\begin_layout Standard
\begin_inset Separator plain
\end_inset


\end_layout

\begin_layout Exercise
Si 
\begin_inset Formula $U^{1},U^{2},U^{3}$
\end_inset

 sont des variables indépendantes de loi 
\begin_inset Formula $\mathcal{U}([0;1])$
\end_inset

, alors la densité de 
\begin_inset Formula $(U^{1},U^{2},U^{3})$
\end_inset

 est 
\begin_inset Formula 
\[
(x,y,z)\mapsto\frac{\1_{[0;1]^{3}}((x,y,z))}{1^{3}}
\]

\end_inset

(ne pas oublier de normaliser par le volume du cube).
 Par la loi des grands nombres, la limite p.s.
 cherchée est 
\begin_inset Formula 
\[
\E(\1_{(U^{1})^{2}+(U^{2})^{2}+(U^{3})^{2}<1})=\int_{\R^{3}}\1_{x^{2}+y^{2}+z^{2}<1}\times\frac{\1_{[0;1]^{3}}((x,y,z))}{1}dxdydz=\frac{1}{8}\left(\frac{4}{3}\pi1^{3}\right)
\]

\end_inset

(un huitième du volume de la boule de rayon 
\begin_inset Formula $1$
\end_inset

).
 
\end_layout

\begin_layout Exercise
De même, si 
\begin_inset Formula $U^{1},U^{2},U^{3}$
\end_inset

 sont des variables indépendantes de loi 
\begin_inset Formula $\mathcal{U}([0;R])$
\end_inset

 (avec 
\begin_inset Formula $R>0$
\end_inset

), alors la densité de 
\begin_inset Formula $(U^{1},U^{2},U^{3})$
\end_inset

 est 
\begin_inset Formula 
\[
(x,y,z)\mapsto\frac{\1_{[0;R]^{3}}((x,y,z))}{R^{3}}\,.
\]

\end_inset

Si 
\begin_inset Formula $((U_{n,}^{1}U_{n}^{2},U_{n}^{3}))_{n\geq1}$
\end_inset

 sont i.i.d.
 de même loi que 
\begin_inset Formula $(U^{1},U^{2},U^{3})$
\end_inset

 alors, par la loi des grands nombres,
\begin_inset Formula 
\[
\frac{1}{N}\sum_{n=1}^{N}\1_{(U_{n}^{1})^{2}+(U_{n}^{2})^{2}+(U_{n}^{3})^{2}<R^{2}}\rightarrow\E(\1_{(U^{1})^{2}+(U^{2})^{2}+(U^{3})^{2}<R^{2}})
\]

\end_inset

quand 
\begin_inset Formula $N\rightarrow+\infty$
\end_inset

.
 Et 
\begin_inset Formula 
\[
\E(\1_{(U^{1})^{2}+(U^{2})^{2}+(U^{3})^{2}<R^{2}})=\int_{\R^{3}}\1_{x^{2}+y^{2}+z^{2}<R^{2}}\times\frac{\1_{[0;R]^{3}}((x,y,z))}{R^{3}}dxdydz=\frac{1}{8}\left(\frac{4}{3}\pi R^{3}\right)\frac{1}{R^{3}}=\frac{\pi}{6}\,.
\]

\end_inset

 On remarque que le résultat ne dépend pas de 
\begin_inset Formula $R$
\end_inset

.
 
\end_layout

\begin_layout Standard
\begin_inset Separator parbreak
\end_inset


\end_layout

\begin_layout Standard
\begin_inset ERT
status open

\begin_layout Plain Layout


\backslash
setcounter{thm}{7}
\end_layout

\end_inset


\end_layout

\begin_layout Exercise
\begin_inset space ~
\end_inset


\end_layout

\begin_layout Enumerate
Soient 
\begin_inset Formula $\epsilon_{1}(x)$
\end_inset

, …, 
\begin_inset Formula $\epsilon_{n}(x)$
\end_inset

 des variables i.i.d.
 de loi 
\begin_inset Formula $\mathcal{B}(x)$
\end_inset

.
 Nous avons alors
\begin_inset space ~
\end_inset

: 
\begin_inset Formula $S_{n}(x)\sim\mathcal{B}(n,x)$
\end_inset

.
 Donc 
\begin_inset Formula 
\begin{eqnarray*}
\E\left(f\left(\frac{S_{n}(x)}{n}\right)\right) & = & \sum_{k=0}^{n}C_{n}^{k}x^{k}(1-x)^{n-k}f\left(\frac{k}{n}\right)\,.
\end{eqnarray*}

\end_inset


\end_layout

\begin_layout Enumerate
\begin_inset Note Comment
status collapsed

\begin_layout Plain Layout
\begin_inset Formula 
\begin{eqnarray*}
\E\left(\frac{S_{n}(x)}{n}\right) & = & \sum_{k=0}^{n}C_{n}^{k}x^{k}(1-x)^{n-k}\frac{k}{n}\\
 & = & \sum_{k=1}^{n}C_{n}^{k}x^{k}(1-x)^{n-k}\frac{k}{n}\\
 & = & \sum_{k=1}^{n}C_{n-1}^{k-1}xx^{k-1}(1-x)^{(n-1)-(k-1)}\\
 & = & x\sum_{q=0}^{n-1}C_{n-1}^{q}x^{q}(1-x)^{n-1-q}\\
 & = & x
\end{eqnarray*}

\end_inset


\begin_inset Formula 
\begin{eqnarray*}
\E\left(\left(\frac{S_{n}(x)}{n}\right)^{2}\right) & = & \sum_{k=0}^{n}C_{n}^{k}x^{k}(1-x)^{n-k}\left(\frac{k}{n}\right)^{2}\\
 & = & \sum_{k=1}^{n}C_{n}^{k}x^{k}(1-x)^{n-k}\frac{k(k-1)+k}{n^{2}}\\
 & = & \sum_{k=2}^{n}\left[C_{n}^{k}x^{k}(1-x)^{n-k}\frac{k(k-1)}{n(n-1)}\frac{(n-1)}{n}\right]+\sum_{k=1}^{n}\left[C_{n}^{k}x^{k}(1-x)^{n-k}\frac{k}{n^{2}}\right]\\
 & = & x^{2}\frac{(n-1)}{n}\sum_{k=2}^{n}\left[C_{n-2}^{k-2}x^{k-2}(1-x)^{(n-2)-(k-2)}\right]+\frac{x}{n}\sum_{k=1}^{n}\left[C_{n-1}^{k-1}x^{k-1}(1-x)^{n-1-(k-1)}\right]\\
 & = & x^{2}\frac{(n-1)}{n}+\frac{x}{n}
\end{eqnarray*}

\end_inset


\end_layout

\end_inset

Nous avons (puisque les 
\begin_inset Formula $\epsilon_{k}(x)$
\end_inset

 sont indépendants)
\begin_inset space ~
\end_inset

:
\begin_inset Formula 
\[
\E(S_{n}(x))=\sum_{k=1}^{n}\E(\epsilon_{k}(x))=nx\,,
\]

\end_inset


\begin_inset Formula 
\[
\var(S_{n}(x))=\sum_{k=1}^{n}\var(\epsilon_{k}(x))=nx(1-x)\,.
\]

\end_inset

Et donc 
\begin_inset Formula 
\[
\var\left(\frac{S_{n}(x)}{n}\right)=\frac{nx(1-x)}{n^{2}}-\left(\frac{nx}{x}\right)^{2}=\frac{x(1-x)}{n}\,.
\]

\end_inset

Nous en déduisons, pour tout 
\begin_inset Formula $\epsilon>0$
\end_inset

, 
\begin_inset Formula 
\begin{eqnarray*}
\p\left(\left|\frac{S_{n}(x)}{n}-x\right|\geq\epsilon\right) & \leq & \frac{\var\left(\frac{S_{n}(x)}{x}\right)}{\epsilon^{2}}\\
 & = & \frac{x(x-1)}{n\epsilon^{2}}\,.
\end{eqnarray*}

\end_inset

La fonction 
\begin_inset Formula $x\in[0;1]\mapsto x(x-1)$
\end_inset

 est un polynôme de degré 
\begin_inset Formula $2$
\end_inset

 dont le graphe est concave (parce que le coefficient de 
\begin_inset Formula $x^{2}$
\end_inset

 est négatif).
 Donc elle atteint son maximum là où sa dérivée s'annule.
 La dérivée est 
\begin_inset Formula $x\mapsto2x-1$
\end_inset

 et s'annule en 
\begin_inset Formula $1/2$
\end_inset

.
 Le maximum est donc 
\begin_inset Formula $(1/2)^{2}=1/4$
\end_inset

.
 Donc 
\begin_inset Formula 
\[
\p\left(\left|\frac{S_{n}(x)}{n}-x\right|\geq\epsilon\right)\leq\frac{1}{4n\epsilon^{2}}\,.
\]

\end_inset


\end_layout

\begin_layout Enumerate
Puisque la fonction 
\begin_inset Formula $f$
\end_inset

 est continue sur 
\begin_inset Formula $[0;1]$
\end_inset

, 
\begin_inset Formula $\Vert f\Vert_{\infty}=\sup_{x\in[0;1]}|f(x)|<+\infty$
\end_inset

.
 Pour tout 
\begin_inset Formula $\epsilon>0$
\end_inset

, 
\begin_inset Formula $x\in[0;1]$
\end_inset

, 
\begin_inset Formula 
\begin{eqnarray*}
\left|\mathcal{P}_{n}(x)-f(x)\right| & = & \left|\E\left(f\left(\frac{S_{n}(x)}{n}\right)\right)-f\left(x\right)\right|\\
 & = & \left|\E\left(f\left(\frac{S_{n}(x)}{n}\right)-f\left(x\right)\right)\right|\\
 & \leq & \E\left(\left|f\left(\frac{S_{n}(x)}{n}\right)-f\left(x\right)\right|\right)\\
 & = & \E\left(\left|f\left(\frac{S_{n}(x)}{n}\right)-f\left(x\right)\right|\1_{\left|\frac{S_{n}(x)}{n}-x\right|\geq\epsilon}+\left|f\left(\frac{S_{n}(x)}{n}\right)-f\left(x\right)\right|\1_{\left|\frac{S_{n}(x)}{n}-x\right|<\epsilon}\right)\\
 & \leq & \E\left(2\Vert f\Vert_{\infty}\1_{\left|\frac{S_{n}(x)}{n}-x\right|\geq\epsilon}+\sup_{y,z\in[0;1],|y-z|<\epsilon}|y-z|\times\1_{\left|\frac{S_{n}(x)}{n}-x\right|<\epsilon}\right)\\
 & = & 2\Vert f\Vert_{\infty}\p\left(\left|\frac{S_{n}(x)}{n}-x\right|\geq\epsilon\right)+\sup_{y,z\in[0;1],|y-z|<\epsilon}|y-z|\times\p\left(\left|\frac{S_{n}(x)}{n}-x\right|<\epsilon\right)\\
 & \leq & 2\Vert f\Vert_{\infty}\times\frac{1}{4n\epsilon^{2}}+\sup_{y,z\in[0;1],|y-z|<\epsilon}|y-z|\,.
\end{eqnarray*}

\end_inset

Soit 
\begin_inset Formula $\delta>0$
\end_inset

.
 Puisque 
\begin_inset Formula $f$
\end_inset

 est continue sur 
\begin_inset Formula $[0;1]$
\end_inset

 qui est compact alors elle est uniformément continue (cf.
 cours d'analyse de licence) donc il existe 
\begin_inset Formula $\epsilon>0$
\end_inset

 tel que 
\begin_inset Formula $\sup_{y,z\in[0;1],|y-z|<\epsilon}|y-z|<\delta/2$
\end_inset

.
 Il existe 
\begin_inset Formula $N\geq1$
\end_inset

 tel que 
\begin_inset Formula $n\geq N\Rightarrow2\Vert f\Vert_{\infty}\times\frac{1}{4n\epsilon^{2}}<\delta/2$
\end_inset

.
 Donc, pour cet 
\begin_inset Formula $\epsilon$
\end_inset

 et 
\begin_inset Formula $n\geq N$
\end_inset

, nous avons, pour tout 
\begin_inset Formula $x\in[0;1]$
\end_inset


\begin_inset Formula 
\[
\left|\mathcal{P}_{n}(x)-f(x)\right|\leq\frac{\delta}{2}+\frac{\delta}{2}=\delta\,.
\]

\end_inset

Donc
\begin_inset Formula 
\[
\lim_{n\rightarrow+\infty}\sup_{x\in[0;1]}\left|\mathcal{P}_{n}(x)-f(x)\right|=2\,.
\]

\end_inset


\end_layout

\begin_layout Standard
\begin_inset Separator parbreak
\end_inset


\end_layout

\begin_layout Exercise
\begin_inset space ~
\end_inset


\end_layout

\begin_layout Enumerate
On passe en coordonnées polaires : 
\begin_inset Formula $x=r\cos(\theta)$
\end_inset

, 
\begin_inset Formula $y=r\sin(\theta)$
\end_inset

 avec 
\begin_inset Formula $r\geq0$
\end_inset

, 
\begin_inset Formula $\theta\in[0;2\pi[$
\end_inset

.
 Si 
\begin_inset Formula $(x,y)$
\end_inset

 est dans l'intérieur de la cardioïde, alors 
\begin_inset Formula $(r^{2}-r\cos(\theta))^{2}<r^{2}$
\end_inset

, donc 
\begin_inset Formula $r^{2}<r(1+\cos(\theta))<2r$
\end_inset

, donc 
\begin_inset Formula $r<2$
\end_inset

.
 Donc cet intérieur (que nous noterons 
\begin_inset Formula $C$
\end_inset

) est inclus dans 
\begin_inset Formula $[-2;2]\times[-2;2]$
\end_inset

.
 Soient 
\begin_inset Formula $(X_{1},Y_{1})$
\end_inset

, 
\begin_inset Formula $(X_{2},Y_{2})$
\end_inset

 \SpecialChar ldots
 des variables i.i.d.
 telles que 
\begin_inset Formula $X_{1}\independent Y_{1}$
\end_inset

 et 
\begin_inset Formula $X_{1},Y_{1}\sim\mathcal{U}([-2;2])$
\end_inset

.
 La densité de 
\begin_inset Formula $(X_{1},Y_{1})$
\end_inset

 est 
\begin_inset Formula 
\[
(x,y)\in\R^{2}\mapsto\frac{\1_{[-2;2]^{2}}((x,y))}{4^{2}}\,.
\]

\end_inset

Par la loi des grands nombres 
\begin_inset Formula 
\begin{eqnarray*}
\frac{1}{n}\sum_{i=1}^{n}\1_{C}((X_{i},Y_{i})) & \convps & \int_{\R^{2}}\1_{C}((x,y))\times\frac{\1_{[-2;2]^{2}}((x,y))}{16}dxdy\\
\mbox{(comme }C\subset[-2;2]^{2}\mbox{)} & = & \int_{\R^{2}}\1_{C}((x,y))\times\frac{1}{16}dxdy\\
 & = & \frac{\mathcal{A}(C)}{16}\,,
\end{eqnarray*}

\end_inset

où 
\begin_inset Formula $\mathcal{A}(C)$
\end_inset

 est l'aire de 
\begin_inset Formula $C$
\end_inset

.
\end_layout

\begin_layout Enumerate
On fait tourner la figure autour de l'axe de 
\begin_inset Formula $x$
\end_inset

 et on obtient un solide de révolution (noté 
\begin_inset Formula $S$
\end_inset

, qui ressemble à une pomme).
 Pour 
\begin_inset Formula $(x,y,z)\in\R^{3}$
\end_inset

, notons 
\begin_inset Formula $d=\sqrt{y^{2}+z^{2}}$
\end_inset

.
 Nous avons, par un petite raisonnement géométrique, 
\begin_inset Formula 
\[
S=\{(x,y,z)\in\R^{3}\,:\,(x^{2}+d^{2}-x)^{2}<(x^{2}+d^{2})\}\,.
\]

\end_inset

L'ensemble 
\begin_inset Formula $S$
\end_inset

 est inclus dans 
\begin_inset Formula $[-2;2]^{3}$
\end_inset

 .
 Prenons 
\begin_inset Formula $(X_{i},Y_{i},Z_{i})$
\end_inset

 des variables i.i.d.
 avec 
\begin_inset Formula $X_{1,}Y_{1,}Z_{1}$
\end_inset

 indépendants et de loi 
\begin_inset Formula $\mathcal{U}([-2;2]^{3})$
\end_inset

.
 La densité de 
\begin_inset Formula $(X_{1},Y_{1},Z_{1})$
\end_inset

 est 
\begin_inset Formula 
\[
(x,y,z)\in\R^{3}\mapsto\frac{\1_{[-2;2]^{3}}((x,y,z))}{4^{3}}\,.
\]

\end_inset

Par la loi des grands nombres 
\begin_inset Formula 
\begin{eqnarray*}
\frac{1}{n}\sum_{i=1}^{n}\1_{S}((X_{i},Y_{i},Z_{i})) & \convps & \int_{\R^{3}}\1_{S}((x,y,z))\times\frac{\1_{[-2;2]^{3}}((x,y,z))}{64}dxdydz\\
\mbox{(comme }S\subset[-2;2]^{3}\mbox{)} & = & \int_{\R^{2}}\1_{s}((x,y,z))\times\frac{1}{64}dxdydz\\
 & = & \frac{\mathcal{V}(S)}{64}\,,
\end{eqnarray*}

\end_inset

où 
\begin_inset Formula $\mathcal{V}(S)$
\end_inset

 est le volume de 
\begin_inset Formula $S$
\end_inset

.
 
\end_layout

\end_body
\end_document
