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

## [1] "p(1) = 0. Cannot be a total of less than 1"
## [1] "p(5) = [1+4, 2+3, 3+2, 4+1] => 4/36 =  0.1111"
## [1] "p(12) = [6+6] => 1/36 =  0.0278"

2.8 Poverty and Language:

  1. Are living below the poverty line and speaking a foreign language at home disjoint?
    • No there are persons who both below the poverty line and speaks foreign language.
  2. Draw a Venn diagram summarizing the variables and their associated probabilities.
library(VennDiagram)

grid.newpage()
draw.pairwise.venn(area1 = 0.146, area2 = 0.207, cross.area = 0.042, category = c("Below Poverty Line", 
    "Foreign Language"))

## (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?
    • 0.104
  2. What percent of Americans live below the poverty line or speak a foreign language at home?
    • \(P(BP or FL) = P(BP) + P(FL) - P(BP and FL)\)
(0.146 + 0.207) - 0.042
## [1] 0.311
  1. What percent of Americans live above the poverty line and only speak English at home?
1 - 0.104
## [1] 0.896
  1. Is the event that someone lives below the poverty line independent of the event that the person speaks a foreign language at home? \(P(BP) * P(FL)\)
0.142 * .042
## [1] 0.005964

No, because it is not the same as \(P(BP and FL)\) which is 4.2% so the events are dependent.

Assortive Mating.

  1. What is the probability that a randomly chosen male respondent or his partner has blue eyes?
114/204 + 108/204 - 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/114) 
## [1] 0.6842105
  1. What is the probability that a randomly chosen male respondent with brown eyes has a partner with blue eyes?
19 / 54
## [1] 0.3518519
  1. What about the probability of a randomly chosen male respondent with green eyes having a partner with blue eyes?
11 / 36
## [1] 0.3055556
  1. Does it appear that the eye colors of male respondents and their partners are independent? Explain your reasoning.
    • No. Notice in the table when both genders have the same eye characteristics, their chances are higher.

2.30 Books on a bookshelf

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.
## [1] "P(H) = 28 / 95"
## [1] 0.2947
## [1] "P(PF) = 59 / 94"
## [1] 0.6277
## [1] "0.2947 + 0.6277"
## [1] 0.185
  1. Determine the probability of drawing a fiction book first and then a hardcover book second, when drawing without replacement.
## [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.
## [1] 0.2233795
  1. The final answers to parts (b) and (c) are very similar. Explain why this is the case. The bigger the sample size, the smaller the difference it makes.

2.38 Baggage fees. 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.
i No baggage one bag Two Bags Total
\(x_i\) 0 25 60
\(P(X = x_i)\) 0.54 0.34 0.12
\(x_i * P(X = x)\) 0 8.5 7.2 15.7
\(x_i - \mu\) -15.7 9.3 44.3
\((x_i - \mu)^2\) 246.49 86.49 1962.49
\((x_i - \mu)^2 * P(X = x)\) 133.1046 29.4066 235.4988 398.01
#mean
AVGrev <- 15.7
AVGrev
## [1] 15.7
#variance
VAR <- 398.01

#Standard Deviation
sqrt(VAR)
## [1] 19.95019

The standard deviation is 19.95.
(b) About how much revenue should the airline expect for a flight of 120 passengers?

#Revenue airline should receive
 AVGrev * 120 
## [1] 1884
  1. With what standard deviation? Note any assumptions you make and if you think they are justi???ed.
#Standard Deviation
sqrt(VAR * 120)
## [1] 218.5434

2.44 Income and Gender

(a)Describe the distribution of total personal income.

incomecat<- c(0.022, 0.047, 0.158, 0.183, 0.212, 0.139, 0.058, 0.084, 0.097)
income <- c(9999, 14999, 24999, 34999, 49999, 64999, 74999, 99999, 100000)
incomedf <- data.frame(incomecat, income)
incomedf
##   incomecat income
## 1     0.022   9999
## 2     0.047  14999
## 3     0.158  24999
## 4     0.183  34999
## 5     0.212  49999
## 6     0.139  64999
## 7     0.058  74999
## 8     0.084  99999
## 9     0.097 100000
summary(income)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##    9999   24999   49999   52777   74999  100000

The distribution is skewed to the right.

  1. What is the probability that a randomly chosen US resident makes less than $50,000 per year?
0.022 + 0.047 + 0.158 + 0.183 + 0.212
## [1] 0.622

About 62.2 % makes less than $50,000 a year.

  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.
0.622 * 0.41
## [1] 0.25502

About 25.5% of females make less than $50,000.

  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.
    • This clearly shows income and gender are not independent because the previous assumption made was 62.2% which is not equal to this indication of 71.8%.