Quelle est la probabilité d’obtenir :
un multiple de 21 ou deux multiples de 9 ?
deux paires ?
j'ai vraiment beaucoup beaucoup de mal avec les proba
j'ai besoin d'aide svp


p(21)=(4,1)*(13/120)*(107/120)
#https://www.maths-forum.com/cafe-mathematique/probabilite-t210303.html#p1376903
import numpy as np
N = 100000
out = np.random.randint(1,121,(N,4))
def has_at_least_21(row):
return any(x%21 == 0 for x in row)
def no21_and_at_least_9(row):
return len(list(filter(lambda x:x%9==0 and x%21!=0, row)))>=2
ok = 0
for row in out:
if has_at_least_21(row):
ok+=1
elif no21_and_at_least_9(row):
ok+=1
print('p_exp(atLeast21_or_two9)=', ok / N)
print('p_the(atLeast21_or_two9)=', (np.power(120,4)-np.power(103,4)-48*np.power(103,3)) / np.power(120,4))
Utilisateurs parcourant ce forum : Aucun utilisateur enregistré et 9 invités
Tu pars déja ?
Identification
Pas encore inscrit ?
Ou identifiez-vous :