2.6 Dice rolls. If you roll a pair of fair dice, what is the probability of:
Zero. The min sum that can be is 2.
Possible combinations: 1:4, 4:1, 2:3, 3:2. Hence, 4/36.
Possible combination: 6:6. Hence, 1/36.
2.8 Poverty and language. The American Community Survey is an ongoing survey that provides data every year to give communities the current information they need to plan investments and services. The 2010 American Community Survey estimates that 14.6% of Americans live below the poverty line, 20.7% speak a language other than English (foreign language) at home, and 4.2% fall into both categories.59
No, as it can happen at the same time. It is said: ‘4.2% fall into both categories’
# install.packages('VennDiagram')
library(VennDiagram)
## Loading required package: grid
## Loading required package: futile.logger
grid.newpage()
draw.pairwise.venn(area1 = 0.1, area2 =0.165, cross.area = 0.042, category = c("Poverty", "Foreign language speakers"), lty = rep("blank",
2), fill = c("light blue", "pink"),alpha = rep(0.5, 2), cat.pos = c(0,0), cat.dist = rep(0.025, 2))
## (polygon[GRID.polygon.1], polygon[GRID.polygon.2], polygon[GRID.polygon.3], polygon[GRID.polygon.4], text[GRID.text.5], text[GRID.text.6], text[GRID.text.7], text[GRID.text.8], text[GRID.text.9])
14.6% - 4.2% = 10.4%
14.6% + 20.7% - 4.2% = 31.1%
100% - (14.6% + 20.7% -4.2%) = 68.9%
Yes, two events are independent as knowing the outcome of one provides no useful information about the outcome of the other.
2.20 Assortative mating. Assortative mating is a nonrandom mating pattern where individuals with similar genotypes and/or phenotypes mate with one another more frequently than what would be expected under a random mating pattern. Researchers studying this topic collected data on eye colors of 204 Scandinavian men and their female partners. The table below summarizes the results. For simplicity, we only include heterosexual relationships in this exercise.
114/204 + 108/204 - 78/204
## [1] 0.7058824
78/114
## [1] 0.6842105
19/54
## [1] 0.3518519
11/36
## [1] 0.3055556
When two events are independent, we can say that P(A and B)=P(A)⋅P(B)
Blue+Blue:
(78/204) = (114/204) * (108/204) This equation is not true, hence these events are not independent.
2.30 Books on a bookshelf. The table below shows the distribution of books on a bookcase based on whether they are nonfiction or fiction and hardcover or paperback.
(28/95)*(59/94)
## [1] 0.1849944
If the first book is a hardcover fiction book:
(72/95) * (27/94)
## [1] 0.2176932
If was a paperback fiction book first:
(72/95) * (28/94)
## [1] 0.2257559
(72/95) * (28/95)
## [1] 0.2233795
The sample size is quite large, if we take one book out of 94 it will not affect the result significantly.
2.38 Baggage fees. An airline charges the following baggage fees: $25 for the first bag and $35 for the second. Suppose 54% of passengers have no checked luggage, 34% have one piece of checked luggage and 12% have two pieces. We suppose a negligible portion of people check more than two bags.
fees<-c(0, 25, 60)
prob<-c(0.54, 0.34, 0.12)
df<-data.frame(fees,prob)
EV<-sum(df$fees*df$prob)
df$var<-((df$fees-EV)**2)*df$prob
std<-sqrt(sum(df$var))
df
## fees prob var
## 1 0 0.54 133.1046
## 2 25 0.34 29.4066
## 3 60 0.12 235.4988
EV
## [1] 15.7
std
## [1] 19.95019
Average revenue per passenger is $15.7, standard deviation is $19.95
Expected Revenue for a flight of 120 passenger:
120*15.7
## [1] 1884
Standard deviation for a flight of 120 passenger:
120*19.95
## [1] 2394
Expected revenue for 120 passangers: $1884 with std $2394 assuming 54% of passengers have no checked luggage, 34% have one piece of checked luggage, 12% have two pieces and negligible portion of people check more than two bags.
2.44 Income and gender. The relative frequency table below displays the distribution of annual total personal income (in 2009 inflation-adjusted dollars) for a representative sample of 96,420,486 Americans. These data come from the American Community Survey for 2005-2009. This sample is comprised of 59% males and 41% females.
income <- c(0.022,0.047,0.158,0.183,0.212,0.139,0.058,0.084,0.097)
barplot(income)
The distribution is skewed to the right. Pick is at $35,000 to $49,999 income (21.2%)
2.2 + 4.7 + 15.8 + 18.3 + 21.2
## [1] 62.2
62.2*0.41
## [1] 25.502
Assumption: gender and income are independent.
71.8% is not equal to 25.5%
I can conclude that the assumption that I have made in part (c) is not valid and these events are dependent.