def solve(): print("Entrez les bornes de l'intervalle [a; b] :") a = float_input("a = ") b = float_input("b = ") print("Entrez les bornes de l'intervalle u ≤ X ≤ v :") u = float_input("u = ") v = float_input("v = ") result = Fraction(abs(v - u) * (1 / (b - a))).limit_denominator() print(f"\nLa probabilité P est de {result}")
def solve(): print("X suit la loi normale N(u, o) :") u = float_input("u = ") o = float_input("o = ") norm = normale.normale(u, o) print("La question est P(a ≤ X ≤ b)") a = float_input("a = ") b = float_input("b = ") p = round(norm.p_X_btw(a, b), 4) print(f"\nP({a} ≤ X ≤ {b}) = {p}")
def solve(): p = fraction_input("Entrez le paramètre de la loi exponentielle : ") print("Entrez les bornes de l'intervalle P(u ≤ X ≤ v) :") u = float_input("u = ") v = float_input("v = ") exponent_u = Fraction(-p * u).limit_denominator() exponent_v = Fraction(-p * v).limit_denominator() result = f"e^({exponent_u}) - e^({exponent_v})" print(f"\nLa probabilité P est de {result}")
def solve(): print("X suit la loi normale N(u, o) :") v = float_input("u = ") o = float_input("o = ") norm = normale.normale(v, o) print(f"La question est P({v}-u < X < {v}+u) = a") a = float_input("a = ") u = 0.5005 #recherche bourrin à 10^-3 pres, la dichotomie c'est nul anyway while norm.p_X_btw(v - u, v + u) < a: u += 0.001 #pousser la limite quand la proba est trop petite while norm.p_X_btw(v - u, v + u) > a: u -= 0.001 #idem quand trop grande u = round(u, 2) print(f"\nLa valeur de u est {u}")
def solve(): print("Entrez les bornes de l'intervalle [a; b] :") a = float_input("a = ") b = float_input("b = ") print("La question est :") print("\t1. P(X ≤ y)") print("\t2. P(X ≥ y)") choix = 0 while not choix in [1, 2]: choix = int_input("1 ou 2 ? ") y = float_input("y = ") if choix == 1: result = Fraction(abs(y - a) * (1 / (b - a))).limit_denominator() else: result = Fraction(abs(b - y) * (1 / (b - a))).limit_denominator() print(f"\nLa probabilité P est de {result}")
def solve(): print("X suit la loi normale N(u, o) :") u = float_input("u = ") o = float_input("o = ") norm = normale.normale(u, o) print("La question est :") print("\t1. P(X ≤ a)") print("\t2. P(X ≥ a)") choix = 0 while not choix in [1, 2]: choix = int_input("1 ou 2 ? ") a = float_input("a = ") if choix == 1: p = round(norm.p_X_inf(a), 4) print(f"\nP(X ≤ {a}) = {p}") else: p = round(norm.p_X_sup(a), 4) print(f"\nP(X ≥ {a}) = {p}")
def solve(): print("La question est p(x ≤ t)") t = int_input("t = ") print(f"La probabilité p(x ≤ {t}) est égale à 1-e^(-{t}a)") print( "\nEntrez la valeur maximale que peut prendre la probabilité p, dans le dernier paragraphe (c'est un nombre décimal)" ) m = float_input("m = ") print( f"L'intervalle est ]0; ln({Fraction(- m + 1).limit_denominator()})/(-{t})]" )