diff --git a/TD1/Exercice51.R b/TD1/Exercice51.R index 32ef563..5c1635c 100644 --- a/TD1/Exercice51.R +++ b/TD1/Exercice51.R @@ -14,3 +14,10 @@ F <- function(x) { cible <- 1 - 10^(-5) capacite <- uniroot(function(x) F(x) - cible, lower = 0, upper = 1)$root print(capacite * 1000) +# c) (Bonus) Calculer l'espérence +fonction_esperance <- function (x) { + x * c * (1 - x)^4 +} + +esperance <- integrate(fonction_esperance, lower = 0, upper = 1)$value +print(esperance) \ No newline at end of file