####2.6 Dice rolls. If you roll a pair of fair dice, what is the probability of
Total probabilities - 6 X 6 -> 36
P(A) - Probability of Americans below poverty lines - 14.6% => .146 P(B) - Probability of American speaking foreign language - 20.7% => .207 P(A) and P(B) - Probability of Americans below poverty line and speaking foreign language - 4.2% - .042
Are living below the poverty line and speaking a foreign language at home disjoint?
Answer: No, because both these data can co exists.
Draw a Venn diagram summarizing the variables and their associated probabilities.
library(VennDiagram)
## Loading required package: grid
## Loading required package: futile.logger
draw.pairwise.venn(area1 = 0.146, area2 = 0.207, cross.area = 0.042, category = c("Below Poverty Line", "Speaking Foreign Language"), fill = c("green","blue"))
## (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?
Deducing from the above Venn diagram, the green only pie represents the above statement. Therefore, answer is .104 * 100 => 10.4%
What percent of Americans live below the poverty line or speak a foreign language at home?
P(A) or P(B) => P(A) + P(B) - P(A ^ B) => .146 + .207 - .042 = .311 * 100 => 31.1%
What percent of Americans live above the poverty line and only speak English at home?
P(Ac) and P(Bc) = 100 - (P(A) or P(B)) = 100 - answer d = 100 - 31.1% - 68.9%
Is the event that someone lives below the poverty line independent of the event that the person speaks a foreign language at home?
####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(A) = Probability of Male with blue eyes
P(B) = Probability of Female with blue eyes
P(C) = Probability of Male with brown eyes
P(G) = Probability of Male with green eyes
What is the probability that a randomly chosen male respondent or his partner has blue eyes?
P(A ^ B) = P(A) + P(B) - P(A^B) = 108/204 + 114/204 - 78/204 = .70588
What is the probability that a randomly chosen male respondent with blue eyes has a partner with blue eyes?
P(B|A) = P(B^A) / P(A) = 78 / 114 = .6842
What is the probability that a randomly chosen male respondent with brown eyes has a partner with blue eyes?
P(B|C) = P(B^C) / P(C) = 19/54 = .3518
c2: What about the probability of a randomly chosen male respondent with green eyes having a partner with blue eyes?
P(B|G) = P(B^G) / P(G) = 11/36 = .305
Does it appear that the eye colors of male respondents and their partners are independent? Explain your reasoning.
No, the eye color of male and their partners seem to be dependent based on the values given in the table. Number of partners with matching eye color is higher when compared to not matching.
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.
Find the probability of drawing a hardcover book first then a paperback fiction book second when drawing without replacement.
P(H).P(PF) = 28/95 * 59/94 = .1845
Determine the probability of drawing a fiction book first and then a hardcover book second, when drawing without replacement.
P(F).P(H) = 72/95 * 28/94 = .2257
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.
P(F).P(H) = 72/95 * 28/95 = .2233
The final answers to parts (b) and (c) are very similar. Explain why this is the case.
They are almost similar since sample quantity is relatively higher, reducing the effect of replacement factor.
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.
(a) Build a probability model, compute the average revenue per passenger, and compute the corresponding standard deviation.
passenger_luggages_prob <- c(.54, .34, .12)
prices_luggages <- c(0, 25, 25+35)
#compute the average revenue per passenger
avg_revenue <- sum(passenger_luggages_prob * prices_luggages)
variance <- (0 - avg_revenue)^2 * passenger_luggages_prob[1] + (25 - avg_revenue)^2 * passenger_luggages_prob[2] + (60 - avg_revenue)^2 * passenger_luggages_prob[3]
variance
## [1] 398.01
#compute the corresponding standard deviation
standard_dev <- sqrt(variance)
standard_dev
## [1] 19.95019
#Expected revenue for 120 passengers
revenue_120 <- avg_revenue * 120
revenue_120
## [1] 1884
#Standard deviation
variance_120 <- variance * 120
sqrt(variance_120)
## [1] 218.5434
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.
(a) Describe the distribution of total personal income.
**Below graph depicts a normal (symmetric) distribution with left skewed data
income_brackets <- c("$1 to $9,999", "$10,000 to $14,999", "$15,000 to $24,999", "$25,000 to $34,999", "$35,000 to $49,999", "$50,000 to $64,999", "$65,000 to $74,999", "$75,000 to $99,999", "$100,000 or more")
perc <- c(2.2, 4.7, 15.8, 18.3, 21.2, 13.9, 5.8, 8.4, 9.7)
barplot(perc, names.arg = income_brackets)
(b) What is the probability that a randomly chosen US resident makes less than $50,000 per year?
Sum of all probabilities for less than 50,000 => 2.2 + 4.7 + 15.8 + 18.3 + 21.2 = > 62.2/100 => .622
(c) 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.
Assuming income stats are independent of Male and Female. Probability of making less than 50K and probability of female => .622 * .41 => .25502
(d) 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 indicates that assumption made in c is not valid, since the probabilities vary indicating Female make less than Men.