Dice rolls. (3.6, p. 92) If you roll a pair of fair dice, what is the probability of
Probability to get a sum of 1 is 0.
possible combination (1,4) (4,1) (2,3) (3,2). P(getting a sum of 5)=4/36 or 0.111
possible combination (6,6). P(getting a sum of 12)=1/36 or 0.028
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, they are not disjoint as 4.2% fall into both categories.
library(VennDiagram)
## Loading required package: grid
## Loading required package: futile.logger
ameri_bpl = 14.6
ameri_sfl = 20.7
ameri_both = 4.2
draw.pairwise.venn(ameri_bpl, ameri_sfl, cross.area = ameri_both, category = c("Below PL", "Speaks FL"), fill = c('green', 'red'))
## (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])
Seeing venn diagram, 10.4% of Americans live below the poverty line and only speak English at home.
Seeing venn diagram, 31.1% (14.6+20.7-4.2) of Americans live below the poverty line or speak a foreign language at home.
ameri_apl = 100 - ameri_bpl
ameri_se = ameri_sfl - ameri_both
ans = ameri_apl - ameri_se
ans
## [1] 68.9
68.9% of Americans live above the poverty line and only speak English at home.
No, it’s not independent. It’s clear, corresponding venn diagram crosses.
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.
# probability that a randomly chosen male respondent or his partner has blue eyes
(114 + 19 + 11) / 204
## [1] 0.7058824
# probability that a randomly chosen male respondent with blue eyes has a partner with blue eyes
78 / 114
## [1] 0.6842105
# probability that a randomly chosen male respondent with brown eyes has a partner with blue eyes
19 / 54
## [1] 0.3518519
What about the probability of a randomly chosen male respondent with green eyes having a partner with blue eyes?
# probability that a randomly chosen male respondent with green eyes having a partner with blue eyes
11 / 36
## [1] 0.3055556
No, they are dependent. The table above shows, male prefers female partner of same eye color then any other colors i.e. the probability of partner’s eye color being same as their own is always higher than any other color.
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.
# probability of drawing a hardcover book first then a paperback fiction book second when drawing without replacement
28/95 * 59/94
## [1] 0.1849944
# if the first book drawn was a hardcover fiction book
72/95 * 27/94
## [1] 0.2176932
# if the first book drawn was a paperback fiction book
72/95 * 28/94
## [1] 0.2257559
# probability of b given first book is placed back
72/95 * 28/95
## [1] 0.2233795
They are similar since the item replaced/not replaced is only making a difference of 1/95.
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.
bag_fee <- c(0,25,35)
bag_prcnt <- c(0.54, 0.34, 0.12)
rev_per_passenger <- sum(bag_fee*bag_prcnt)
rev_per_passenger
## [1] 12.7
var_model <- sum((bag_fee-rev_per_passenger)^2*bag_prcnt)
var_model
## [1] 198.21
sd_model <- sqrt(var_model)
sd_model
## [1] 14.07871
rev_120 <- rev_per_passenger*120
rev_120
## [1] 1524
sd_model_120 <- sqrt(var_model*120)
sd_model_120
## [1] 154.2245
Expected revenue for 120 passengers is 1524 and standard deviation is 154.2245.
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.
income_limit <- c("<$10K",
"$10K-14999",
"$15K-24999",
"$25K-34999",
"$35K-49999",
"$50K-64999",
"$65K-74999",
"$75K-99999",
">$100K")
income <- c(10000, 15000, 25000, 35000, 50000, 65000, 75000, 99000, 100000)
total_prcnt <- c(2.2, 4.7, 15.8, 18.3, 21.2, 13.9, 5.8, 8.4, 9.7)
barplot(total_prcnt, col = 'red')
barplot(total_prcnt, income, col = 'blue')
Distribution is bimodal and slightly right skewed.
prob_50K <- sum(total_prcnt[1:5])/100
prob_50K
## [1] 0.622
Given sample has 41% females. Assuming the income distribution is same for male and females.
prob_50K_female <- 0.622 * 0.41
prob_50K_female
## [1] 0.25502
If 71.8% of females make less than $50K then assumption made in (c) is NOT valid.