Joint Probability and Union Probability are fundamental concepts in probability theory, and represent different ways of describing relationships between events.
Joint Probability
Joint probability refers to the probability of two or more events occurring at the same time. It is often referred to as
where and are the events in question.
For example, if is the event “rolling an even number” and is the event “rolling a number greater than 4” on a die roll, the joint probability would be the probability of obtaining an even number greater than 4, such as 6.
Union Probability
The probability of union refers to the probability that at least one of two or more events will occur. It is often referred to as
where and are the events in question.
Continuing with the previous example, would be the probability of getting an even number or a number greater than 4 on a die roll.
Difference between Joint Probability and Union Probability
The main difference between these two probabilities is that joint probability refers to the simultaneous occurrence of two events, while joint probability refers to the occurrence of at least one of two events.
The probability of the union can be calculated using the addition principle:
.
In other words, the probability of the union is the sum of the probabilities of the individual events minus the probability of their intersection.
In summary, joint probability describes the probability that two events will occur together, while joint probability describes the probability that at least one of them will occur.
Example with Python
To better understand the concepts we can make a small example in Python that illustrates the concepts of “Joint Probability” and “Union Probability” using a simple scenario of rolling a dice:
import numpy as np
# Definition of the probability of obtaining an even number (A) and a number greater than 4 (B)
prob_pari = 3 / 6 # 1, 2, 3 sono pari
prob_maggiore_di_4 = 3 / 6 # 5, 6 sono maggiori di 4
# Definition of the joint probability P(A ∩ B)
prob_congiunta = 1 / 6 # Solo il 6 soddisfa entrambe le condizioni
# Calculation of the probability of the union P(A ∪ B)
prob_unione = prob_pari + prob_maggiore_di_4 - prob_congiunta
# Printing of results
print(f"Probability of getting an even number (A): {prob_pari}")
print(f"Probability of rolling a number greater than 4 (B): {prob_maggiore_di_4}")
print(f"Joint probability P(A ∩ B): {prob_congiunta}")
print(f"Probability of union P(A ∪ B): {prob_unione}")
In this example, we are considering two events:
A: Getting an even number on a die roll.
B: roll a number greater than 4.
The code calculates the joint probability and the union probability using the addition principle for the union probability. The results are then printed to illustrate how these probabilities are calculated in the specific context of rolling a die.