Question 2.6

a.) Probability of 0.

b.) Four combinations of achieving a sum of 5 are possible; you can get a pair of (4,1),(2,3),(1,4),(3,2). Each independent pair has a probability of 1/36th. The probability of achieving a sum of 5 is thus 1/9.

c.) The only combination that exists for a sum of 12 is (6,6). The probability of attaining this is 1/36th.

Question 2.8

a.) Living below the poverty line and speaking a foreign language at home are not disjoint events because 4.2% of the population falls into both categories. Disjoint occurrences assume that each event is mutually exclusive of the other.

b.)

## Loading required package: grid
## Loading required package: futile.logger

c.) The Americans that live below the poverty line and only speak English at home are 10.4% of the population.

print(14.6-4.2)
## [1] 10.4

d.) The percentage of Americans that live below the poverty line or speak a foreign language at home is 31.1.

print(14.6+20.7-4.2)
## [1] 31.1

e.) The percentage of Americans that live above the poverty line and only speak English at home is 68.9.

print(100-20.7-10.4)
## [1] 68.9

f.) The event of living below the poverty line is not independent of the event that a person speaks a foreign language at home. The relationship is such that language contributes to the probability of poverty as shown by the results of answers e and c.

Question 2.20

a.) The probability is 0.7058824.

print((108+114-78)/204)
## [1] 0.7058824

b.) The probability is 0.6842105.

print(78/114)
## [1] 0.6842105

c.) The probability of a male partner with brown eyes having a partner with blue eyes is 0.3518519. The probability of a male partner with green eyes having a partner with blue eyes is 0.3055556.

brown = (19/54)
print(brown)
## [1] 0.3518519
green = (11/36)
print(green)
## [1] 0.3055556

d.) It does appears that the eye colors of male respondents and their partners are not independent. The highest probabilities in the table are associated with partners that have matching eye colors; mismatched eye colors have a lower probability.

Question 2.30

a.) The probability of drawing a hardcover book then a paperback book with no replacement is 0.1849944.

hardcover = 28/95
paperback_noreplacement = 59/94

print(hardcover*paperback_noreplacement)
## [1] 0.1849944

b.) The probability of drawing a fiction book then a hardcover book with no replacement assuming that the fiction book is also a hardcover is 0.2176932. Assuming the opposite where the fiction book was a paperback the probability is 0.2257559.

##scenario one fiction was also a hardcover book

fiction = 72/95
hardcover_noreplacement = 27/94

print(fiction*hardcover_noreplacement)
## [1] 0.2176932
##scenario two fiction was a paperback book

fictiontwo = 72/95
hardcover_noreplacementtwo = 28/94

print(fictiontwo*hardcover_noreplacementtwo)
## [1] 0.2257559

c.) The probability with replacement is 0.2233795.

fiction = 72/95
hardcover_replacement = 28/95

print(fiction*hardcover_replacement)
## [1] 0.2233795

d.) They are similar due to how small the sample size is; there will not be much deviation as observations for small sample sizes are nearly independent of each other even when sampling without replacement. The sample size is 2 as there are only two books being drawn in a population of 95.

Question 2.38

numberbags = c(0,1,2)
costbags = c(0,25,60)
probabilites = c(.54,.34,.12)

probmodel = data.frame(numberbags,costbags,probabilites)

probmodel$epvalue = probmodel$costbags*probmodel$probabilites

totalep = sum(probmodel$epvalue)

print(totalep)
## [1] 15.7
probmodel$diff = probmodel$costbags - totalep

probmodel$var = ((probmodel$diff)^2) * probmodel$probabilites

probvariance = sum(probmodel$var)

probstd = sqrt(probvariance)

print(paste0("Expected Value: ",totalep," Variance: ",probvariance,"
             Standard Deviation: ",probstd))
## [1] "Expected Value: 15.7 Variance: 398.01\n             Standard Deviation: 19.9501879690393"
revenue = 120*totalep

standarddeviation = probstd

## The airlines should expect a total revenue of 1884 for 120 passengers 
## with a standard deviation of 19.9501879690393 per person

Question 2.44

a.) The distribution is right skewed. b.) 62.2% probability of having a resident that makes less than 50K a year

prs = 2.2+4.7+15.8+18.3+21.2

c.) 25.502% chance of have a female resident that makes less than 50K a year. (Note: Assuming equal weighting)

female_and_fiftyk = (prs*41)/100

d.) My assumption is not valid as the fact that 71.8% of females makes less than 50K a year shows that you cannot attribute equal weighting to the sample. Equal weighting skews the reality of the data set; additional considerations need to be taken into account to determine a more accurate calculation.