Home » Machine Learning/Artificial Intelligence

# 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.

TOP Interview Coding Problems/Challenges

- Run-length encoding (find/print frequency of letters in a string)
- Sort an array of 0's, 1's and 2's in linear time complexity
- Checking Anagrams (check whether two string is anagrams or not)
- Relative sorting algorithm
- Finding subarray with given sum
- Find the level in a binary tree with given sum K
- Check whether a Binary Tree is BST (Binary Search Tree) or not
- 1[0]1 Pattern Count
- Capitalize first and last letter of each word in a line
- Print vertical sum of a binary tree
- Print Boundary Sum of a Binary Tree
- Reverse a single linked list
- Greedy Strategy to solve major algorithm problems
- Job sequencing problem
- Root to leaf Path Sum
- Exit Point in a Matrix
- Find length of loop in a linked list
- Toppers of Class
- Print All Nodes that don't have Sibling
- Transform to Sum Tree
- Shortest Source to Destination Path

Comments and Discussions

**Ad:**
Are you a blogger? Join our Blogging forum.