1. Loi uniforme.
1.1. Simulation.
Exercice 1.
Exercice 2.
Pour $N$ grand, on s'approche de plus en plus d'un histogramme plat, qui correspond bien à la distribution d'une loi uniforme. Pour découper l'histogramme en un nombre d'intervalles raisonnable par rapport à la taille de l'échantillon, on peut par exemple fixer le nombre d'intervalles à $N/10$ ou $N/100$.
2. Loi de Bernoulli
2.1. Simulation
Exercice 3.
Question 1 :
$$\mathbb{P} (X = 1) = \mathbb{P} (U \lt p) = \mathbb{P} (0 \lt U \lt p) = \frac{p-0}{1-0} = p$$
et $$\mathbb{P} (X = 0) = \mathbb{P} (U \geq p) = \mathbb{P} (p \geq U \geq 1) = \frac{1-p}{1-0} = 1-p$$
Donc X suit bien une loi de Bernoulli de paramètre $p$.
Question 2 :
Question 3 :
Exercice 4.
2.2. Simulation d'un bruit poivre et sel dans une image
Exercice 5.