# intuitive difference between joint probability and conditional probability in this example

I was reading a tutorial on marginal densities when I came across this example (rephrased).

A person is crossing the street and we want to compute the probability when he gets hit by a passing car depending on the color of the traffic light.

Let H be whether the person gets hit or not, and L be the color of the traffic light.

So $H = \{\text{hit, not hit} \}$ and $L = \{\text{red, yellow, green} \}$.

The probability of getting hit given that the light is red can be written as: $P(H = \text{hit}| L = \text{red})$. Clearly this is a conditional probability.

The probability of getting hit regardless of whatever the light is can be written as: $P(H = \text{hit})$. This is marginal, as I recently understood.

How can you say: $P(H,L)$. This is a joint probability. How do you translate it to a 'layman's sentence? How is it different from "The probability of getting hit AND the light is red"?

• The joint probability $P(H,L)$ is the probability of "getting hit and the light is red", so the answers seems to be contained in the question. Can you clarify what is unclear? May 24, 2016 at 7:42

$P(H=hit)$ is the marginal probability. It reads "The probability of getting hit.". It is the proportion of people that got hit crossing the street, irrespective of traffic light.

$P(H=hit|L=red)$ is the conditional probability. It reads "The probability that you get hit, given that the light is red". It is the proportion of hits among the people that cross the street in red light.

Finally, $P(H=hit, L=red)$ is the joint probability. It reads "the probability that a person gets hit by a car and that the light is red". It is the proportion of hits in red light among all people.

You certainly know the relationship

$P(H=hit, L=red) = P(H=hit | L=red) * P(L=red)$

In "layman's parlance", we can look at it as follows. Assume that the probability of having a red light is extremely small, but that people always get hit when crossing in red light. Let us assume you are an observer at the side of the street. You will see people getting hit, and rarely will you see the light turning red. Out of all people that cross the street, the chance they will get hit in red light is very tiny, since they almost never have that opportunity ($P(H=hit,L=red)$ is small because a red light is rare). However, if you observe long enough, you will eventually see people getting hit in red light, and notice that whenever the light is red, people crossing the street will get hit for sure ($P(H=hit|L=red)=1$).

• Thanks for the great explanation! I have one further question: Does it make sense for a total probability to equal 1? For example, if $P(H = hit, L = red) = 1$, does it mean everyone who ever tries to cross the road, will get hit and it will be during a red light?
– Ram
Mar 2, 2017 at 23:11
• Great explanation !! May 3, 2018 at 10:14

$H$ and $L$ are random variables. $H$ takes a value in $\{ \text{hit, not hit} \}$ and $L$ takes a value in $\{ \text{red, yellow, green} \}$. In this example, the joint distribution $P(H, L)$ gives the probability of two things both happening: that $H$ takes a particular value $h$ and $L$ takes a particular value $l$. You can also write this as $P(H=h \text{ and } L=l)$. To get the probability of a particular combination, you plug in values for $h$ and $l$. For example, $P(H=\text{hit}, L=\text{red})$ is the probability that the person is hit and the light is red.

You can think of there being a total probability (that sums to 1), which is like a fixed amount of 'stuff' (e.g. a liquid). The joint distribution takes this and spreads it out in different amounts over all possible combinations of values for $H$ and $L$.

I have tried to explain this example with assumed values of Joint Probability: This is all about perspective. Imagine a much simpler context. Say there are two different events A and B within a rectangular event space. We can colour the event spaces in green and blue circles and the overlapping area in red. Now, when we are saying P(A,B), or P(A|B), both of this indicates the events within the red area. But the perspective is different.

In case of P(A,B), the probability is (the area of the red space) / (the area of the whole rectangle)

In case of P(A|B), the probability is (the area of the red space) / (the area of the blue circle B) Now, imagine the traffic scenerio. Say, you are counting how many pedestrians are crossing the road and how many pedestrians are getting hit. Your counts are following,

Number of pedestrians crossing the road in green, yellow and red signals = X, Y, Z

Number of pedestrians getting hit crossing the road in green, yellow and red signals = A, B, C

Now, P(Hit, Red) = C/(X + Y + Z)

P(Hit|Red) = (C/(X+Y+Z))/(Z/(X+Y+Z)) = C/Z

So, in each case, of course, you have to count the pedestrians getting hit in red signals only to calculate C. When you count the probability P(Hit, Red), you have to count all the crossing pedestrians. But when you count the probability P(Hit|Red) you only have to count the pedestrian crossing, when the red light is on.

• Te events may be the same but the probabilities are numerically different. Feb 19, 2018 at 20:58
• Yes, the probabilities can be calculated by the ratio of the areas. P(A, B) is the ratio of the red area and the rectangular area. P(A|B) is the ratio of the red area and the blue circle area. Feb 20, 2018 at 15:58

Maybe there is a simpler explanation without requiring equations.

A fraction of people get hit regardless of light color (marginal prob). Of these hit people, a fraction get hit on red (conditional on red prob). Thus, to get an actual fraction of total population, multiply the two (joint probability).

• This answer is confusing. Jun 13, 2017 at 23:58

The intuitive difference among the two are:

1) Conditional probability P(H=hit|L=red) - Probability when light was red and people got hit, It doesn't consider all the people crossing the traffic.

2) Joint probability P(H=hit,L=red) - Probability of people getting hit and the light being red.

Key difference - in 1), sample space are not all the people, It's only those people crossing red light, in 2) sample space are everyone and intersection of people crossing red light and getting hit is the joint probability.