(3.6, p. 92) If you roll a pair of fair dice, what is the probability of
Answer:
P=1 | P=2 | P=3 | P=4 | P=5 | P=6 | |
---|---|---|---|---|---|---|
x | 1/6 | 1/6 | 1/6 | 1/6 | 1/6 | 1/6 |
y | 1/6 | 1/6 | 1/6 | 1/6 | 1/6 | 1/6 |
Because the sum of min(x) and min(y) equals 2, therefore P(sum(x,y)=1) = 0.
P(sum(x,y)=5) = P(x=1,y=4) + P(x=2,y=3) + P(x=3,y=2) + P(x=4,y=1) = 4*(1/6)^2 = 1/9.
P(sum(x,y)=12) = P(x=6,y=6) = (1/6)^2 = 1/36.
(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.
Answer: The two data groups are not disjoint because 4.2% fall into both categories.
Answer:
library(VennDiagram)
## Loading required package: grid
## Loading required package: futile.logger
venn<-grid.newpage()
venn.plot <- draw.pairwise.venn(area1 = 0.146,
area2 = 0.207,
cross.area = 0.042,
category = c("Live below the poverty line",
"Speak foreign language at home"),
fill = c("purple", "yellow"),
col = c("black", "black"),
##lty = "blank",
##cex = 2,
cat.cex = 0.8,
##cat.pos = c(285, 105),
cat.dist = -0.25,
cat.just = list(c(-0.5, 2), c(1.3, 0)),
ext.pos = 30,
ext.dist = -0.05,
ext.length = 0.85,
ext.line.lwd = 2,
ext.line.lty = "dashed",
euler = TRUE
)
Answer: P(below poverty line and only speak English at home) = P(below povery line) - P(below poverty line and speak foreign language at home) = 14.6% - 4.2% = 10.4%.
Answer: P(below poverty line or speak foreign language at home) = P(blow poverty line) + P(speak foreign language at home) - P(below poverty line and speak foreign language at home) = 14.6% + 20.7% - 4.2% = 31.1%.
Answer: P(above poverty line and only speak English at home) = 1 - P(below poverty line or speak foreign language at home) = 1 -31.1% = 69.9%.
Answer: The two events are not independent. Becuase P(below poverty line) * P(speaks a foreign language at home) = 14.6% * 20.7% = 3.0222%, and P(below poverty line and speaks a foreign language at home) = 4.2%. P(below poverty line) * P(speaks a foreign language at home) doesn’t euqal to P(below poverty line and speaks a foreign language at home).
(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.
Answer: P(male w/ blue eyes or female w/ blue eyes) = P(male w/ blue eyes) + P(female w/ blue eyes) - P(both w/blue eyes) = 114/204+108/204-78/204 = 70.59%.
Answer: P(female w/ blue eyes | male w/ blue eyes) = P(both w/ blue eyes) / P(male w/ blue eyes) = (78/204) / (114/204) = 68.42%
Answer: P(female w/ blue eyes | male w/ brown eyes) = P(male w/ brown eyes and female w/ blue eyes) / P(male w/ brown eyes) = (19/204) / (54/204) = 35.19%
P(female w/ blue eyes | male w/ green eyes) = P(male w/ green eyes and female w/ blue eyes) / P(male w/ greed eyes) = (11/204) / (36/204) = 30.56%
P(female w/ blue eyes | male w/ blue eyes) = 68.42% (from question (a)).
P(female w/ blue eyes) = 108/204 = 52.94%.
P(female w/ blue eyes | male w/ blue eyes) does not equal P(female w/ blue eyes) therefore the eye colors of male respondents and their partners are not independent.
(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.
Answer: P(first hardcover and second paperback fiction w/o replacement) = (28/95)*(59/94)=18.50%.
Answer: P(first fiction second hardcover w/o replacement) = P(first fiction | hardcover)*P(first hardcover)*P(second hardcover w/o replacement)+P(first fiction | paperback)*P(first paperback)*P(second hardcover w/o replacement) = (13/28)*(28/95)*(27/94)+(59/67)*(67/95)*(28/94)=22.43%
Answer: P(first fiction second hardcover w replacement) = P(fiction)*P(hardcover) = (72/95)*(28/95)=22.34%
Answer: The difference between conducting experiment with or without replacement is whether to reset the test sample or not. General speaking, for experiment with a small sample, such as a set of 10 objects, the results between with or without replacement are quite different because the distribution of the sample set changes a lot if one object is removed. However, the difference between with or without replacement gets smaller as sample size gets larger. In our case, the experiment has a large sample size (95 books), removing one object doesn’t cause much changes to the distribution of the sample.
(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.
Answer:
# Build a dataframe for the probability model
CustPcnt <- c(0.54, 0.34, 0.12)
Fee <- c(0, 25, 25+35)
model <- data.frame(CustPcnt, Fee)
rownames(model) <- c("No luggage", "One piece", "Two piece")
kable(model) %>%
kable_styling(c("striped","bordered"))
CustPcnt | Fee | |
---|---|---|
No luggage | 0.54 | 0 |
One piece | 0.34 | 25 |
Two piece | 0.12 | 60 |
#Compute average revenue per passenger E(x)
mean <- sum(model$CustPcnt*model$Fee)
mean
## [1] 15.7
#compute standard deviation
var <- sum(model$CustPcnt*model$Fee^2)-mean^2
SD <- sqrt(var)
SD
## [1] 19.95019
# Expected revenue for 120 passengers
mean120 <- mean*120
mean120
## [1] 1884
# Standard Deviation
SD120 <- SD*sqrt(120)
SD120
## [1] 218.5434
The assumptions is that the sample distribution of the 120 passengers are consistent with the population distribution regarding number of luggages checked.
(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.
Income <- c("$1 to $9,999 or loss","$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")
Total <- c(0.022,0.047,0.158,0.183,0.212,0.139,0.058,0.084,0.097)
model <- data.frame(Income, Total)
library(ggplot2)
ggplot(data=model, aes(x=Income, y = Total, fill = Total, label = Total))+
geom_bar(stat="identity")+
ggtitle("Income Distribution")+
theme(axis.text.x = element_blank(),plot.title = element_text(hjust=0.5),legend.position = "right")
library(moments)
skewness(Total)
## [1] 0.1805864
Answer: From both the barplot and the skewness, we know the data has a right skewed bimodal distribution.
Answer: P(<50,000) = 0.022+0.047+0.158+0.183+0.212 = 62.2%
Answer: P(<-50,000 and female) = 0.622 * 0.41 = 25.502%. The assumption is that women and men has the same distribution of income.
Answer: with the value provided in (d), we can determine that the assumption made in Part (c) is not valid. using the value in (d), P(<50,000 and female) = 71.8% * 41% = 29.438%. The number in (d) also indicates that compared to women, men has a higher ratio of earning more than 50,000, women and men does not have the same distribution of income.