# Conditional Probability in Artificial Intelligence

In this article, we are going to study about the conditional probability. We will study what conditional probability is, in what cases it occurs and will also learn about the formula for calculating it? Apart from this, we will also study the cases in which the agent (based on Artificial Intelligence) implements the use of conditional probability in real life.)
Submitted by Monika Sharma, on June 10, 2019

Before learning what conditional probability is? We must first learn about dependent and independent events. Independent events are those events which neither cause any effect nor are affected by the occurrence of some other event. Whereas, dependent events are affected by the happening of some other events which may occur simultaneously or have occurred before it.

For example, picking a card from a complete fresh deck of cards is an independent event because the occurrence of any card is not affected by anything. But, suppose after picking up a card, another card is picked up without replacing the previous one, then this event becomes a dependent event because the occurrence of any card is now affected by the previously drawn card.

The conditional probability is associated with these dependent events. If the probability of any event is affected by the occurrence of other events (s), then it is known as conditional probability.

It is represented by P(A|B) and read as ‘probability of event A when event B has already occurred. It can be calculated as follows:

```        P(A|B) = P(A ^ B) / P(B)
```

Similarly, P(B|A) represents the probability of event B when A has already occurred and this can also be calculated in a similar manner:

```        P(B|A) = P(A ^ B) / P(A)
```

Talking about the intelligent systems (agents), most of the cases that the agent confronts are of conditional probability as the events taking place in the environment are mostly dependent on one another. So, in the probabilistic learning method, the concept of conditional probability is used the most by the system. For example, an agent which tells the weather forecast will determine the weather conditions based upon the other factors such as wind speed, current temperature, and humidity level, etc. So, the future weather conditions are dependent upon these factors and thus it is a dependent event. In this case, also, the agent uses the concept of conditional probability but with other complex concepts and calculations included with it.