Dice rolls. (3.6, p. 92) If you roll a pair of fair dice, what is the probability of
P(Getting a sum of 1) = 0 ; The minimum sum you can get when a pair of fair dice is tossed is 2.
P(Getting a sum of 5) = 4/36 = 1/9
P(Getting a sum of 12) = 1/36
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.
No. Living below poverty line and speaking a foreign language at home are not disjoint because both can occur at the same time. In this survey, they both occured at the same time in 4.2% of the cases.
Below poverty line = P(B) = 0.146 Speak foreign language = P(F) = 0.207 Below poverty line and speak foreign language = P(B n F) = 0.042
Venn diagram
library(VennDiagram)
below_poverty_line <- 0.146
foreign_language <- 0.207
both <- 0.042
grid.newpage()
Venn <- draw.pairwise.venn(area1 = below_poverty_line, area2 = foreign_language, cross.area = both, category = c("Poverty", "Foreign"))
Percent of Americans that live below poverty line and only speak English at home
P(B) = Probability of living below poverty line = 0.146
P(F) = Probability of speaking a foreign language other than English = 0.207
P(Fc) = Probability of speaking only English = 1 - P(F) = 1 - 0.207 = 0.793
P(Below poverty line and speak only English) = P(B and Fc)
= P(B) x P(Fcc) = 0.146 x 0.793 = 0.1158
This means that about 11.58% of Americans live below poverty and speak only English
Percent of Americans that live below poverty or speak a foreign language
P(B or F) = P(B) + P(F) - P(B n F) = 0.146 + 0.207 - 0.042 = 0.311
Percent of Americans that live above poverty or only speak English
P(B or F)c = 1 - P(B or F) = 1 - 0.311 = 0.689
This means that about 68.9% Americans live above poverty or only speak English.
Yes it is independent because living below the povert line provides no useful information about whether the person speaks a foreign language.
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.
P(Self=Blue or Partner=Blue) = P(Self=Blue) + P(Partner=Blue) - P(Self=Blue and Partner=Blue)
P(Self=Blue or Partner=Blue) = (114/204) + (108/204) - (78/204) = (144/204) = 0.7059
P(Self=Blue|Partner=Blue) = (78/114) = 0.6842
P(Self=Green|Partner=Blue) = (11/56) = 0.3056
The probability that a male respondent with blue eyes has a partner with blue eyes is much higher compared to when the male respondent has a Brown or Green eyes. Hence, it seems that the eye colors of male respondents and their partners are dependent.
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.
P(Hard cover book then paperback fiction without replacement) = (28/95) x (59/94) = 0.1850
P(Fiction book then hard cover book without replacement) = (72/95) x (27/94) = 0.2117
P(Fiction book then hard cover book with replacement) = (72/95) x (28/95) = 0.2234
They are similar because of the difference in number of cases affected is small relative to the total. In this case, it is (1/95) difference with or without replacement. Hence, this doesn’t change the probability that much whether it is with replacement or without.
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.
Build a probability model
scenario <- c("No baggage", "One Piece", "Two pieces")
values_x <- c(0, 25, 60)
probability_P <- c(0.54, 0.34, 0.12)
xP <- values_x * probability_P
prob_model <- rbind(values_x, probability_P, xP)
prob_model <- as.data.frame(prob_model)
colnames(prob_model) <-scenario
prob_model
## No baggage One Piece Two pieces
## values_x 0.00 25.00 60.00
## probability_P 0.54 0.34 0.12
## xP 0.00 8.50 7.20
Expected Value = Sum(xP)
Standard deviation = sqrt(Var)
E = sum(xP)
paste0("The expected value is ", E)
## [1] "The expected value is 15.7"
Var = sum(((values_x - E)^2 * probability_P))
Sd = round(sqrt(Var), 2)
paste0("The standard deviation is ", Sd)
## [1] "The standard deviation is 19.95"
Expected revenue for 120 passengers:
ER = E * 120
paste0("The expected revenue for 120 passengers is about $", ER)
## [1] "The expected revenue for 120 passengers is about $1884"
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.
The distribution is a continous distribution that appears almost symmetric.
P(US resident makes less than $50,000 per year)
less_than_50 <- (2.2 + 4.7 + 15.8 + 18.3 + 21.2)/100
paste0("The probability that a US resident makes less than $50,000 per year is ", less_than_50)
## [1] "The probability that a US resident makes less than $50,000 per year is 0.622"
P(US resident makes less than $50,000 per year and is female)
less_than_50_and_female <- round(less_than_50 * 0.41, 4)
paste0("The probability that a US resident makes less than $50,000 per year and is female is ", less_than_50_and_female)
## [1] "The probability that a US resident makes less than $50,000 per year and is female is 0.255"
The same study indicates that 71.8% of females make less than $50,000.
The sample comprises 41% females. This invariably means that 71.8% of those 41% females (0.718 x 0.41 = 0.294) will make less than $50,000. This means that a randomly chosen female US resident will earn less than $50,000 in 29.4% of the cases according to these numbers from the study. This means that my assumption of independence between the two is not valid and that being a female and earning less than 50,000 are indeed dependent.