Independence refers to a situation where two or more events or variables are not influenced by each other.
𝑃(𝐴∩𝐵)=𝑃(𝐴).𝑃(𝐵)
Mutually exclusive events are events that cannot occur simultaneously.
𝑃(𝐴∩𝐵)=0
⇒𝑃(𝐴∩𝐵)=𝑃(𝐴).𝑃(𝐵)=0
⇒𝑃(𝐴).𝑃(𝐵)=0
So, for two events, if one event happens to not occur, then the events are independent and mutually exclusive. They are both time of occurence and realisation dependent.
Mutually exclusive
Not mutually exclusive
Independent
Not independent
Experiment: Tossing a Fair Six-Sided Die
Sample Space (Outcomes): {1, 2, 3, 4, 5 ,6}
i. Mutually Exclusive Events:
Events A: Getting an even number (2, 4, 6)
Events B: Getting an odd number (1, 3, 5)
ii. Not Mutually Exclusive Events:
Events C: Getting a number less than 4. (1, 2, 3)
Events D: Getting an even number (2, 4, 6)
iii. Independent Events:
Events E: Getting a 3 or higher (3, 4, 5, 6)
Events F: Getting an even number (2, 4, 6)
iv. Not Independent Events:
Events G: Getting an even number (2, 4, 6)
Events H: Getting a number greater than 4. (5, 6)
These events are not independent because the outcome of one event does affect the probability of the other event. If you roll a 5 or 6 (event H), it is guaranteed that you also rolled an even number (event G). Therefore, G and H are not independent.
Adding the dataset to the global environment
#Clearing the global environment
rm(list = ls())db = read.csv('/Users/aritraray/Downloads/train.csv')
# Creating a three-way table
table(db$Survived,
db$Sex,
db$Pclass
)
## , , = 1
##
##
## female male
## 0 3 77
## 1 91 45
##
## , , = 2
##
##
## female male
## 0 6 91
## 1 70 17
##
## , , = 3
##
##
## female male
## 0 72 300
## 1 72 47
Recreate the same table using pivot charts in Excel.
Passenger class in columns:
Passenger class in rows:
There is a noticeable pattern where most of the passengers of Pclass = 3, did not survive.
A larger number of male passengers died, compared to female passengers.