# Conditional Probability

The outcome of one event depends on an earlier event.

For example, the probability of obtaining a positive test result is dependent on whether or not you have a particular condition. If you have a condition, it is more likely that a test result is positive. We can formulate conditional probabilities for any two events in the following way:

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-Lg-yQcViQRg14BbdWng%2F-Lg3CU13cvlV_tIaA0_u%2Fimage.png?alt=media\&token=152d1972-f3f3-4ae3-852c-172db1f4d272)

Example

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-Lg-yQcViQRg14BbdWng%2F-Lg35fEwuS4MWVwdpQR6%2Fimage.png?alt=media\&token=7ccee09f-07fc-4382-a29e-0c7ce67f24f6)

We run a test to see if the person actually has cancer. In blue is the test and the conditionnal probability.&#x20;

So the test depends on something else: if the person has cancer or not. &#x20;

If this, we can write the truth table:&#x20;

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-Lg-yQcViQRg14BbdWng%2F-Lg36pu-81uy1mI1ILww%2Fimage.png?alt=media\&token=05f2957c-17d6-446a-a72c-92fe6fcad5e7)

To calculate the first Prob for example = P(cancer) = 0.1 \* P(positive | Cancer) = 0.9 = 0.09.&#x20;

The sum of all of those P's = 1.&#x20;

To find the Prob of a result being positive = 0.09 + 0.18 = 0.27. In reality what we did was:&#x20;

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-Lg-yQcViQRg14BbdWng%2F-Lg3891G4S24nkGmTf8v%2Fimage.png?alt=media\&token=a15df8c7-4c5f-4b35-9dd2-9e81c474f5c2)

Ex: say we have a bag of coins with 1 fair coin and 1 non fair coin. We pick 1 at random (50-50 chances). What's the prob of picking a head?&#x20;

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-Lg-yQcViQRg14BbdWng%2F-Lg39gtoq_T182IqdkdB%2Fimage.png?alt=media\&token=185d6ab7-c7a9-4329-9da3-b1a77f48b31d)

Same question now we flip the coin twice.&#x20;

![](https://846345873-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LagOeJ2nL90MQERwhxy%2F-Lg-yQcViQRg14BbdWng%2F-Lg3B6C_Cw2862OAm837%2Fimage.png?alt=media\&token=c57ff563-a8d1-448f-9191-2255b4079edf)
