Bayes' theorem is a theorem describing rules for how to determine the probability of a cause given it's effect. For example using Bayes' theorem, the probability that a patient has a disease given that they tested positive for a that disease can be found using the probability that the test yields a positive result when the disease is present.
Formally Bayes' theorem can be defined as follows
Where the probability of the event
A company has three plants. Plant 1 produces 35% of the car output, plant 2 produces 20% and plant 3 produces the remaining 45% of cars. 1% of the output of plant 1 is defective, 1.8% of the output of plant 2 is defective and 2% of the output of plant 3 is defective. The annual total production of the company is 1,000,000 cars. A car is chosen at random from the annual output and is found defective. What is the probability that it came from plant 2?