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.
poverty<- .146
lang_other<-.207
both<- .042
Are living below the poverty line and speaking a foreign language at home disjoint? No, they it is possible to have both in the same family; 4.2% fall into both categories.
Draw a Venn diagram summarizing the variables and their associated probabilities.
grid.newpage()
draw.pairwise.venn(14.6, 20.7, 4.2, category = c("Poverty", "Other Language"), lty = rep("blank",2), fill = c("blue", "red"), 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])
percent(poverty-both)
## [1] "10.4%"
percent(poverty+lang_other-both)
## [1] "31.1%"
percent((1-poverty)*(1-lang_other))
## [1] "67.7%"
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.
male_blue <- 114/204
female_blue <- 108/204
mf_blue <- 78/204
percent(male_blue+female_blue-(mf_blue))
## [1] "70.6%"
percent(1*mf_blue)
## [1] "38.2%"
(c1) What is the probability that a randomly chosen male respondent with brown eyes has a partner with blue eyes? What about the probability of a randomly chosen male respondent with green eyes having a partner with blue eyes?
male_br_female_b<-19/54
percent(1*male_br_female_b)
## [1] "35.2%"
(c2) What about the probability of a randomly chosen male respondent with green eyes having a partner with blue eyes?
male_g_female_b<-11/36
percent(1*male_g_female_b)
## [1] "30.6%"
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.
Hard_a <- 28/95
Paper_a <- 67/94
percent (1*(Hard_a * Paper_a))
## [1] "21.0%"
Fiction_b <- 72/95
Hard_b <- 28/94
percent (1*(Fiction_b * Hard_b))
## [1] "22.6%"
Fiction_b <- 72/95
Hard_c <- 28/95
percent (1*(Fiction_b * Hard_c))
## [1] "22.3%"
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.
first <- 25
second <- 35
no_luggage <- .54
one_luggage <- .34
two_luggage <- .12
luggage <- c(0,1,2)
cost <- c(0,25, 25+35)
percent_pass <- c(.54,.34,.12)
fee <- data.frame(luggage, cost, percent_pass)
fee
## luggage cost percent_pass
## 1 0 0 0.54
## 2 1 25 0.34
## 3 2 60 0.12
#calculate the average per passenger
avg_rev <- sum(cost*percent_pass)
avg_rev
## [1] 15.7
#calculate the variance
var_rev<- ((cost-avg_rev)^2)*percent_pass
total_var<- sum(var_rev)
total_var
## [1] 398.01
#calculate the SD
sd1<- round(sqrt(total_var),2)
expected_rev <- avg_rev * 120
expected_rev
## [1] 1884
var_120 <- 120*sd1^2
sd_120<- round(sqrt(var_120),2)
sd_120
## [1] 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")
percent_income <- c(2.2,4.7,15.8,18.3,21.2,13.9,5.8,8.4,9.7)
males<- .59
females <- .41
Income_percent <- data.frame(income,percent_income)
Income_percent
## income percent_income
## 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(Income_percent$percent_income, xlab = "Income", ylab = "percentage of income")
* Data is bimodal and Left Skewed
paste((2.2+4.7+15.8+18.3+21.2),"%",sep = "")
## [1] "62.2%"
#Females account for 41% of the study. If the probability of less than $50,000 per year is 62.2%,
# we should be able to multiply that by the percentage of Females in the study to achieve the answer
paste(((2.2+4.7+15.8+18.3+21.2)*females),"%",sep = "")
## [1] "25.502%"
# adjusting the female's percentage with new data
females_under_50 <- .718
paste(((2.2+4.7+15.8+18.3+21.2)*females_under_50),"%",sep = "")
## [1] "44.6596%"