mirror of
https://github.com/BreizhHardware/TD-R.git
synced 2026-03-19 05:50:36 +01:00
feat(Add bonus to Exercice 51): Ajoute du calcul de l'espérence a l'exercice 51
Ajout du calcul de l'espérence à l'exercice 51
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user