2.6 If you roll a pair of fair dice, what is the probability of

  1. getting a sum of 1? 0

  2. getting a sum of 5?

4/36
## [1] 0.1111111
  1. getting a sum of 12?
1/36
## [1] 0.02777778


2.8 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.59

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

No, there are people who are both under the poverty line and speaking foreign language

  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(area1 = 14.6, area2 = 20.7, cross.area = 4.2, 
                   category = c("BP", "FL"))

## (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? 10.4

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

16.5+4.2+10.4
## [1] 31.1
  1. What percent of Americans live above the poverty line and only speak English at home?
100-31.1
## [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?

No

.146 * .165 == .042
## [1] FALSE


2.20 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.

  1. What is the probability that a randomly chosen male respondent or his partner has blue eyes?
(108+114-78)/204
## [1] 0.7058824
  1. What is the probability that a randomly chosen male respondent with blue eyes has a partner with blue eyes?
78/108
## [1] 0.7222222
  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?
19/54
## [1] 0.3518519
11/36
## [1] 0.3055556
  1. Probability that a male repsondent has blue eyes times probability that a female repsondent has blue eyes does not equal to probability that a randomly choosen male and female respondents both have blue eyes. Thus, they seem to be dependent
p_BM <- 114/204
p_BF <- 108/204
p_BFandBM <- 78/204


p_BM * p_BF == p_BFandBM
## [1] FALSE
p_BM * p_BF - p_BFandBM
## [1] -0.08650519


2.30 The table below shows the distribution of books on a bookcase based on whether they are nonfiction or fiction and hardcover or paperback.

  1. Find the probability of drawing a hardcover book first then a paperback fiction book second when drawing without replacement.
28/95 * 59/94
## [1] 0.1849944
  1. Determine the probability of drawing a fiction book first and then a hardcover book second, when drawing without replacement.
13/95 * 27/94 + 59/95 * 28/94 
## [1] 0.2243001
  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.
72/95 * 28/95
## [1] 0.2233795
  1. The final answers to parts (b) and (c) are very similar. Explain why this is the case.

The numbers of the books are too high, so replacement of the drawn book wouldn’t make a significant difference.


2.38 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.
ave_rev = 0
pas <- c(.54, .34, .12)
fee <- c(0, 25, 60)
for(i in 1:length(pas)){
  x <- pas[i] * fee[i]
  ave_rev <- ave_rev + x
}
result <- c("Average Revenue" = ave_rev)
result
## Average Revenue 
##            15.7
z <- 0
for(i in 1:length(pas)){
  x <- (ave_rev - fee[i])^2*pas[i]
  z = x + z
}
result <- c("Variance" = z, "St_dev" = z^.5)
result
##  Variance    St_dev 
## 398.01000  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.
Revenue120 <- 120 * ave_rev
st_dev_120 <- sqrt(120*z^2) # z is the variance for average revenue per passanger

result <- c("Expected Revenue from 120 Passangers" = Revenue120, 
            "St. Dev of Rev. for 120" = st_dev_120 <- sqrt(120*z))
result
## Expected Revenue from 120 Passangers              St. Dev of Rev. for 120 
##                            1884.0000                             218.5434

Assumption: The revenue generated from each passanger are independent of the revenue generated from other passangers, which is pretty reasonable since the number of luggages they check in does not depend on other passangers’ luggages.


2.44 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.69

  1. Describe the distribution of total personal income.

Unimodal, centered around $35,000 - $45,000, skewed to the right

  1. What is the probability that a randomly chosen US resident makes less than $50,000 per year?
less_than_fifty <- 1-(13.9+5.8+8.4+9.7)/100
less_than_fifty
## [1] 0.622
  1. 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.
less_than_fifty*.41
## [1] 0.25502

Assumption: Gender and income are not associated

  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.

Assumption made in (c) is not valid according to the figures below:

P_Fem <- .41
P_Fem * less_than_fifty == .718 # inequality with big difference
## [1] FALSE
P_Fem * less_than_fifty - .718
## [1] -0.46298