Dice rolls. (3.6, p. 92) If you roll a pair of fair dice, what is the probability of

  1. getting a sum of 1?
  2. getting a sum of 5?
  3. getting a sum of 12?

Answers:

(a): this is impossible, since the lowest sum could be 2. P(x+y=1)=0

(b): there are 4 combinations out of 36 possible combinations. Therefore P(x+y=5) = 4/26 = 2/13 = 11.11%

(c): there is only one combination that achieves this. 6 and 6. Therefore P(x+y=12) = 1/36 = 2.78%


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.

  1. Are living below the poverty line and speaking a foreign language at home disjoint?

Answer: No, it is possible for an individual to both speak a foreign language at home while also being below the poverty line. The two are not mutually exclusive

  1. Draw a Venn diagram summarizing the variables and their associated probabilities.
library(VennDiagram)
## Loading required package: grid
## Loading required package: futile.logger
grid.newpage()
draw.pairwise.venn(14.6, 20.7, 4.2, category = c("Poverty", "Other Language"), fill = c("green", "yellow"), 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])
  1. What percent of Americans live below the poverty line and only speak English at home?

Answer: P(Poverty) - P(Poverty and Foreign) = 10.4%

  1. What percent of Americans live below the poverty line or speak a foreign language at home?

Answer: P(Poverty) + P(Foreign) - P(Poverty and Foreign) = 31.1%

  1. What percent of Americans live above the poverty line and only speak English at home?

Answer: P(English, no Poverty) = 100 - (P(Foreign) + P(Poverty) - P(Foreign + Poverty)) = 100% - 31.1% = 68.9%

  1. Is the event that someone lives below the poverty line independent of the event that the person speaks a foreign language at home?

Answer: P(Poverty|English) = 10.4 / (69.9 + 10.4) = 12.95% P(Poverty|Foreign) = 4.2 / (16.5 + 4.2) = 20.28%

Based on the above, Foreign language speakers exhibit a higher rate of poverty than english speakers. This shows that two events (living below poverty line, and speaking a foreign language at home) 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.

female_blue <- 108 / 204
female_brown <- 55 / 204
female_green <- 41 / 204


male_blue <- 114 / 204
male_brown <- 54 / 204
male_green <- 36 / 204


both_blue <- 78 / 204
both_brown <- 23 / 204
both_green <- 16 / 204


male_brown_female_blue <- 19 / 204
male_green_female_blue <- 11 / 204
  1. What is the probability that a randomly chosen male respondent or his partner has blue eyes?
either_blue = male_blue + female_blue - both_blue
either_blue
## [1] 0.7058824
  1. What is the probability that a randomly chosen male respondent with blue eyes has a partner with blue eyes?
famlae_blue_given_male_blue = both_blue / male_blue
famlae_blue_given_male_blue
## [1] 0.6842105
  1. 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?
female_blue_given_male_brown = male_brown_female_blue/male_brown
female_blue_given_male_brown
## [1] 0.3518519
female_blue_given_male_green <- male_green_female_blue/male_green
female_blue_given_male_green
## [1] 0.3055556
  1. Does it appear that the eye colors of male respondents and their partners are independent? Explain your reasoning.

Answer: No, the two do not seem independant. If they were independant, then it wouldn’t matter what color the man’s eye color is in determining the female’s. However, looking at the data, knowing that a man’s eye color is blue significantly increases the chances that the female’s eye color is blue as well.


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.

total <- 95
fiction <- 72 / total
non_fiction <- 23 / total
hardcover <- 28 / total
paperback <- 67 / total
hardcover_fiction <- 13 / total
hardcover_nonfiction <- 15 / total
paperback_fiction <- 59 / total
paperback_nonfiction <- 8 / total
  1. Find the probability of drawing a hardcover book first then a paperback fiction book second when drawing without replacement.
paperback_fiction_second <- 59 / (total-1)
final <- hardcover * paperback_fiction_second
final
## [1] 0.1849944
  1. Determine the probability of drawing a fiction book first and then a hardcover book second, when drawing without replacement.
hardcover_second <- 28 / (total-1)
final <- fiction * hardcover_second
final
## [1] 0.2257559
  1. Calculate the probability of the scenario in part (b), except this time complete the calculations under the scenario where the first book is placed back on the bookcase before randomly drawing the second book.
final <- fiction * hardcover
final
## [1] 0.2233795
  1. The final answers to parts (b) and (c) are very similar. Explain why this is the case.

Answer: The answers in (b) ad (c) are similar because by removing 1 book from a total of 95, you are only removing 1% of the data. But also important to consider is that the percentage of Fiction books that are Hardcover is relatively low (13/72 = 18%). This implies that if you take a fiction book first, there is a good chance that is not hardcover. This makes the chance to pick a hardcover even greater in the second pick, if there is no replacement.


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.

  1. Build a probability model, compute the average revenue per passenger, and compute the corresponding standard deviation.
bags <- c(0,1,2)
fees <- c(0, 25, 25+35)
proportion <- c(0.54, 0.34, 0.12)
xPx <- fees * proportion

model <- data.frame(bags, fees, proportion, xPx)
model
average_revenue <- sum(model$fees * model$proportion)
average_revenue
## [1] 15.7
outcome_minus_ex <- model$fees - average_revenue
outcome_minus_ex_squared <- outcome_minus_ex^2
outcome_minus_ex_squared_times_probability <- outcome_minus_ex_squared * model$proportion

variance_bag_fees <- sum(outcome_minus_ex_squared_times_probability)
sd_bag_fees <- variance_bag_fees^(0.5)

sd_bag_fees
## [1] 19.95019
  1. About how much revenue should the airline expect for a flight of 120 passengers? With what standard deviation? Note any assumptions you make and if you think they are justified.

Assumptions: I am assuming that the number of bags a customer brings is independent of what other customers bring.

expected_revenue <- 120*average_revenue
expected_revenue
## [1] 1884
expected_sd <-sqrt(120*variance_bag_fees)
expected_sd
## [1] 218.5434

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.

  1. Describe the distribution of total personal income.
Income_range <- c("1 to $9999 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")
proportion <- c(.022, .047, 0.158, 0.183, 0.212, 0.139, 0.058, 0.084, 0.097)
income_df <- data.frame (Income_range, proportion)
income_df
barplot(proportion)

Answer: The distribution is nearly normally distributed, with a majority of the population making between 35k to 49k. There are drop offs to either side, however a second peak exists to the right, showing an uptick in extremely wealthy individuals

  1. What is the probability that a randomly chosen US resident makes less than $50,000 per year?
sum(income_df[1:5,]$proportion)
## [1] 0.622
  1. What is the probability that a randomly chosen US resident makes less than $50,000 per year and is female?
# I am assuming that a person's gender and their income are independant variables

sum(income_df[1:5,]$proportion) * .41
## [1] 0.25502
  1. The same data source indicates that 71.8% of females make less than $50,000 per year. Use this value to determine whether or not the assumption you made in part (c) is valid.

Answer: Because 71.8% != 62% (percent of individuals making less than 50k a year), I can deduce that my initial assumption is likely incorrect.