Dice rolls. (3.6, p. 92) If you roll a pair of fair dice, what is the probability of
Total number of outcomes in rolling 2 dice = 6 X 6 = 36 Probability = no of required outcome/no of Total outcome
Prob(getting a sum of 1) = 0 (the least possible outcome it rolling 2 dice is 2)
Prob(getting a sum of 5) possible outcomes = (1,4); (2,3); (4,1); (3,5)
getting_a_sum_of_5 <- 4/36
round(getting_a_sum_of_5,2)
## [1] 0.11
(c) Prob(getting a sum of 12)
possible outcome = (6,6)
getting_a_sum_of_12 <- 1/36
round(getting_a_sum_of_12,2)
## [1] 0.03
Poverty and language. (3.8, p. 93) 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.
(a) No, they are not Disjoint because some American lives below poverty line and also speaks foreign language.
Let A = American live below the poverty line, P(A) = 0.146
Let B = Speak language other than English at home, P(B) = 0.207
P(A⋂B) = 0.042
P(A⋂B′) = 0.146-0.042 = 0.104
P(B⋂A′) = 0.207-0.042 = 0.165
library(VennDiagram)
## Warning: package 'VennDiagram' was built under R version 4.1.1
## Loading required package: grid
## Loading required package: futile.logger
## Warning: package 'futile.logger' was built under R version 4.1.1
grid.newpage()
draw.pairwise.venn(area1 = 14.6, area2 = 20.7, cross.area = 4.2,
category = c("Living below Poverty Line", "Speak a Forign Language"),
lty = rep("blank", 2), fill = c("#6495ED", "#ffb84d"),
alpha = rep(0.4, 2), cat.pos = c(0, 0), cat.dist = rep(0.02, 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])
percentage that live below poverty and only speaks English
P(A⋂B′) = 0.146-0.042 = 0.104
percentage = 10.4%
percentage that live a below a poverty line or speak a foreign languge.
P(A⋃B) = P(A) + P(B) - P(A⋂B)
P(A⋃B) = 0.146 + 0.207 - 0.042 = 0.311
percentage = 31.1%
percentage that lives above the poverty line and only speak English at home
100% - 31.1% = 68.9%
The events A and B are not independent from each other because P(A) ≠ P(A|B).
Assortative mating. (3.18, p. 111) 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.
(a) (108 + 114 - 78)/204 = 0.7059
(b) 78/114 = 0.6842
(c) Probability that male respondent with brown eyes has partner with blue eyes:
19/54 = 0.3519.
Probability that male respondent with green eyes has partner with blue eyes:
11/36 = 0.3056
(d) Eye colour of male respondent and their partner are not independent
Reason:
P(male=Blue|female=Brown)≠ P(male=Blue)
P(male=Blue|female=Brown) = P(male=Blue & female=Brown)/P(female=Brown)
23/204 / 55/204 = 23/55 = 0.4182
P(male = Blue) = 114/204 = 0.5588
since P(male=Blue|female=Brown)≠P(male=Blue), we say they are not independent
Books on a bookshelf. (3.26, p. 114) The table below shows the distribution of books on a bookcase based on whether they are nonfiction or fiction and hardcover or paperback.
(a) P(X) = P(Hardcover Book) x P(Paperback Fiction Book) = 28/95 * 59/94 = 0.1850
(b) P(X) = P(Fiction Book) x P(Hardcover Book) = 72/95 * 28/94 = 0.2258
(c) P(X) = P(Fiction Book) x P(Hardcover Book) = 72/95 * 28/95 = 0.2234
(d) The final answer to parts (b) and (c) are very similar because in part (b), book is drawn without replacement and the total outcome reduces to 94 after the first pick while in part (c) books is drawn with replacement and the total outcome remains the same after the first pick
Baggage fees. (3.34, p. 124) 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.
library(tinytex)
(a)
The exptected value E(X) = ∑x∗P(X=x) E(X) = (0 * 0.54) + (25 * 0.34) + (60 * 0.12) = 15.7
The average revenue per passenger is $15.7.
The variance V(X) = E(X^2) - (E(X))^2
V(X) = [(0^2)0.54 + (25^2)0.34 + (60^2)*0.12] - (15.7)^2
V(X) = 644.5 - 246.49 = 398.01.
variance V(X) = 398.01
The standard deviation SD(X)= √Var(X)
SD(X) = √398.01 = √19.95.
Standard Deviation (SD) = √19.95.
(b)
The expected revenue E(x) for a flight of 120 passengers
= 120 * E(X)
= 120 * $15.7 = $1,884.
Income and gender. (3.38, p. 128) 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.
(a)
library(ggplot2)
Income <- c("$1 to $9,999 or less", "$10,000 to $14,999", "$15,000 to $24,999",
"$25,000 to $34,999", "$35,000 to $49,999", "$50,000 to $64,999",
"$65,000 to $74,999", "$75,000 to $99,999", "$100,000 or more")
Income_Percent <- c(.022, .047, .158, .183, .212, .139, .058, .084, 0.097)
IncomeTable <- cbind(Income,Income_Percent)
IncomeTable <- data.frame(IncomeTable)
IncomeTable$Percentage <- as.double(levels(IncomeTable$Income_Percent))[IncomeTable$Income_Percent]
ggplot(IncomeTable, aes(x=factor(Income),y=Income_Percent,fill=factor(Income))) + geom_bar(stat="identity") + labs(title="Distribution of Total Personal Income") + ylab("Percentage") + theme(legend.position = "none", axis.title.x = element_blank(), axis.text.x=element_text(angle=45)) + theme(plot.title = element_text(hjust=0.5)) + theme(axis.text.x = element_text(margin = margin(t = 25, r = 20, b = 0, l = 0)))
(a) From the plot, Income looks normally distributed but it increases towards the end.
(b) P(X < $50,000) = 0.022+0.047+0.158+0.183+0.212 = 0.622.
(c) Assuming that income and female are independent.
Then P(X<$50,000 and X=females) = P(X<$50,000) * P(X=females)
= 0.622 * 0.41 = 0.26.
(d) In (c), we made the assumption that the probability of US resident income and female are independent. That is 0.26. However, the observed data source shows that the 71.8% of female makes less than $50,000. Therefore, the assumption made in part (c) is not valid. In other words, income and female are not independent.