Dice rolls. (3.6, p. 92) If you roll a pair of fair dice, what is the probability of
getting a sum of 1? The possible outcome for a pair of dice is 36. Solution: The probability of getting a sum of 1 from a pair of fair dice is 0.
getting a sum of 5? Solution: The probability of getting a sum of 5 is 4/36. (1,4; 4,1; 3,2; and 2,3) = 1/9.
getting a sum of 12? Solution: The probability of getting a sum of 12 is 1/36 from a pair of dice.
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.
Solution: No, since there are 4.2% of the population living below the poverty line and speaking a language other than English.
library(VennDiagram)
## Loading required package: grid
## Loading required package: futile.logger
library(ggplot2)
Below_poverty <- 14.6
Foreign_Language <- 20.7
Both <- 4.2
Poverty_only <- Below_poverty - Both
Foreign_Language_only <- Foreign_Language - Both
plot <- draw.pairwise.venn(Below_poverty,
Foreign_Language,
cross.area=Both,
c("Below_poverty", "Foreign_Language"),
fill=c("green", "lightblue"),
cat.dist=-0.08,
ind=FALSE)
grid.draw(plot)
What percent of Americans live below the poverty line and only speak English at home? Solution: 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. English Only = P(Below Poverty - Both)) = 14.6% - 4.2% = 10.4%
What percent of Americans live below the poverty line or speak a foreign language at home? Solution: P(below poverty line or speak foreign language) - P(Both) = 14.6% + 20.7% - 4.2% = 31.1%
What percent of Americans live above the poverty line and only speak English at home? Solution: P(Above proverty line and Speak English only) = (1 - 14.6%) * 79.3% = 67.7%
Is the event that someone lives below the poverty line independent of the event that the person speaks a foreign language at home? Solution: No. The events are not independent.
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.
MBlue <- 114/204
FBlue <- 108/204
FMBlue <- 78/204
Mblue_Only <- paste(round((MBlue + FBlue - FMBlue)*100, digits=1), "%", sep = "")
Mblue_Only
## [1] "70.6%"
There is about 71% that Male or Female has Blue eyes
FandMblue <- paste(round((FMBlue)*100, digits = 1), "%", sep = "")
FandMblue
## [1] "38.2%"
There is 38.2% chance that a blue eyed male respondent has partner with Blue eyes
MBBR_eyes <- 54
MBR_FB_eyes <- 19
MBR_FB <- (MBR_FB_eyes/MBBR_eyes)
MGR_eyes <- 36
MGR_FB_eyes = 11
MGR_FB_eyes <- (MGR_FB_eyes/MGR_eyes)
No, it appears that male eye color and their partner’s eye color are dependent.
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.
Prob <- paste(round(((28/95) * (59/94))*100, digits = 2), "%", sep = "")
Prob
## [1] "18.5%"
Prob <- paste(round(((13/95)*(27/94) + (59/95)*(28/94))*100, digits = 2), "%", sep = "")
Prob
## [1] "22.43%"
Prob <- paste(round(((72/95) * (28/95))*100, digits = 2), "%", sep = "")
Prob
## [1] "22.34%"
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.
bags <- c(0,1,2)
fees <- c(0,25,25+35)
prob <- c(.54, .34, .12)
revenue <- data.frame(bags, fees, prob)
Avgrevenue <- sum(fees * prob)
Avgrevenue
## [1] 15.7
variance <- ((fees - Avgrevenue)^2) * prob
var <- sum(variance)
stand_dev <- round(sqrt(var),2)
stand_dev
## [1] 19.95
The average revenue per customer is $15.70 and the standard deviation is 19.95
Expectedrev <- Avgrevenue * 120
Expectedrev
## [1] 1884
var_pass <- (120 * stand_dev^2)
var_pass
## [1] 47760.3
sd_pass <- round(sqrt(var_pass),2)
sd_pass
## [1] 218.54
The standard deviation for the expected revenue of 120 passengers is 218.54
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.
income <- c("$1 to $9,999","$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(2.2,4.7,15.8,18.3,21.2,13.9,5.8,8.4,9.7)
dist <- data.frame(income, total)
dist
## income total
## 1 $1 to $9,999 2.2
## 2 $10,000 to $14,999 4.7
## 3 $15,000 to $24,999 15.8
## 4 $25,000 to $34,999 18.3
## 5 $35,000 to $49,999 21.2
## 6 $50,000 to $64,999 13.9
## 7 $65,000 to $74,999 5.8
## 8 $75,000 to $99,999 8.4
## 9 $100,000 or more 9.7
barplot(dist$total, names.arg = income, xlab = "Annual Income", ylab = "Total")
prob <- sum(dist[1:5,]$total)
prob
## [1] 62.2
The probability of selected US resident makes less than $50K is 62%
prob_female <- 0.41 * prob
prob_female
## [1] 25.502
About 26% makes less than $50K and are female.
Female <- 0.718 * 0.41
Female
## [1] 0.29438
Although the values are close, if this assumption is true, then men seems to belong to the higher income scale than women.