Maybe mathematics is not so friendly for everyone, but without a doubt **They are very helpful in solving ‘problems’**. These issues fulfill the function of encouraging logical and abstract thinking.

One of the areas of great importance in mathematics is statistics, which allow the analysis of data by means of obtaining and organizing them. However, within this **We found various methods **these are used in carrying out the mathematical and statistical study. Below we will tell you everything about one of the best known, Bayes’ Theorem.

## Definition of Bayes’ Theorem

Bayes’ theorem is used in mathematics and statistics, with which it is intended to **calculate the probability of an event**. It is important that, when carrying out this process, you have prior information about the event. For example, in meteorology, models based on Bayes’ theorem can be used to predict weather events based on available weather information.

That is, you can check the probability of an event C, as long as there is a characteristic that circumscribes the probability. we would be talking **then of conditional probability**. Here the event C is conditioned by the fact D. C is dependent on D. This theorem was used by the mathematician Thomas Bayes, hence the name Bayes’ Theorem.

## What is Bayes’ Theorem used for in probability?

Probability is a calculation performed in mathematics that obeys the **establishment of existing possibilities**. These are around a certain event. In this case it is important to highlight the type of conditional probability, which refers to a fact, is subject to the previous one. Which means, that for a certain matter to occur, another event must be in reality in advance.

That is to say, here a new event depends on what has already happened, which leads us to think that in this theorem **study a large amount of information **since it is necessary to analyze all the data surrounding the previous event. For this reason, regarding the uses of Bayes’ theorem, we can highlight the following:

**The finances:**In this case we highlight its use when executing a financial investment. In it, all the contexts must be deepened and a rigorous study of the events that have already occurred must be made.**Advertising:**Also in the advertising of a company it is possible to apply Bayes’ theorem, since it is ideal for analysis.

## What characteristics does Bayes’ Theorem have?

It is part of the theory of probability that we treat the theorem as a proposition, what it expresses is a conditional probability. When speaking of conditional, it refers to the fact that **The event must present some conditions.** In Bayes’ theorem, an event A is dependent on what happened to an event B. Then we would say that A is subject to B.

It is part of mathematics and statistics and has **multiple applications that vary** from financial, to advertising a company to medicine. Especially in genetics, in which it is possible, by means of Bayes’ theorem, to predict the genotype of a person.

## What are the advantages of Bayes’ Theorem?

**Bayes’ theorem has several advantages. **among which we can mention:

- If applied properly,
**the profits of a company**they can increase. Since, its correct implementation gives the possibility of detecting good strategies. Which will give great opportunities for success. **The data can be analyzed**steadily. However, if we talk about many elements, it is necessary to use methods and strategies in your organization.- It is feasible to
**Lots of information**and very diverse.

However, Bayes’ Theorem has received some trials in its application, this is due to the following weaknesses:

- The formula is seen as somewhat limiting, because it consists of that it is criticized. On the other hand, it is considered that its application only
**it is possible to somewhat strenuous events**and if they were not together. Which is also a reason for judgment by detractors. - On the other hand, statisticians doubt the accuracy of Bayes’ theorem. Well, Bayes’ theorem does not work successfully in all statistics. In the only ones in which its use is
**convenient is in repeatable facts**. But in those that do not have this characteristic, the question changes, since their result is not correct.

## What are the elements of Bayes’ Theorem?

Items are conditional **but they may be inaccurate.** For this reason, we speak of a lucky event:

- A is dependent on a random event B.
- A is conditioned to B.

That is what **allows you to predict events.**

## What is the formula for Bayes’ Theorem?

In order to calculate the probability of an event, it is necessary to have the data on the aforementioned event in advance, this is essential in Bayes’ Theorem. If we refer to **the elements of this statistical theorem,** the main thing is the two events to analyze. Since the evidence of the study event is given from another event that conditions the probability.

If we want to do the calculation with this method **it is necessary to follow the Bayes formula: **

- P(A/B) = P(B/A) • P(A) / P(B)
- A and B are the study events.
- P(A/B) refers to the probability of A given B.
- P(B/A) means the probability of B given A.
- P(A) P(B) when the probabilities are independent of each other.

B is the event that we already know in advance, A is the group of potential causes that can produce the fact under study. **P (A/B) endorses the events** possible a posteriori P (A) and P (B/A) indicates the possibilities that matter B is true in each piece of evidence from A.

## Examples of Bayes’ Theorem

A dress manufacturing company concentrates on making three types of women’s outfits based on their shades. The girls’ costumes with figures in their textile design (A),** the light-colored changing rooms (B)** and those of black hue (C). In the total production, 10% of clothing is made of printed fabric, 30% of white tones and 60% of dark tones.

It is known that 3% of A in **your final result has errors**. 2% of the total of B is defective and 5% of C. With this we can state the following:

- P(A)= 0.1 P(D/A)= 0.03
- P(B)= 0.3 P(D/B)= 0.02
- P(C)= 0.6 P(D/C) = 0.05

The first question to evaluate is the following: **if a dress is made by the garment factory** what is the probability that it has an error? For that we calculate something that is known as total probability.

- P(D) =( P(A) x P(D/A)) + (P(B) x P(D/B)) + (P(C) x P(D/C)) = (0, 1 x 0.03) + (0.3 x 0.02) + (0.6 x 0.05) = 0.039

Which means that, in **In terms of percentage, there is a 3.9%** full probability. Now, what follows from this is knowing which clothes will come out with the most defects. For them, the Bayes Theorem is used.

- P(A/D) = (P(A) x P(D/A)) / P(D) = (0.20 x 0.03) / 0.039 = 0.15
- P(B/D) = (P(B) x P(D/B)) / P(D) = (0.30 x 0.02) / 0.039 = 0.15
- P(C/D) = (P(C) x P(D/C)) / P(D) = (0.60 x 0.05) / 0.039 = 0.77

With what we have seen, we already know that of the printed dresses **There is a 15% chance of being defective.** Of the light tones 15% and of the dark ones a 77% probability.

Have** three ovens in a bakery A, B and C.** In which 45%, 30% and 25% of the total production of breads are baked, but the breads that are not suitable for sale vary in percentages. 3%, 4%, and 5% with reference to each oven. We take several loaves at random and we are going to calculate the probability that they are not ready for sale.

- P(A)= 0.45 P(D/A)=0.03
- P(B)= 0.3 P(D/B)= 0.04
- P(C)= 0.25 P(D/C)= 0.05.

First of all, we must do **the calculation of the total probability.** Since we want to know the probability of error in the baked breads.

- P(D) =(P(A) x P(D/A)) + (P(B) x P(D/B)) + (P(C) x P(D/C)) = (0, 45 x 0.03) + (0.3 x 0.04) + (0.25 x 0.05) = 0.038.

The overall probability of **this case is 3%. **Then comes the application of Bayes’ Theorem in full.

- P(A/D) = (P(A) x P(D/A)) / P(D) = (0.45 x 0.03) / 0.038 = 0.35
- P(B/D) = (P(B) x P(D/B)) / P(D) = (0.30 x 0.04) / 0.038 = 0.32
- P(C/D) = (P(C) x P(D/C)) / P(D) = (0.25 x 0.05) / 0.038 = 0.33

At the end of the use of Bayes’ theorem we know the percentages of** breads not ideal for sale. **These in relation to each oven, in A there is a probability of 35%, in B of 32% and in C 33%.

Bayes’ theorem is especially useful for analyzing and predicting some uncertain phenomenon. Since it allows updating the probabilities of an event based on the new information that is received. In economics, Bayes’ theorem is used to analyze** uncertainty and decision making **in situations where limited information is available.