#1. What is the probability of rolling a sum of 12 on three rolls of six-sided dice? Express your answer as a decimal number only. Show your R code.

#Calculate the total of possibile rolls > rolls <- expand.grid(d1 = 1:6, d2 = 1:6, d3 = 1:6) > #How many rols sum to 12? > total_rolls <- nrow(rolls) > probability <- wins/total_rolls > probability [1] 0.1157407

#2. A newspaper company classifies its customers by gender and location of residence. The research department has gathered data from a random sample of customers. The data is summarized in the table below.What is the probability that a customer is male and lives in ‘Other’ or is female and lives in ‘Other’? Express your answer as a decimal number only. Show your R code.

I tried alot of ideas with this and could not figure out how to add the data correct to build the matrix.

gender <- c(“Males”, “Females”) residence <- c(“Apartment”, “Dorm”, “With Parents”, “Sorority/Fraternity House”, “Other”) males <- c(200, 200, 100, 200, 200) females <- c(300, 100, 200, 100, 100) residence_matrix <- matrix(males, females, nrow = 5, byrow = TRUE) residence_matrix

I emailed you about the issues I was having. I need more guidance and practice with this.

#3. Two cards are drawn without replacement from a standard deck of 52 playing cards. What is the probability of choosing a diamond for the second card drawn, if the first card, drawn without replacement, was a diamond? Express your answer as a decimal number only. Show your R code. > (13/52)*(12/51) [1] 0.05882353

#4. A coordinator will select 10 songs from a list of 20 songs to compose an event’s musical entertainment lineup. How many different lineups are possible? Show your R code. > comb_with_replacement <- function(n, r){ + return( factorial(n + r - 1) / (factorial(r) * factorial(n - 1)) ) + } > comb_with_replacement(20,10) [1] 20030010

#5. You are ordering a new home theater system that consists of a TV, surround sound system, and DVD player. You can choose from 20 different TVs, 20 types of surround sound systems, and 18 types of DVD players. How many different home theater systems can you build? Show your R code.

tvs <- 20 surround_systems <- 20 dvd_players <- 18 Total_systems <- (tvs * surround_systems * dvd_players) Total_systems [1] 7200

#6. A doctor visits her patients during morning rounds. In how many ways can the doctor visit 10 patients during the morning rounds? Show your R code.

n <- 10 factorial(n) [1] 3628800

#7. If a coin is tossed 7 times, and then a standard six-sided die is rolled 3 times, and finally a group of four cards are drawn from a standard deck of 52 cards without replacement, how many different outcomes are possible? Show your R code.

#Coin tossed 7 times > coin <- 2^7 [1] 128

#Die rolled 3 times > die <- 6^3 [1] 216

#Four cards from 52 without replacement > cards_comb <- choose(52, 4) [1] 270725

#Total if cards are a group > total_comb <- coin * die * cards_comb > total_comb [1] 7485004800

#8. In how many ways may a party of four women and four men be seated at a round table if the women and men are to occupy alternate seats. Show your R code.

women <- factorial(4 - 1) # (4-1)! women [1] 6

men <- factorial(4) # 4! men [1] 24

total <- women * men total [1] 144

*An opioid urinalysis test is 95% sensitive for a 30-day period, meaning that if a person has actually used opioids within 30 days, they will test positive 95% of the time P( + | User) =.95. The same test is 99% specific, meaning that if they did not use opioids within 30 days, they will test negative P( - | Not User) = .99. Assume that 3% of the population are users. Then what is the probability that a person who tests positive is actually a user P(User | +)?

positive <- 0.95 specific <- 0.99 users <- 0.03 not_user <- 1 - users positiuve_not_user <- 1 - specific numerator <- positive * users denominator <- (positive * users) + (positive_not_user * not_user) positive_user <- numerator/denominator positive_user [1] 0.7460733

#10. You have a hat in which there are three pancakes. One is golden on both sides, one is brown on both sides, and one is golden on one side and brown on the other. You withdraw one pancake and see that one side is brown. What is the probability that the other side is brown? Explain.

This is an example of the Monty Hall Problem. The answer is 67% or 2/3 One one pancake is selected the odds of the other side being the same is added: 33.33# + 33.33% = 66.66% or 2/3 Always choose the other door Monty.