2.6 If you roll a pair of fair dice, what is the probability of
getting a sum of 1? 0
getting a sum of 5?
4/36
## [1] 0.1111111
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
No, there are people who are both under the poverty line and speaking foreign language
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])
What percent of Americans live below the poverty line and only speak English at home? 10.4
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
100-31.1
## [1] 68.9
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.
(108+114-78)/204
## [1] 0.7058824
78/108
## [1] 0.7222222
19/54
## [1] 0.3518519
11/36
## [1] 0.3055556
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.
28/95 * 59/94
## [1] 0.1849944
13/95 * 27/94 + 59/95 * 28/94
## [1] 0.2243001
72/95 * 28/95
## [1] 0.2233795
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.
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
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
Unimodal, centered around $35,000 - $45,000, skewed to the right
less_than_fifty <- 1-(13.9+5.8+8.4+9.7)/100
less_than_fifty
## [1] 0.622
less_than_fifty*.41
## [1] 0.25502
Assumption: Gender and income are not associated
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