Grando-2 Homework

2.6 Dice rolls.

If you roll a pair of fair dice, what is the probability of

  1. getting a sum of 1?

Answer: 0%. The smallest possible sum is two.

  1. getting a sum of 5?

Answer: There are 36 total possible outcomes in the sample space for the sum of two dice being rolled. For a sum of 5, there are four possible combinations (1+4, 2+3, 3+2, 4+1). Therefore, the probability is 4/36 = 11%.

  1. getting a sum of 12?

Answer: There is only one possible outcome (6+6); therefore, the probability is 1/36 = 3%

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.

  1. Are living below the poverty line and speaking a foreign language at home disjoint?

Answer: No, because both could occur for the same American.

  1. Draw a Venn diagram summarizing the variables and their associated probabilities.

Answer:

require(VennDiagram)
## Loading required package: VennDiagram
## Loading required package: grid
## Loading required package: futile.logger
draw.pairwise.venn(area1 = 14.6, area2 = 20.7, cross.area = 4.2, 
    category = c("Living below poverty line", "Speak a language other than English (foreign language) at home"), 
    cat.pos = c(0, 0))

## (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])
  1. What percent of Americans live below the poverty line and only speak English at home?

Answer: 10.4%

  1. What percent of Americans live below the poverty line or speak a foreign language at home?

Answer: Using the General Addition rule, the number of people who are below the poverty line and speak a language other than English (foreign language) at home is: 14.6% + 20.7% - 4.2% = 31.1%.

  1. What percent of Americans live above the poverty line and only speak English at home?

Answer: This would be the probability of the opposite (complement) situation in (d). Therefore, the percent is 1 - 31.1% = 68.9%. We can check by doing it in parts.

Probability of people above the poverty line = 1 - 14.6% = 85.4% Probabiliity of people only speaking English = 1 - 20.7% = 79.3% Probability of people in neither category = 1 - 4.2% = 95.8%

85.4% + 79.3% - 95.8% = 68.9%

  1. Is the event that someone lives below the poverty line independent of the event that the person speaks a foreign language at home?

Answer:

If the P(A) * P(B) = P(A and B) then A and B would be independent.

Probability of person being below the poverty line - 14.6%

Probability of foreign language being spoken at home - 20.7%

P(Poverty line) * P(forein language) = 14.6% * 20.7 = 3.02%

Since this value is not equal to 4.2%, then it is shown that these two variables are not independent.

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.

  1. What is the probability that a randomly chosen male respondent or his partner has blue eyes?

Answer:

\[P\left( Blue\_ eyes|Male \right) \quad = \quad \frac { 114 }{ 204 } \\ P\left( Blue\_ eyes|Female \right) \quad =\quad \frac { 108 }{ 204 } \\ P\left( Blue\_ eyes|Male\quad and\quad Blue\_ eyes|Female \right) \quad \quad =\quad \frac { 78 }{ 204 } \\ \frac { 114 }{ 204 } +\frac { 108 }{ 204 } -\frac { 78 }{ 204 } =\frac { 144 }{ 204 } = 0.706\]

  1. What is the probability that a randomly chosen male respondent with blue eyes has a partner with blue eyes?

Answer:

\[P\left( Blue\_ eye\_ Female|Blue\_ eye\_ Male \right) =\frac { P\left( Blue\_ eye\_ male\_ and\_ Female \right) }{ P\left( Blue\_ eye\_ Male \right) } =\frac { 78 }{ 114 } =0.684\]

  1. What is the probability that a randomly chosen male respondent with brown eyes has a partner with blue eyes? What about the probability of a randomly chosen male respondent with green eyes having a partner with blue eyes?

Answer:

\[P\left( Blue\_ eye\_ Female|Brown\_ eye\_ Male \right) =\frac { P\left( Blue\_ eye\_ Female\_ and\_ Brown\_ eye\_ Male \right) }{ P\left( Brown\_ eye\_ Male \right) } =\frac { 19 }{ 54 } =0.352\]

\[P\left( Blue\_ eye\_ Female|Green\_ eye\_ Male \right) =\frac { P\left( Blue\_ eye\_ Female\_ and\_ Green\_ eye\_ Male \right) }{ P\left( Green\_ eye\_ Male \right) } =\frac { 11 }{ 36 } =0.306\]

  1. Does it appear that the eye colors of male respondents and their partners are independent? Explain your reasoning.

Using the last example, the eye colors of male respondents and their partners would be independent if

\[P\left( Blue\_ eye\_ Female|Green\_ eye\_ Male \right) =P\left( Blue\_ eye\_ Female \right)\]

However, that formula is not true

\[P\left( Blue\_ eye\_ Female|Green\_ eye\_ Male \right) \neq P\left( Blue\_ eye\_ Female \right) \\ \frac { 11 }{ 36 } \neq \quad \frac { 108 }{ 204 } \]

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.

  1. Find the probability of drawing a hardcover book first then a paperback fiction book second when drawing without replacement.

Answer:

Using without replacement, the number of books available would decrease from 95 to 94 on the second draw:

\[P\left( Hardcover \right) \quad =\quad \frac { 28 }{ 95 } \\ P\left( Fiction\quad and\quad Paperback \right) \quad =\quad \frac { 59 }{ 94 } \\ \frac { 28 }{ 95 } \ast \frac { 59 }{ 94 } =0.185\]

  1. Determine the probability of drawing a fiction book first and then a hardcover book second, when drawing without replacement.

Answer:

The probability of this happening could occur two ways. First, a paper back fiction book could be selected:

\[P\left( Paper Fiction \right) \quad =\quad \frac { 59 }{ 95 } \\P\left( Hardcover \right) \quad =\quad \frac { 28 }{ 94 } \\ \frac { 59 }{ 95 } \ast \frac { 28 }{ 94 } =0.183\]

Second, a hardback fiction could be selected which means there would be one less Hardcover in the set on the second pick:

\[P\left( Hardcover Fiction \right) \quad =\quad \frac { 13 }{ 95 } \\P\left( Hardcover \right) \quad =\quad \frac { 27 }{ 94 } \\ \frac { 13 }{ 95 } \ast \frac { 27 }{ 94 } =0.039\]

Therefore, the probabiliy would be the sum of the two events noted above:

\[ 0.183 + 0.039 = .222\]

  1. 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.

Answer:

\[P\left( Fiction \right) \quad =\quad \frac { 72 }{ 95 } \\P\left( Hardcover \right) \quad =\quad \frac { 28 }{ 95 } \\ \frac { 59 }{ 95 } \ast \frac { 28 }{ 95 } =0.223\]

  1. The final answers to parts (b) and (c) are very similar. Explain why this is the case.

Answer:

They are very similar because the marginal probabilities do not change much between the scenarios due to the sampling size being much smaller than the population. In this particular example, it is a change from 95 to 94 options, which is not very large (1/95 = 0.0105)

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.

  1. Build a probability model, compute the average revenue per passenger, and compute the corresponding standard deviation.

Answer:

Average revenue:

fees = c(0, 25, 60)
prob = c(0.54, 0.34, 0.12)
bag = c(0, 1, 2)
airline_fees <- data.frame(bag, fees, prob)
airline_fees$weighted <- airline_fees$fees * airline_fees$prob
revenue_per_passenger <- sum(airline_fees$weighted)
revenue_per_passenger
## [1] 15.7

Standard deviation:

airline_fees$var <- (airline_fees$fees - revenue_per_passenger)^2 * 
    airline_fees$prob
std_per_passenger <- sqrt(sum(airline_fees$var))
std_per_passenger
## [1] 19.95019
  1. About how much revenue should the airline expect for a flight of 120 passengers? With what standard deviation? Note any assumptions you make and if you think they are justified.

Expected revenue:

\[120*E\left( X \right) =120*15.7=1,884\]

Standard deviation:

\[\sqrt { 120*V\left( X \right) } =\sqrt { 120*{ 19.95 }^{ 2 } } =218.54\]

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.

  1. Describe the distribution of total personal income.

Answer:

Create the frequency table:

require(ggplot2)
## Loading required package: ggplot2
personal_income <- data.frame(c("1_9999", "10000_14999", "15000_24999", 
    "25000_34999", "35000_49999", "50000_64999", "65000_74999", 
    "75000_99999", "1000000+"), c(0.022, 0.047, 0.158, 0.183, 
    0.212, 0.139, 0.058, 0.084, 0.097))
names(personal_income) <- c("Income", "Total")
personal_income$Income <- factor(personal_income$Income, levels = c("1_9999", 
    "10000_14999", "15000_24999", "25000_34999", "35000_49999", 
    "50000_64999", "65000_74999", "75000_99999", "1000000+"))
ggplot(personal_income, aes(y = Total, x = Income)) + geom_bar(stat = "identity") + 
    theme(axis.text.x = element_text(angle = 90))

The data seems to have the highest frequency for the $35,000 to $49,999 range with a right skew. However, the distribution appears to be bimodal with a second smaller peak at the $100,000+ bin.

  1. What is the probability that a randomly chosen US resident makes less than $50,000 per year?

Answer:

The probability is the sum of the bins for all categories less than $50,000

0.022 + 0.047 + 0.158 + 0.183 + 0.212
## [1] 0.622
  1. 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.

Answer:

Here we are asked to compute the probability that a US resident makes less than $50,000 and is female:

\[P\left( <$50,000|Female \right) =P\left( <$50,000\quad and\quad Female \right) \quad /\quad P\left( Female \right)\]

\[P\left( <$50,000\quad and\quad Female \right) \quad =\quad P\left( <$50,000|Female \right) \quad \ast \quad P\left( Female \right)\]

If we assume that females and males have the same propoportion of earning less than $50,000 as the overall sample, we can assume:

\[P\left( <$50,000|Female \right) = P\left( <$50,000|Male \right) \quad =\quad 0.622\]

\[P\left( <$50,000\quad and\quad Female \right) \quad =\quad 0.622\quad *\quad 0.41\quad =\quad 0.255\]

  1. 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.

Answer:

\[P\left( <$50,000|Female \right) \quad =\quad P\left( <$50,000\quad and\quad Female \right) /P(Female)\] \[P\left( <$50,000\quad and\quad Female \right) =P\left( <$50,000|Female \right) \ast P(Female)\] \[P\left( <$50,000\quad and\quad Female \right) =0.718\ast 0.41=0.294\]

This value is pretty close to the result in (c); however, there is a difference. As long as the change in the ratio of women to men is small, the overall result will not vary by much. Given the overall change is ~4%, it appears the assumption in (c) is not valid.