# Packages list
library(knitr)
Mutually exclusive events are events that the occurrence of one event precludes the occurrence of another event. This is true for events that cannot happen at the same time.
Not mutually exclusive events are events that can happen at the same time.
Dependent event is used to describe an event that its occurrence is affected by the occurrence or nonoccurrence of another event. This is true when an event has an effect on the outcome of another event.
Independent event is used to describe an event that its occurrence is not affected by the occurrence or nonoccurrence of another event. This is true when an event has no effect on the outcome of another event.
Experiment 1: picking up a marble from a bag filled with color marbles but half of them are hollow. The colors and marble counts are, 8 green, 8 red, 8 blue, 8 yellow.
Picking up a marble will be independent if there is replacement after the selection and will be dependent if there is no replacement after selection
The sample space will be each individual marble {HG,HG,HG,HG,G,G,G,G,HR,HR,HR,HR,R,R,R,R,HB,HB,HB,HB,B,B,B,B,HY,HY,HY,HY,Y,Y,Y,Y}
- Mutually exclusive event: taking out green and yellow marble. Since we are picking only 1 marble at a time, both events cannot happen at the same time.
-Not mutually exclusive event: taking out a green and hollow marble. Since picking a green and hollow marble can happen at the same time, we say that the event is non-mutually exclusive.
Experiment 2: Authorizing people for a loan based on their credit score.
There are 2 events happening here, the first one is running a credit score (300-850) and the other one is giving a yes or no to the applicant. Applications are approved to people with a credit score higher than 600
These are dependent events because the outcome of the credit score affects the outcome of the application. It would be an independent event if the outcome of the application is not determined by the credit score.
-Mutually exclusive event: a person with a 300 and 800 credit score. Credit score is a unique value, a person cannot have 2 different credit scores at a certain instant in time.
-Non mutually exclusive event: a person with a 700 credit score and approved application. This is a non-mutually exclusive event because these events can happen at the same time.
dt <- read.csv(file = "train.csv",
header = TRUE)
table(dt$Survived,
dt$Sex,
dt$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
Around 55.11% of the total passengers were in the 3rd class
The total survival rate of women by class is
1st: 96.8%
2nd: 91.4%
3rd: 50%
The total survival rate of men by class is
1st: 36.89%
2nd: 15.74%
3rd: 13.54%
Rate of survival by class
1st: 62.96%
2nd: 42.28%
3rd: 24.24%