1 Homework 2

1.1 Problem 1. Dice Rolls If you roll a pair of fair dice, what is the probability of..

  1. getting a sum of 1?
    Answer: p(1) = 0/(6*6) = 0
0/(6*6)
## [1] 0

Explanation: A dice has a minimum face value of 1 so two dice rolled can have atleast 1 each resuting in minimum sum of 2

  1. getting a sum of 5?
    Answer: p(5) = 4/(6*6) = 1/9 = 0.1111
4/(6*6)
## [1] 0.1111111

Explanation: (1,4) + (2,3) + (3,2) + (4,1) there are 4 combinations that can result in sum of 5 out of 36 possible combinations

  1. getting a sum of 12?
    Answer: p(12) = 1/6*6 = 1/36 = 0.0278
1/(6*6)
## [1] 0.02777778

Explanation: (6,6) there is only 1 that can result in sum of 12 out of 36 possible combinations

1.2 Problem 2. School absences

Data collected at elementary schools in DeKalb County, GA suggest that each year roughly 25% of students miss exactly one day of school, 15% miss exactly 2 days, and 28% miss exactly 3 or more days due to sickness.

  1. What is the probability that a student chosen at random doesn’t miss any days of school due to sickness this year?
    Answer: p(0) = 100% - 25% (1 day) - 15% (2 days) - 28% (>=3 days) = 32% (0 day) i.e., 32/100 = 0.32
1 - 0.25 - 0.15 - 0.28
## [1] 0.32
  1. What is the probability that a student chosen at random misses no more than one day?
    Answer: p(<=1) = p(0) + p(1) = 32% (0 day) + 25% (1 day) = 57% (<= 1 day) i.e., 57/100 = 0.57
0.32 + 0.25
## [1] 0.57
  1. What is the probability that a student chosen at random misses at least one day?
    Answer: p(>=1) = p(1) + p(2) +p(>=3) = 25% (1 day) + 15% (2 days) + 28% (>=3 days) = 68% (>= 1 day) i.e., 68/100 = 0.68
0.25 + 0.15 + 0.28
## [1] 0.68
  1. If a parent has two kids at a DeKalb County elementary school, what is the probability that neither kid will miss any school? Note any assumption you must make to answer this question.
    Answer: p(0) * p(0) = 0.32 * 0.32 = 0.1024 ~ 10.24% probability that neither kid will miss any day at school
0.32 * 0.32
## [1] 0.1024
  1. If a parent has two kids at a DeKalb County elementary school, what is the probability that both kids will miss some school, i.e. at least one day? Note any assumption you make.
    Answer: 0.68 * 0.68 = 0.4624 ~ 46.24% probability that both kid will miss atleast 1 day at school
0.68 * 0.68
## [1] 0.4624
  1. If you made an assumption in part (d) or (e), do you think it was reasonable? If you didn’t make any assumptions, double check your earlier answers.
    Answer: Assumption is each kid is being considered independent of other in choosing sick days. If they are going to school together as they are from same household, the probability of one missing school gets higher when the other is missing school as well - this is not accounted for in calculating the above probability for (d) and (e), as they were treated mutually exclusive/independent sets.

1.3 Problem 3. Health coverage, relative frequencies

The Behavioral Risk Factor Surveillance System (BRFSS) is an annual telephone survey designed to identify risk factors in the adult population and report emerging health trends. The following table displays the distribution of health status of respondents to this survey (excellent, very good, good, fair, poor) and whether or not they have health insurance.

mat=matrix(c(.023, 0.0364, 0.0427, 0.0192, 0.0050,0.2099, 0.3123 ,0.2410 ,0.0817,0.0289), byrow=TRUE, nrow=2)
colnames(mat)=c("Excellent", "Very Good","Good", "Fair","Poor")
rownames(mat)=c("No Coverage","Coverage")
mat
##             Excellent Very Good   Good   Fair   Poor
## No Coverage    0.0230    0.0364 0.0427 0.0192 0.0050
## Coverage       0.2099    0.3123 0.2410 0.0817 0.0289
  1. Are being in excellent health and having health coverage mutually exclusive?
    Answer: No
    Explanation: P(Excellent + Coverage) = 0.2099 ~ 0.21 - Since the intersection does not equal to zero, hence the two events (having excellent health and having health coverage) are not mutually exclusive.

  2. What is the probability that a randomly chosen individual has excellent health?
    Answer: P(Excellent) = P(Excellent + No Coverage) + P(Excellent + Coverage) = 0.0230 + 0.2099 = 0.2329

0.0230 + 0.2099
## [1] 0.2329
  1. What is the probability that a randomly chosen individual has excellent health given that he has health coverage?
    Answer: P(Excellent + Coverage) = 0.2099 / (0.2099 + 0.3123 + 0.2410 + 0.0817 + 0.0289) = 0.2099 / 0.8738 = 0.2402
0.2099 / (0.2099 + 0.3123 + 0.2410 + 0.0817 + 0.0289)
## [1] 0.2402152
  1. What is the probability that a randomly chosen individual has excellent health given that he doesn’t have health coverage?
    Answer: P(Excellent + No Coverage) = 0.0230 / (0.0230 + 0.0364 + 0.0427 + 0.0192 + 0.0050) = 0.0230 / 0.1262 = 0.18225
0.0230 / (0.0230 + 0.0364 + 0.0427 + 0.0192 + 0.0050)
## [1] 0.1821061
  1. Do having excellent health and having health coverage appear to be independent?
    Answer: No
    Explanation: P(Excellent + Coverage) = 0.2099 ~ 0.21 - Since the intersection does not equal to zero, hence the two events (having excellent health and having health coverage) are not mutually exclusive. If they were independent, the probability of having excellent health and having health coverage [P(Excellent ??? Coverage)] would be equal to the probability of having excellent health [P(Excellent)] times the probability of having health coverage [P(Coverage)]. The first [P(Excellent ??? Coverage)] quantity is 0.2099, and the second [P(Excellent) * P(Coverage)] quantity is 0.2329×0.8738=0.2035. Though these numbers are close, they are not equal, therefore the two events are not independent.

1.4 Problem 4. Exit Poll.

Edison Research gathered exit poll results from several sources for the Wisconsin recall election of Scott Walker. They found that 53% of the respondents voted in favor of Scott Walker. Additionally, they estimated that of those who did vote in favor for Scott Walker, 37% had a college degree, while 44% of those who voted against Scott Walker had a college degree. Suppose we randomly sampled a person who participated in the exit poll and found that he had a college degree. What is the probability that he voted in favor of Scott Walker?
Answer: P(for Scott Walker | College Degree) = P(for Scott Walker + College Degree) / P(College Degree) = P(for Scott Walker + College Degree) / P(for Scott Walker + College Degree) + P(against Scott Walker + College Degree) = (0.530.37)/(0.530.37 + 0.47*0.44) = 0.1961/(0.1961+0.2068)=0.1961/0.4029=0.4867

(0.53*0.37)/(0.53*0.37 + 0.47*0.44)
## [1] 0.4867213

Explanation: P(for Scott Walker) = (Votes for Scott Walker)/(Total votes) = 0.53,
P(for Scott Walker + College Degree) = (Votes for Scott Walker * College Degree ) / (Total Votes) = 0.530.37,
P(against Scott Walker + College Degree) = (Votes against Scott Walker + College Degree ) / (Votes for Scott Walker) = (1-0.53)
0.44=0.47*0.44

1.5 Problem 5. 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.

mymat2=matrix(c(13,59,15,8),nrow=2,byrow=TRUE)
colnames(mymat2)=c("hard","paper")
rownames(mymat2)=c("fiction","nonfiction")
mymat2
##            hard paper
## fiction      13    59
## nonfiction   15     8
  1. Find the probability of drawing a hardcover book first then a paperback fiction book second when drawing without replacement.
    Answer: P(hardcover) * P(paperback-1) = ((13+15)/(13+15+59+8)) * (59/((13+15)-1+59+8)) = (28/95)*(59/94) = 0.18499 ~ 0.1845
((13+15)/(13+15+59+8)) * (59/((13+15)-1+59+8))
## [1] 0.1849944

Explanation: Mutually independent/exclusive process

  1. Determine the probability of drawing a fiction book first and then a hardcover book second,when drawing without replacement.
    Answer: P(fiction) * P(hardcover) = P(hardcover/fiction)P(fiction) + (1-P(hardcover/fiction)) P(hardcover) = (59/72)((72/95)(28/94)) + (13/72)((72/95)(27/94)) = 0.2243
(59/72)*((72/95)*(28/94)) + (13/72)*((72/95)*(27/94))
## [1] 0.2243001

Explanation: Mutually dependent/inclusive process

  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(fiction) * P(hardcover) = ((13+59)/(13+59+15+8)) * ((13+15)/(13+59+15+8)) = 72/95 * 28/95 = 0.22337 ~ 0.2234
((13+59)/(13+59+15+8)) * ((13+15)/(13+59+15+8))
## [1] 0.2233795

Explanation: Mutually independent/exclusive process

  1. The final answers to parts (b) and (c) are very similar. Explain why this is the case.
    Answer:Given the fact that dividing by 95 will result in a smaller number than dividing by 94, scenario (c) will have a smaller probability than scenario (b). However in scenerio (b) we have to factor in the slighty lower probablity event that the first book was both hardcover and fiction. When taking this into account it reduces the overall probabilty of (b) and by coincidence makes it similar to (c).

1.6 Problem 6. Is it worth it?

Andy is always looking for ways to make money fast. Lately, he has been trying to make money by gambling. Here is the game he is considering playing: The game costs 2 dollars to play. He draws a card from a deck. If he gets a number card (2-10), he wins nothing. For any face card (jack, queen or king), he wins 3 dollars. For any ace, he wins 5 dollars and he wins an extra $20 if he draws the ace of clubs.
(a) Create a probability model and find Andy’s expected profit per game.
Answer: 52 deck of cards have 13 of each suit = Clubs (???), Diamonds (???), Hearts (???) and Spades (???)
13 of each suit comprises of = Ace, 2-10 Number Cards, Jack, Queen, King
P($0) = 49 / 413 (Due to 9 number cards) => Profit = $0 - $2 = -$2 (Loss)
P($3) = 43 / 413 (Due to 3 different Face cards = Jack, Queen, King) => Profit = $3 - $2 = $1 (Profit)
P($5) = 3 / 52 (Due to 1 Ace card in 3 suits excluding Clubs) => Profit = $5 - $2 = $3 (Profit)
P($20) = 1 / 52 (Due to 1 Ace card with suit Club) => Profit = $5 + $20 - $2 = $23 (Profit)

((9/13)*-2)+((3/13)*1)+((3/52)*3)+((1/52)*23)
## [1] -0.5384615

Expected Profit = (P($0)-2)+(P($3)2)+P($5)+(P($20)18) = ((9/13)-$2)+((3/13)$1)+((3/52)$3)+((1/52)*\(23)=\)-0.54

  1. Would you recommend this game to Andy as a good way to make money? Explain.
    Answer: No since probability of Andy losing money is higher

1.7 Problem 7. Scooping ice cream.

Ice cream usually comes in 1.5 quart boxes (48 fluid ounces), and ice cream scoops hold about 2 ounces. However, there is some variability in the amount of ice cream in a box as well as the amount of ice cream scooped out. We represent the amount of ice cream in the box as X and the amount scooped out as Y . Suppose these random variables have the following means, standard deviations, and variances:

mymat3=matrix(c(48,1,1, 2,.25,.0625), nrow=2, byrow=TRUE)
colnames(mymat3)=c("mean", "SD", "Var")
rownames(mymat3)=c("X, In Box","Y, Scooped")
mymat3
##            mean   SD    Var
## X, In Box    48 1.00 1.0000
## Y, Scooped    2 0.25 0.0625
  1. An entire box of ice cream, plus 3 scoops from a second box is served at a party. How much ice cream do you expect to have been served at this party? What is the standard deviation of the amount of ice cream served?
    Answer: Total Ounces of ice-cream = 48+32 = 48+6 = 54
    Standard Deviation of the amount of ice cream served = sqrt(1.00 + (0.0625
    3)) = 1.089725
48+3*2
## [1] 54
sqrt(1 + (0.0625*3))
## [1] 1.089725
  1. How much ice cream would you expect to be left in the box after scooping out one scoop of ice cream? That is, find the expected value of X ??? Y . What is the standard deviation of the amount left in the box?
    Answer: Ounces left in the box after 1 scoop = 48 - 2 = 46
    Standard Deviation of the amount left in the box = sqrt(1 + 0.0625) = 1.030776
48-2
## [1] 46
sqrt(1 + 0.0625)
## [1] 1.030776
  1. Using the context of this exercise, explain why we add variances when we subtract one random variable from another.
    Answer: We add variance to compensate the uncertainty associated with subtracting one random variable as random variable is not a constant and random variable is associated with minor variation which needs to be added