NaN.

TutorialMachine LearningLast updated

Conditional Probability[ Edit ]

In the previous article Probability, I defined what is **probability**. In this following lesson, I will introduce important related concepts like **conditional probability **and **independence.**

We will start by introducing this concept of **independence**

Till now, we have assumed that all events are independent,i.e. occurrence of 1 event will not affect the occurrence of the other event. For example, if we flip a coin twice, the probability of heads occurring twice is 1/2 x 1/2 = 1/4. The first head toss couldn't influence the occurrence of the other and so we consider both of them as independent events.

We can say that the coin doesn't have memory about the first toss

**Formally,** we can define two events A and B to be independent if:

P(AB) = P(A)P(B)

There are two types of independence:

**Assumed:**In these kinds of independence, we assume that the events are independent. For example, the coin toss can be assumed as independent as there is no relationship between the different coin tosses.**Derived:**In this second kind of independence, we check if the condition of independence(P(AB) = P(A)P(B)) has been satisfied for the given events A and B.

**Exception:**

Consider 2 disjoint events, A and B.

If we apply the formula of independence, we see that:

**P(AB) = 0**

but

**P(A)P(B) > 0**

which is a contradiction. So, disjoint events don't follow the formula of independence.

As we have defined independence, we will now jump to the next important topic of **Conditional probability.**

Earlier, we have made an assumption that all the events are **independent. **But, there are cases when 2 events can be **dependent **upon each other. For example, consider 2 events, A and B such that A is the event that John goes to school and B is the event that it is raining heavily. John can go to school only if it is not raining. So, event A is dependent upon the occurrence/non-occurrence of event B. In these special cases, the probability takes a different form a.k.a. **conditional probability.**

Formally, we can define the** conditional probability of A given B **as:

P(A|B) = \frac{P(A \bigcap B)}{P(B)}

So, the probability of John going to school given that it is raining is 0,i.e P(A|B) = 0

We can also define **conditional probability of A given B **as the fraction of number of occurrences of A to the number of occurrences of B. Another important rule to remember is that P(A|B) is not **generally equal **to P(B|A).

For example, the probability that you have red eyes given that you have fever is 1 but the inverse, the probability that you have fever given that you have red eyes is not 1.

**Q) **A particular medical test of a disease has positive and negative outcomes. The important probabilities are:

P(positive result & disease ) = .009

P(positive result & absence of disease ) = .099

P(negative result & disease ) = .001

P(negative result & absence of disease ) = .891

What is the probability of getting a positive result given that the patient has the disease and probability of getting a negative result given that the patient doesn't have the disease?

Ans)

P(positive result|disease) = \frac{P(positive result \bigcap diseases)}{P(disease)}

P(positive result|disease) = \frac{0.009}{.009 + 0.001} = 0.9

P(negative result|\neg disease) = \frac{P(positive result \bigcap \neg diseases)}{P(\neg disease)}

P(negative result|\neg disease) = \frac{0.891}{.891 + 0.099} \approx .9

We can extend the definition of independence using conditional probability. For 2 independent events A and B,

conditional probability of A given B is:

P(A|B) = \frac{P(A \bigcap B)}{P(B)} = \frac{P(A)P(B)}{P(B)} = P(A)

- 2 events A and B are independent if and only if P(AB) = P(A)P(B).
- Independence is sometimes assumed and sometimes derived.
- Disjoint events are not independent.
- The conditional probability of A given B, where P(B) can't equal 0 can be defined as:

P(A|B) = \frac{P(A \bigcap B)}{P(B)}

5. Generally,

P(A|B) \neq P(B|A)

6. 2 events A and B are independent if and only if P(A|B) = P(A).

- Udacity
- A Concise Course in Statistical Inference (Springer Texts in Statistics)
- http://www.sciweavers.org/free-online-latex-equation-editor

**I would love to receive feedback in the comment section below.**

Read more…(636 words)

About the contributor:

Anirudh ThatipelliCS student interested in Statistics

100%

Loading…

Join the discussion. Add a reply…

Post

Table of contents

- Independence
- Conditional probability
- Key Takeaways:
- References:

Ready to join our community?

Sign up below to automatically get notified of new courses, get **reminders** to finish ones you subscribe to, and **bookmark** lessons to read later.

Continue with Facebook

— OR —

Your Full Name

Email address

I have an account. Log in instead

By signing up, you agree to our Terms and our Privacy Policy.

Popular Courses

New Courses

About Us

Get in touch

Copyright 2016-18, Compose Labs Inc. All rights reserved.