2.6

(a)

###P(1) =0

(b)

###P(5)= P({1,4},{4,1},{3,2},{2,3})
4/36
## [1] 0.1111111

(c)

###P(12) = P({6,6}) 
1/36
## [1] 0.02777778

2.8 Let P( A = Americans live below the Poverty line ) = 14.6%

P( B = speak a language other than English ) = 20.7%

P( AB ) = 4.2%

(a)

###Not disjoint since P(AB) is not 0.

(b) Draw a Venn diagram summarizes the variables

PA <- 0.146 #P( A = Americans live below the Poverty line ) 
PB <- 0.207 #P( B = speak a language other than English )
PAB <- 0.042 # P( AB ) 

library('VennDiagram')
## Loading required package: grid
## Loading required package: futile.logger
venn.plot <- draw.pairwise.venn(area1 = PA,area2 = PB,cross.area = PAB,category = c("% of Americans live below the Poverty line", "% of speak a language other than English"),fill = c("blue", "yellow"));
grid.draw(venn.plot);

(c)

###P(A) - p(B)
14.6/100 -4.2/100
## [1] 0.104
###P(A) + P(B) - P(AB) 
14.6/100 + 20.7 - 4.2/100 
## [1] 20.804
###1- ( P(A) + P(B) - P(AB) )
1-(14.6/100 + 20.7/100 - 4.2/100)
## [1] 0.689
###P(A) - P(AB) 
14.6/100 -4.2/100 
## [1] 0.104

2.20

(a)

108/204
## [1] 0.5294118

(b)

78/204
## [1] 0.3823529

(c)

19/204
## [1] 0.09313725
11/204
## [1] 0.05392157

(d)

###No, because there are some males respondent with a color eyes have their partner with another color eyes.

2.30

(a)

(28/95) *(59/94)
## [1] 0.1849944

(b)

72/95 * 28/94 + 72/95 * 27/94
## [1] 0.443449

(c)

72/95 * 28/95 + 72/95 * 27/95
## [1] 0.4387812

(d)

###The difference is the total number changed at the second drawing - the total in without replacement method less one than that can be placed back.

2.38

(a)

p0 <- 0.54 # % of passengers have no checked luggage
p1 <- 0.34 # % of passengers have one checked luggage
p2 <- 0.12 # % of passengers have two checked luggages

m0 <- 0  # no  charge
m1 <- 25 # money charge for one bag
m2 <- 25+35 # money charge for two bags: first bag $25 and second bag $35

avg <- p0*m0 + p1*m1 +p2*m2  # average revenue per passenger
avg
## [1] 15.7
sd <- sqrt(p0*(m0-avg)^2+p1*(m1-avg)^2 +p2*(m2-avg)^2)  # standard deviation of the revenue
sd
## [1] 19.95019

(b)

n <- 120  # number of passenger in a flight
avgF <- n*avg  # average revenue per flight
avgF
## [1] 1884
sdF <- sqrt((n*p0*(m0-avg))^2+(n*p1*(m1-avg))^2+(n*p2*(m2-avg))^2)  # standard deviation of the revenue
sdF
## [1] 1259.34

2.44

(a)

income <- c("$1 to $9,999 or loss","$10,000 to 14,999","$15,000 to 24,999","$25,000 to 34,999","$30,000 to 49,999","$50,000 to 64,999","$65,000 to 74,999","$75,000 to 99,999","$100,000 or more" )

percent <- c(0.02,0.047,0.158,0.183,0.212,0.139,0.058,0.084,0.097)

df <- data.frame(income,percent)
names(df) <-c("income","total")
df
##                 income total
## 1 $1 to $9,999 or loss 0.020
## 2    $10,000 to 14,999 0.047
## 3    $15,000 to 24,999 0.158
## 4    $25,000 to 34,999 0.183
## 5    $30,000 to 49,999 0.212
## 6    $50,000 to 64,999 0.139
## 7    $65,000 to 74,999 0.058
## 8    $75,000 to 99,999 0.084
## 9     $100,000 or more 0.097
summary(df)
##                   income      total       
##  $1 to $9,999 or loss:1   Min.   :0.0200  
##  $10,000 to 14,999   :1   1st Qu.:0.0580  
##  $100,000 or more    :1   Median :0.0970  
##  $15,000 to 24,999   :1   Mean   :0.1109  
##  $25,000 to 34,999   :1   3rd Qu.:0.1580  
##  $30,000 to 49,999   :1   Max.   :0.2120  
##  (Other)             :3
barplot(percent, xlab="ranges of income")

(b)

###P(<$50,000) assume the sample data is unbiased
0.02+0.047+0.158+0.183+0.212
## [1] 0.62

(c)

###P(<$50,000 Females) assume the sample data is unbiased and female's income distribution matches the sample income distribution 
(0.02+0.047+0.158+0.183+0.212) * 0.41
## [1] 0.2542

(d)

###Since 71.8% of females, who make less than $50,000 per year, is more than the assumption 62.2%, female's income distribution isn't matches the sample income distribution.