# Bryan Persaud

title: “Chapter 3 - Probability” author: ’’ output: html_document: df_print: paged pdf_document: extra_dependencies: - geometry - multicol - multirow —

Dice rolls. (3.6, p. 92) If you roll a pair of fair dice, what is the probability of

  1. getting a sum of 1?
  2. getting a sum of 5?
  3. getting a sum of 12?

Assume the dice used are a six faced cube numbered 1 to 6. Then the probability of getting a 1 is the same as getting any other number, 1/6.

(a) Since you are rolling a pair of fair dice the dice is numbered from 1 to 6 so it is not possible to get a sum of 1. Therefore the probability of getting a sum of 1 is 0 or 0%.

(b) The first roll can be a 1 and second roll can be a 4. First roll can also be a 2 and second roll can be a 3 and vice versa. First roll can be a 4 and second roll can be a 1. There are 4 possible outcomes of getting a sum of 5. Therefore the probability of getting a sum of 5 is 4 * (1/6 * 1/6) = 4 * (1/36) = 4/36 = 1/9 or 11.11%.

# (c) The only way of getting a sum of 12 is getting a 6 for the first roll and a 6 for the second roll. Therefore the probability of getting a sum of 12 is 1/6 * 1/6 = 1/36 or 27.78%.

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.

  1. Are living below the poverty line and speaking a foreign language at home disjoint?
  2. Draw a Venn diagram summarizing the variables and their associated probabilities.
  3. What percent of Americans live below the poverty line and only speak English at home?
  4. What percent of Americans live below the poverty line or speak a foreign language at home?
  5. What percent of Americans live above the poverty line and only speak English at home?
  6. Is the event that someone lives below the poverty line independent of the event that the person speaks a foreign language at home?

(a) Living below the poverty line and speaking a foreign language at home are not disjoint since an American can live below the poverty line and speak a foreign language at home at the same time.

(b)

library(VennDiagram)
## Loading required package: grid
## Loading required package: futile.logger
Below_Poverty_Line <- 14.6
Foreign_Language <- 20.7
Both <- 4.2
grid.newpage()
draw.pairwise.venn(Below_Poverty_Line, Foreign_Language, cross.area = Both, category = c("Below P L", "Speak a F L"))

## (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])

(c) According to the Venn diagram, the percentage of Americans that live below the poverty line and only speak english at home is 10.4%.

(d) According to the Venn diagram, the percentage of Americans that live below the poverty line or speak a foreign language at home is 16.5 + 10.4 + 4.2 = 26.9 + 4.2 = 31.1%.

(e) The percentage of Americans that live above the poverty line and only speak english at home is 100 - 31.1 = 68.9(The complement of Americans who live below the poverty line or speak a foreign language.)

# (f) The event that someone lives below the poverty line is not independent of the event that the person speaks a foreign language at home. The two events are dependent since the two events do not pass the multiplication rule for independent processess. 0.146(probability of below poverty line) * 0.207(probability of speaking a foreign language) = 0.0302 which doesn not equal 0.042(probability of both.)

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.

  1. What is the probability that a randomly chosen male respondent or his partner has blue eyes?
  2. What is the probability that a randomly chosen male respondent with blue eyes has a partner with blue eyes?
  3. Whatistheprobabilitythatarandomlychosenmalerespondentwithbrowneyeshasapartner with blue eyes? What about the probability of a randomly chosen male respondent with green eyes having a partner with blue eyes?
  4. Does it appear that the eye colors of male respondents and their partners are independent? Explain your reasoning.

(a) The probability that a randomly chosen male respondent or his partner has blue eyes is the probability of a male with blue eyes + the probability of his partner with blue eyes - the probability of both male and his partner with blue eyes. 114/204 + 108/204 - 78/204 = 222/204 - 78/204 = 144/204 = 0.7059 or 70.59%.

(b) The probability that a randomly chosen male repondent with blue eyes has a partner with blue eyes is 78/114 = 0.6842 or 68.42%.

(c) The probability that a randomly chosen male respondent with brown eyes has a partner with blue eyes is 19/54 = 0.3519 or 35.19%. The probability that a randomly chosen male repondent with green eyes has a partner with blue eyes is 11/36 = 0.3056 or 30.56%.

# (d) No, it does not appear that the eye colors of male respondents and their partners are independent. Both are dependent because based on the data most males with blue eyes have a partner that also has blue eyes. This shows that males with blue eyes are more interested in females with blue eyes.

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.

  1. Find the probability of drawing a hardcover book first then a paperback fiction book second when drawing without replacement.
  2. Determine the probability of drawing a fiction book first and then a hardcover book second, when drawing without replacement.
  3. 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.
  4. The final answers to parts (b) and (c) are very similar. Explain why this is the case.

(a) The probability of drawing a hardcover book first then a paperback fiction book second when drawing without replacement is the probability of drawing a hardcover book * the probability of drawing a paperback fiction book(with the total having one less book.) 28/95 * 59/94 = 0.2947 * 0.6277 = 0.1850 or 18.50%.

(b) The probability of drawing a fiction book first and then a hardcover book second when drawing without replacemet is the probability of drawing a fiction book * the probability of drawing a hardcover book(with the total having one less book.) 72/95 * 28/94 = 0.7579 * 0.2979 = 0.2258 or 22.58%.

(c) The probability of the scenario in part (b) except with the first book is placed back on the bookcase before randomly drawing a second book is the probability of drawing a fiction book * the probability of drawing a hardcover book. 72/95 * 28/95 = 0.7579 * 0.2947 = 0.2234 0r 22.34%.

# (d) The answers to parts (b) and (c) are very similiar because the total only changed by one book when drawing without replacement. This means that the denominator went from 95 to 94 and this small change isn’t enough to make a huge difference for either answers in parts (b) and (c).

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.

  1. Build a probability model, compute the average revenue per passenger, and compute the corresponding standard deviation.
  2. 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.

(a)

Num_Bags <- c(0, 1, 2)
Fees <- c(0, 25, 60)
Passengers_by_Num_Bags <- c(0.54, 0.34, 0.12)
Baggage_Fees <- data.frame(Num_Bags, Fees, Passengers_by_Num_Bags)
Baggage_Fees
##   Num_Bags Fees Passengers_by_Num_Bags
## 1        0    0                   0.54
## 2        1   25                   0.34
## 3        2   60                   0.12
Avg_Revenue <- sum(Fees * Passengers_by_Num_Bags)
print(paste("The average revenue is = ", Avg_Revenue))
## [1] "The average revenue is =  15.7"
Standard_Deviation <- sqrt((0 - Avg_Revenue)^ 2 * 0.54 + (25 - Avg_Revenue)^ 2 * 0.34 + (60 - Avg_Revenue)^ 2 * 0.12)
print(paste("The standard deviation is = ", round(Standard_Deviation, 2)))
## [1] "The standard deviation is =  19.95"

(b)

Assume that the average revenue above includes the passengers that have more than two bags.

passengers120_revenue <- 120 * Avg_Revenue
print(paste("The amount of revenue the airline should expect for a flight of 120 passengers is = $",passengers120_revenue))
## [1] "The amount of revenue the airline should expect for a flight of 120 passengers is = $ 1884"
passengers120_standard_deviation <- sqrt((0 - Avg_Revenue)^ 2 * 0.54 * 120 + (25 - Avg_Revenue)^ 2 * 0.34 * 120 + (60 - Avg_Revenue)^ 2 * 0.12 * 120)
print(paste("The standard devation the airline should expect for a flight of 120 passengers is = ", round(passengers120_standard_deviation, 2)))
## [1] "The standard devation the airline should expect for a flight of 120 passengers is =  218.54"

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.

  1. Describe the distribution of total personal income.
  2. What is the probability that a randomly chosen US resident makes less than $50,000 per year?
  3. 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.
  4. 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.

(a)

Income <- c("$1 to $9,999 or less", "$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")
Total <- c(0.022, 0.047, 0.158, 0.183, 0.212, 0.139, 0.058, 0.084, 0.097)
Personal_Income <- data.frame(Income, Total)
Personal_Income
##                 Income Total
## 1 $1 to $9,999 or less 0.022
## 2   $10,000 to $14,999 0.047
## 3   $15,000 to $24,999 0.158
## 4   $25,000 to $34,999 0.183
## 5   $35,000 to $49,999 0.212
## 6   $50,000 to $64,999 0.139
## 7   $65,000 to $74,999 0.058
## 8  $75,000 to $99,999  0.084
## 9     $100,000 or more 0.097
barplot(Personal_Income$Total, names.arg = Income, las = 2)

# I would say the distribution looks to be normal.

(b) The probability that a randomly chosen US resident makes less than $50,000 per year is the sum of the probabilities from “$1 to $9,999 or less” to “$35,000 to $49,000” from the Total column. 2.2 + 4.7 + 15.8 + 18.3 + 21.2 = 6.9 + 15.8 + 18.3 + 21.2 = 22.7 + 18.3 + 21.2 = 41 + 21.2 = 62.2%.

(c) Assume that the two variables income and gender are independent. The probability that a randomly chosen US resident makes less than $50,000 per year and is female is the answer we got from part (b), 62.2%, * 41% since we are told that 41% of the US resident in the data are female. 0.622 * 0.41 = 0.2550 or 25.50%.

(d) The value that 71.8% of females make less than $50,000 per year shows that the assumption I made in part (c) is not valid. Income and gender are dependent.