# --------------------------------------------- # EXERCICE 1 : X∼H(N=95, m=15, r=40) # --------------------------------------------- # Paramètres N1 <- 95 # Total d'enfants (40 + 55) r1 <- 40 # Enfants de premier niveau m1 <- 15 # Enfants choisis # Espérance et écart-type esperance1 <- round(m1 * r1 / N1,2) esperance1 var1 <- (N1 - m1)/(N1 - 1) * m1 * (r1/N1) * (1 - r1/N1) ecart_type1 <- round(sqrt(var1),2) ecart_type1 # Espérance +/- écart-type esperance1-ecart_type1 esperance1+ecart_type1 # Probabilité que X = E(X) → valeur arrondie de l'espérance P_X_esp1 <- round(dhyper(round(esperance1), r1, N1 - r1, m1),2) P_X_esp1 # --------------------------------------------- # EXERCICE 2 : X∼H(N=7, m=2, r=3 # --------------------------------------------- # Paramètres N2 <- 7 # Total de personnes r2 <- 3 # Filles m2 <- 2 # Personnes tirées # Espérance et écart-type esperance2 <- round( m2 * r2 / N2,2) esperance2 var2 <- (N2 - m2)/(N2 - 1) * m2 * (r2/N2) * (1 - r2/N2) ecart_type2 <- round(sqrt(var2),2) ecart_type2 # Probabilité que X = E(X) → on calcule plutôt P(X = 1) P_X1_2 <- round(dhyper(1, r2, N2 - r2, m2),2) P_X1_2 # Probabilité d’au moins une fille P_au_moins1f <- round(1 - dhyper(0, r2, N2 - r2, m2),2) P_au_moins1f # --------------------------------------------- # EXERCICE 3 : X∼H(N=100, m=15, r=20) # --------------------------------------------- # Paramètres N3 <- 100 # Total pièces r3 <- 20 # Défectueuses m3 <- 15 # Échantillon # 1Espérance et écart-type esperance3 <- m3 * r3 / N3 esperance3 var3 <- (N3 - m3)/(N3 - 1) * m3 * (r3/N3) * (1 - r3/N3) ecart_type3 <- sqrt(var3) ecart_type3 #P(X=2) P_X2 <- round(dhyper(2, r3, N3 - r3, m3),3) P_X2 #3P(X>4) P_SUP4 <- round(phyper(4, r4, N4 - r4, m4,lower.tail = FALSE),3) P_SUP4 # --------------------------------------------- # EXERCICE 4 : X∼H(N=60, m=12, r=25) # --------------------------------------------- # Paramètres N4 <- 60 # Total échantillons de cellules r4 <- 25 # présentent une mutation m4 <- 12 # échantillon analysés P_au_moins1_7 <- round(phyper(6, r4, N4 - r4, m4,lower.tail = FALSE),3) P_au_moins1_7 # P(X ≥ 7) → Complément de P(X = 0) P_au_moins1_7 <- round(phyper(6, r4, N4 - r4, m4,lower.tail = FALSE),3) P_au_moins1_7 # P(3≤X≤6) ? P_entre_3_6 <- round(phyper(6, r4, N4 - r4, m4)-phyper(2, r4, N4 - r4, m4),3) P_entre_3_6