Problem 1: Dice Roll

(a) getting a sum of 1?

Can not have sum of 1 by rolling two fair dice. minimum sum you can get is 2 according to the sum matrix.

# two dice roll in a matrix
a = c(1,2,3,4,5,6)
b= c(1,2,3,4,5,6)
dicesum<-matrix(c(a[1]+b,a[2]+b,a[3]+b,a[4]+b,a[5]+b,a[6]+b),nrow = 6, byrow=TRUE)
#print the combination of sums in rolling two fair dice
dicesum
##      [,1] [,2] [,3] [,4] [,5] [,6]
## [1,]    2    3    4    5    6    7
## [2,]    3    4    5    6    7    8
## [3,]    4    5    6    7    8    9
## [4,]    5    6    7    8    9   10
## [5,]    6    7    8    9   10   11
## [6,]    7    8    9   10   11   12

(b) getting a sum of 5?

according to the sum matrix there are 4 possible chances of getting sum of 5. (4,1)(3,2)(2,3)(1,4):

# Probability of getting a sum of 5:
sumof5_tot_chances<- 4
tot_Possible_outcomes <- 36
Pof5 <- sumof5_tot_chances/tot_Possible_outcomes
Pof5
## [1] 0.1111111

(c) getting a sum of 12?

according to the sum matrix there are 1 possible chance of getting sum of 12. (6,6):

# Probability of getting a sum of 12:
sumof12_tot_chances<- 1
tot_Possible_outcomes <- 36
Pof12 <- sumof12_tot_chances/tot_Possible_outcomes
Pof12
## [1] 0.02777778

Problem 2: School absences

(a) What is the probability that a student chosen at random doesn’t miss any days of school due to sickness this year?

0.32

miss1 = 0.25
miss2 = 0.15
miss3ormore = 0.28

Pofnonmiss = 1 - (miss1+miss2+miss3ormore)
Pofnonmiss
## [1] 0.32

(b) What is the probability that a student chosen at random misses no more than one day?

0.57

Pofnomorethan1 = (Pofnonmiss+miss1)
Pofnomorethan1
## [1] 0.57

(c) What is the probability that a student chosen at random misses at least one day?

0.68

Pofatleast1 = (miss1+miss2+miss3ormore)
Pofatleast1
## [1] 0.68

(d) 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.

0.1024

# Note: assuming one kid has no effect on other kid not missing school
Pofneitherkidsmiss = Pofnonmiss*Pofnonmiss
Pofneitherkidsmiss
## [1] 0.1024

(e) 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.

0.4624

# Note: assuming one kid has no effect on other kid missing school
Pofbothmiss = Pofatleast1*Pofatleast1
Pofbothmiss
## [1] 0.4624

(f) 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.

It is not reasonable to assume that these factors are independant.

Problem 3: Health coverage, relative frequencies

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

(a) Are being in excellent health and having health coverage mutually exclusive?

No, according to the matrix 0.2099 or 20.99% in excellent health has coverage.

(b) What is the probability that a randomly chosen individual has excellent health?

0.2329

Pofexcellenthealth = (0.0230+0.2099)
Pofexcellenthealth
## [1] 0.2329

(c) What is the probability that a randomly chosen individual has excellent health given that he has health coverage?

0.2402

Tot_No_Coverage = (0.0230+0.0364+0.0427+0.0192+0.0050)
Tot_Coverage = (0.2099+0.3123+0.2410+0.0817+0.0289)
Pofexcellenthealth_coverage = 0.2099/Tot_Coverage
Pofexcellenthealth_coverage
## [1] 0.2402152

(d) What is the probability that a randomly chosen individual has excellent health given that he doesn’t have health coverage?

0.1821

Pofexcellenthealth_No_coverage = 0.0230/Tot_No_Coverage
Pofexcellenthealth_No_coverage
## [1] 0.1821061

(e) Do having excellent health and having health coverage appear to be independent?

They do not appear to be independent.

Problem 4: Exit Poll

Poll=matrix(c(19.61,33.39,53,20.68,26.32,47,40.29,59.71,100), byrow=TRUE, nrow=3)
colnames(Poll)=c("Degree", "No degree","Total")
rownames(Poll)=c("Voted","Not Voted","Total")
Poll
##           Degree No degree Total
## Voted      19.61     33.39    53
## Not Voted  20.68     26.32    47
## Total      40.29     59.71   100

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?

0.4867

Pofvotedwithdegree = 19.61/40.29
Pofvotedwithdegree
## [1] 0.4867213

Problem 5. Books on a bookshelf

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

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

0.185

Pofhard = 28/95
PofPaper_fiction = 59/94
a = Pofhard * PofPaper_fiction
a
## [1] 0.1849944

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

0.224

(13/95)*(27/94)+(59/95)*(28/94)
## [1] 0.2243001

(c) 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.

0.223

Poffiction = 72/95
Pofhard = 28/95
a = Poffiction * Pofhard
a
## [1] 0.2233795

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

Replacing the book back or not replacing the book does not effect in the final answer that much. they are two differnt independant events.

Problem 6. Is it worth it?

(a) Create a probability model and find Andy’s expected profit per game.

# Probability of winning nothing/ with loss of $2
# there are 36 cards of (2-10) in a 52 card pack
# 36/52
# Probability of winning $3/ with $1 profits
# There are 12 face cards (3*4) in a 52 card pack
# 12/52
# Probability of winning $5/ with $3 profits
# there are 3 Ace cards in a 52 card pack
# 3/52
# Probability of winning $25/ with $23 profits
# 1/52
# Expected Profits per game
((36/52)*(-2))+((12/52)*(1))+((3/52)*(3))+((1/52)*(23))
## [1] -0.5384615

(b) Would you recommend this game to Andy as a good way to make money? Explain.

I would not recommend this game to Andy as he is already losing money.

Problem 7. Scooping ice cream

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

(a) 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?

# Amount of Ice cream served
amount = 48+(3*2)
amount
## [1] 54

(b) 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?

# The standard deviation of the amount of ice cream served
round(sqrt(1+.0625*3),4)
## [1] 1.0897
# Amount left in the box
# 48-2 = 46
# The standard deviation of the amount left in the box is
round(sqrt(1+0.0625),4)
## [1] 1.0308

(c) Using the context of this exercise, explain why we add variances when we subtract one random variable from another.