LoslegenKostenlos loslegen

Formula 1 engines

Suppose that two manufacturers, A and B, supply the engines for Formula 1 racing cars, with the following characteristics:

  • 99% of the engines from factory A last more than 5,000 km.
  • Factory B manufactures engines that last more than 5,000 km with 95% probability.
  • 70% of the engines are from manufacturer A, and the rest are produced by manufacturer B.

What is the chance that an engine will last more than 5,000 km?

Diese Übung ist Teil des Kurses

Foundations of Probability in Python

Kurs anzeigen

Anleitung zur Übung

  • Calculate the following probabilities:
    • The manufacturer is A (P_A).
    • The engine lasts more than 5,000 km given that manufacturer is A (P_last5000_g_A).
    • The manufacturer is B (P_B).
    • The engine lasts more than 5,000 km given that manufacturer is B (P_last5000_g_B).
  • Use the total probability law to calculate the probability that the engine will last more than 5,000 km and store the result into P_last_5000.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Needed probabilities
P_A = ____
P_last5000_g_A = ____
P_B = ____
P_last5000_g_B = ____

# Total probability calculation
P_last_5000 = ____

print(P_last_5000)
Code bearbeiten und ausführen