Dice rolls. (3.6, p. 92) If you roll a pair of fair dice, what is the probability of
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.
library(VennDiagram)
## Loading required package: grid
## Loading required package: futile.logger
pov <- 14.6
forLang <- 20.7
both <- 4.2
povOnly <- pov - both
forLangOnly <- forLang - both
venn.plot <- draw.pairwise.venn(pov, forLang, cross.area=both,
c("Poverty", "Foreign Language"), fill=c("lightblue", "lightgreen"),
cat.dist=-0.08, ind=FALSE)
grid.draw(venn.plot)
What percent of Americans live above the poverty line and only speak English at home? 100-14.6= 85.4 100-20.7=79.3 0.8540.793 100= 67%
Is the event that someone lives below the poverty line independent of the event that the person speaks a foreign language at home?
Yes, the event that someone lives below the poverty line independent of the event that the person speaks a foreign language at home.
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.
(108+114-78)/204
## [1] 0.7058824
(78/114)
## [1] 0.6842105
#a randomly chosen male respondent with brown eyes has a partner with blue eyes
(19/54)
## [1] 0.3518519
#a randomly chosen male respondent with green eyes having a partner with blue eyes
(11/36)
## [1] 0.3055556
Yes the eye colors of male respondents and their partners are independent because the eye color of the males dont affect the outcome of their partners eye colors.
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.
(28/95) * (59/94)
## [1] 0.1849944
(72/95) *(28/94)
## [1] 0.2257559
(72/95)*(28/95)
## [1] 0.2233795
Because as the sample size increases, taking out one book would not have as big an impact on the probabilities on the second draw.
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.
fees<-c(0, 25, 25+35)
prob<-c(0.54, 0.34, 0.12)
#average revenue
avg_rev<-sum(fees*prob)
avg_rev
## [1] 15.7
#standard deviation
sd<-round(sqrt(sum((fees-avg_rev)^2 * prob)), 3)
sd
## [1] 19.95
passgr<-120
avg_rev120<-avg_rev*passgr
avg_rev120
## [1] 1884
sd_120<-round(sqrt(120*sd^2), 3)
sd_120
## [1] 218.541
income<-c("$1-$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")
total<-c(0.022, 0.047, 0.158, 0.183, 0.212, 0.139, 0.058, 0.084, 0.097)
income_df<-data.frame(income, total)
income_range<-c(9999,14999,24999,34999,49999,64999,74999, 99999, 100000)
df_incomes<-data.frame(income,total)
barplot(df_incomes$total, xlab="Income Ranges", ylab="Probability")
sum(df_incomes$total[1:5])
## [1] 0.622
Describe the distribution of total personal income. Looks like a rightskewed bimodial distribution.
What is the probability that a randomly chosen US resident makes less than $50,000 per year? 62.2.%
What is the probability that a randomly chosen US resident makes less than $50,000 per year and is female? Note any assumptions you make.
25.5%
62.2 * 0.41
## [1] 25.502
This value will deem my assumption invalid.