Exercice : Fonction de répartition, espérance et variance d'une variable aléatoire continue
On considère les fonctions suivantes :
\(f_{1}(x)=\left\{ \begin{array}{cl}1 & \text{si }x\in[0,1]\\0 & \text{sinon}\end{array}\right.\) et \(f_{2}(x)=\left\{ \begin{array}{cl}0 & \text{si }x<0\\2\mathrm{e}^{-2x} & \text{sinon}\end{array}\right.\)
Question
Vérifier que ces fonctions sont des densités de probabilité.
Solution
\(f_1(x)\ge 0\) pour tout \(x\in \mathbb R\).
\(f_1\) est continue par morceaux sur \(\mathbb R\), donc \(f_1\) est intégrable sur \(\mathbb R\).
\(\displaystyle \int_{\mathbb R} f_1(x) \ \mathrm dx=\int_0^1 1 \ \mathrm dx=1\)
Donc \(f_1\) est une densité de probabilité sur \(\mathbb R\)
\(f_2(x)\ge 0\) pour tout \(x\in \mathbb R\).
\(f_2\) est continue par morceaux sur \(\mathbb R\), donc \(f_2\) est intégrable sur \(\mathbb R\).
\(\displaystyle \int_{\mathbb R} f_2(x) \ \mathrm dx=\int_0^{+\infty} 2 e^{-2 x} \ \mathrm dx\)
Or : \(\displaystyle \int_0^a 2 e^{-2x}\ \mathrm dx=[-e^{-2x}]_0^a=-e^{-2a}+1\) et \(\displaystyle \lim_{a\to +\infty} -e^{-2a}+1=1\).
Donc \(\displaystyle \int_0^{+\infty} 2 e^{-2 x} \ \mathrm dx=1\).
Donc \(f_2\) est une densité de probabilité sur \(\mathbb R\).
On note \(Y_{1}\) et \(Y_{2}\) les variables aléatoires de densité de probabilité respectives \(f_{1}\) et \(f_{2}\).
Question
Déterminer \(F_{Y_{1}}\) et \(F_{Y_{2}}\).
Solution
Soit \(y\in\mathbb R\).
On a :
\(\begin{align*} F_{Y_1}(y) & =P(Y_1\le y)\\ & =\displaystyle \int_{-\infty}^y f_1(x)\ \mathrm d x \\ & =\left\{\begin{matrix} 0 & \text{si } y<0 \\ y & \text{si } y \in [0,1] \\ 1 & \text{si } y>1 \end{matrix}\right.\end{align*}\)
Et :
\(\begin{align*} F_{Y_2}(y) & =P(Y_2\le y)\\ & =\displaystyle \int_{-\infty}^y f_2(x)\ \mathrm d x \\ & =\left\{\begin{matrix} 0 & \text{si } y<0 \\ -e^{-2y}+1 & \text{si } y \ge 0\end{matrix}\right.\end{align*}\)
Question
Déterminer l'espérance de chacune de ces variables aléatoires.
Solution
Par définition :
\(\begin{align*}E(Y_1) & =\displaystyle \int_{\mathbb R} x f_1(x) \ \mathrm dx \\ & = \int _0^1 x \ \mathrm dx \\ & = \left[\frac{x^2}{2}\right]_0^1\\ & =\frac{1}{2}\end{align*}\)
De la même façon :
\(\begin{align*}E(Y_2) & =\displaystyle \int_{\mathbb R} x f_2(x) \ \mathrm dx \\ & = \int _0^{+\infty} 2xe^{-2x} \ \mathrm dx \end{align*}\)
Or, à l'aide d'une intégration par partie, on a :
\(\begin{align*} \displaystyle \int_0^a 2xe^{-2x}\ \mathrm dx & =[-xe^{-2x}]_0^a+\int_0^a e^{-2x}\ \mathrm dx \\ & = -a e^{-2a}+\left[\frac{e^{-2x}}{-2}\right]_0^a \\ & =-a e^{-2a}-\frac{e^{-2a}}{2}+\frac{1}{2}\end{align*}\)
Et \(\displaystyle \lim_{a\to +\infty} \left(-a e^{-2a}-\frac{e^{-2a}}{2}+\frac{1}{2}\right)=\frac{1}{2}\).
Donc \(E(Y_2)=\frac{1}{2}\).
Question
Déterminer les variances des variables aléatoires continues \(Y_1 \)et \(Y_2\).
Solution
Il faut d'abord calculer \(E(Y_1^2)\) et \(E(Y_2^2).\)
On a :
\(\begin{align*} E(Y_1^2) & = \displaystyle \int_{\mathbb R} x^2 f_1(x) \ \mathrm d x \\ & = \int_0^1 x^2 \ \mathrm d x \\ & = \left[\frac{x^3}{3}\right]_0^1 \\ & = \frac{1}{3}\end{align*}\)
Et :
\(\begin{align*} E(Y_2^2) & = \displaystyle \int_{\mathbb R} x^2 f_2(x) \ \mathrm d x \\ & = \int_0^{+\infty} x^2 \times 2e^{-2x} \ \mathrm d x \end{align*}\)
On fait une IPP en posant : \(u(x)=x^2\) et \(v'(x)=2e^{-2x}\). Alors \(u'(x)=2x\) et \(v(x)=-e^{-2x}\).
Donc \(\displaystyle \int_0^{+\infty} x^2 \times 2e^{-2x} \ \mathrm d x =\underbrace{\left[-x^2 e^{-2x}\right]_0^{+\infty}}_{=0}-\int_0^{+\infty} -2x e^{-2x} \ \mathrm d x=\int_0^{+\infty}2xe^{-2x} \ \mathrm d x\).
On fait une deuxième IPP, en posant cette fois : \(u(x)=x\) et \(v'(x)=2e^{-2x}\). Alors \(u'(x)=1\) et \(v(x)=-e^{-2x}\).
Donc \(\displaystyle \int_0^{+\infty}2xe^{-2x} \ \mathrm d x=\underbrace{\left[-xe^{-2x}\right]_0^{+\infty}}_{=0}-\int_0^{+\infty}-e^{-2x} \ \mathrm d x=-\left[\frac{e^{-2x}}{2}\right]_0^{+\infty}=\frac{1}{2}.\)
D'où \(E(Y_2^2)=\frac{1}{2}.\)
Par conséquent,
\(V(Y_1)=E(Y_1^2)-E(Y_1)^2=\frac{1}{3}-\frac{1}{4}=\frac{1}{12}\)
\(V(Y_2)=E(Y_2^2)-E(Y_2)^2=\frac{1}{2}-\frac{1}{4}=\frac{1}{4}\)