2.6 Dice rolls. If you roll a pair of fair dice, what is the probability of (a) getting a sum of 1? 0/36 (b) getting a sum of 5? 4/36 (c) getting a sum of 12? 1/36
2.8 Poverty and language.
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
Are living below the poverty line and speaking a foreign language at home disjoint? No
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("Below Poverty",
"ForeignL"))
## (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])
povLine <- 0.146
ForL <- 0.207
bothcat <- 0.042
povLine - bothcat
## [1] 0.104
povLine + ForL - bothcat
## [1] 0.311
1-(povLine + ForL - bothcat)
## [1] 0.689
povLine * ForL
## [1] 0.030222
2.20 Assortative mating. 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.
P(MaleBlue or FemaleBlue) = P(MaleBlue) + P(FemaleBlue) - P(MaleBlue and FemaleBlue)
P(MaleBlue or FemaleBlue) = 108/204 + 114/204 - 78/204
P(MaleBlue or FemaleBlue) = 0.7059
78/114
## [1] 0.6842105
19/54
## [1] 0.3518519
11/36
## [1] 0.3055556
#blue
78/204
## [1] 0.3823529
114/204 * 108/204
## [1] 0.2958478
#0.38 != 0.29
23/204
## [1] 0.1127451
#green
11/204
## [1] 0.05392157
36/304 * 41/204
## [1] 0.02380031
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
P(hardcoverBook)= P(hardCover) * P(paperbackFiction)
round(28/95 *59/94 , 3)
## [1] 0.185
round(72/95 * 28/94, 3)
## [1] 0.226
round(72/95 * 28/95, 3)
## [1] 0.223
Since there are many books 94 & 95, a one book difference will not change the probability as much as if there were a lot less books.
2.38 Baggage fees. An airline charges the following baggage fees: $25 for the ???rst 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.
luggage_a <- 0
luggage_b <- 25
luggage_c <- 25+35
fee <- c(luggage_a, luggage_b, luggage_c)
percent <- c(0.54, 0.34, 0.12)
lugRev <- fee * percent
x <- sum(lugRev)
bagg_sd <- sqrt((luggage_a - x)^2 * (percent[1]) + (luggage_b - x)^2 *
(percent[2]) + (luggage_c - x)^2 * (percent[3]))
cat("The x is:", x, "\n")
## The x is: 15.7
cat("The SD is:", bagg_sd)
## The SD is: 19.95019
pass <- 120
rev_pass <- pass * x
# sqrt((x1 - u)^2 * P(X = x1) * population + .... + (xk - u)^2 * P(X = xk) * population)
pass_sd <- round(sqrt((((luggage_a - x)^2) * (percent[1]) * pass) + ((luggage_b - x)^2 *
(percent[2]) *pass) + ((luggage_c - x)^2 * (percent[3]) * pass)),2)
cat("The rev is:", rev_pass, "\n")
## The rev is: 1884
2.44 Income and gender. 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
The distribution of total personal income is skewed to the right. The distribution is skewed probably because there is less people with hign salaries.
less <- 2.2 + 4.7 + 15.8 + 18.3 + 21.2
less
## [1] 62.2
females <- 0.41
femaleLess <- less * females
femaleLess
## [1] 25.502
less
## [1] 62.2
femaleLess
## [1] 25.502
For this example, income and gender are dependent. The percentage of females which made less than 50k a year (71.8%) does not equal the percentage of all people who made less than 50K a year (62.2%)