2.6 Dice rolls. If you roll a pair of fair dice, what is the probability of (a) getting a sum of 1? Answer: Since, there are two dice and minimum you can get on each dice is 1 whose total is 2 this question is not valid.

  1. getting a sum of 5? Answer: Chances of getting 5 in a two dice roll are (1,4), (2, 3), (3,2) and (4,1) Therefore, total chances are
total_chances <- 4
total_possible_outcomes <- 36
probability <- total_chances / total_possible_outcomes
probability
## [1] 0.1111111
  1. getting a sum of 12? Answer: Chances of getting 12 in a two dice roll is (6, 6) Therefore, total chances are
total_chances <- 1
total_possible_outcomes <- 36
probability <- total_chances / total_possible_outcomes
probability
## [1] 0.02777778

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 given statement above mentions that 4.2% fall into both categories: below poverty line and speak other language than English at home.

  2. Draw a Venn diagram summarizing the variables and their associated probabilities. Answer:

library(VennDiagram)
## Warning: package 'VennDiagram' was built under R version 3.5.1
## Loading required package: grid
## Loading required package: futile.logger
## Warning: package 'futile.logger' was built under R version 3.5.1
grid.newpage()
draw.pairwise.venn(14.6, 20.7, 4.2, category = c("Dog People", "Cat People"), lty = rep("blank", 
    2), fill = c("light blue", "pink"), scaled = FALSE)

## (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:
PL <- 14.6
PLOtherLanguage <- 4.2
Below_PLEnlgish <- PL - PLOtherLanguage
Below_PLEnlgish
## [1] 10.4
  1. What percent of Americans live below the poverty line or speak a foreign language at home? Answer:
PL <- 14.6
PLOtherthanEnglish <- 20.7
PLOtherLanguage <- 4.2
Below_PLEnlgish <- PL + PLOtherthanEnglish - PLOtherLanguage
Below_PLEnlgish
## [1] 31.1
  1. What percent of Americans live above the poverty line and only speak English at home? Answer:
PL <- 14.6
PLOtherthanEnglish <- 20.7
PLAbove <- 100 - PL
PLAboveOtherthanEnglish <- 100 - PLOtherthanEnglish
AmericanABovePLEnglish <- (PLAbove * PLAboveOtherthanEnglish)/100
AmericanABovePLEnglish
## [1] 67.7222
  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: There is no such relationship between the language and poverty level, these factors are all 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. Partner (female) Blue Brown Green Total Blue 78 23 13 114 Self (male) Brown 19 23 12 54 Green 11 9 16 36 Total 108 55 41 204

  1. What is the probability that a randomly chosen male respondent or his partner has blue eyes? Answer:
MBlue <- 114/204
FBlue <- 108/204
MFBlue <- 78/204

OnlyMBlue <- (MBlue + FBlue - MFBlue)*100
OnlyMBlue
## [1] 70.58824
  1. What is the probability that a randomly chosen male respondent with blue eyes has a partner with blue eyes? Answer:
MFBlue <- 78/204
MFprobability <- MFBlue*100
MFprobability
## [1] 38.23529
  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: Probabilty of randomly chosen male respondent with brown eyes has a partner with blue eyes is
(19/204)*100
## [1] 9.313725

Probabilty of randomly chosen male respondent with green eyes has a partner with blue eyes is

(11/204)*100
## [1] 5.392157
  1. Does it appear that the eye colors of male respondents and their partners are independent? Explain your reasoning. Answer: Yes, the eye color of every human beings are different than other. These are not created in a pattern with a sample and mass production. There are all independent.

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. Format Hardcover Paperback Total Type Fiction 13 59 72 Nonfiction 15 8 23 Total 28 67 95

  1. Find the probability of drawing a hardcover book first then a paperback fiction book second Answer:
PHF <- 28/95
PPF <- 59/94
ProbabilityHPFiction <- (PHF * PPF)*100
ProbabilityHPFiction
## [1] 18.49944
  1. Determine the probability of drawing a fiction book first and then a hardcover book second, when drawing without replacement. Answer:
PFBook <- 72/95
PHBook <- 28/94
ProbabilityFBookHardBook <- (PFBook * PHBook)*100
ProbabilityFBookHardBook
## [1] 22.57559
  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:
PFBook <- 72/95
PHBook <- 28/95
ProbabilityFBookHardBook <- (PFBook * PHBook)*100
ProbabilityFBookHardBook
## [1] 22.33795
  1. The final answers to parts (b) and (c) are very similar. Explain why this is the case. Answer: Since, the book was put back the sample is bigger. And there is a differene of 1 book in 95 books. If the samples are larger, the difference is smaller. Thats why there is not much difference in the probability of (b) and (c).

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: Here,
num_of_bags <- c('no bags', 'one bags', 'two bags')
baggage_fee <- c(0,25,35)
passengers <- c(0.54, 0.34, 0.12)
df <- data.frame(num_of_bags, passengers, baggage_fee)
avg_revenue <- (sum((df$passengers * df$baggage_fee))/sum(df$passengers))
avg_revenue
## [1] 12.7

Standard Deviation

sqrt(0.54*(0-avg_revenue)^2 + 0.34*(25-avg_revenue)^2 + 0.12*(35-avg_revenue)^2)
## [1] 14.07871
  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. Answer: We have passengers = 120
no_bags <- (54/100)*120
one_bag <- (34/100)*120
two_bag <- (12/100)*120

avg_revenue_120 <- (round(no_bags*0) + one_bag*25 + (two_bag*25 + two_bag*35))
avg_revenue_120
## [1] 1884

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.

income_range <- c("1 to $9999 or loss", "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(.022, .047, 0.158, 0.183, 0.212, 0.139, 0.058, 0.084, 0.097)
df <- data.frame (income_range, total)
df
##         income_range total
## 1 1 to $9999 or loss 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
  1. Describe the distribution of total personal income.
barplot(total)

  1. What is the probability that a randomly chosen US resident makes less than $50,000 per year? Answer: Income less than $50,000 is
random_citizen <- sum(total[0:5])*100
random_citizen
## [1] 62.2
  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: Since, 41% of the total population are female
random_citizen <- sum(total[0:5])*100
random_citizen_female <- random_citizen*0.41
random_citizen_female
## [1] 25.502
  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: There is no possiblity that 71.8% of females makes less than $50,000 per year. The total percentage who makes less than $50k is 62.2%. The question has not given required information on behalf of which we can generate further information.