1. A box contains 54 red marbles, 9 white marbles, and 75 blue marbles. If a marble is randomly selected from the box, what is the probability that it is red or blue? Express your answer as a fraction or a decimal number rounded to four decimal places.
P_R <- 54
P_W <- 9
P_B  <- 75
S <- 54 + 9 + 75
paste0("sample Space is  ",S)
## [1] "sample Space is  138"
PRB <- round((P_R/S * P_B/S),4)
paste0("Probability of Red or Blue ",PRB)
## [1] "Probability of Red or Blue 0.2127"
  1. You are going to play mini golf. A ball machine that contains 19 green golf balls, 20 red golf balls, 24 blue golf balls, and 17 yellow golf balls, randomly gives you your ball. What is the probability that you end up with a red golf ball? Express your answer as a simplified fraction or a decimal rounded to four decimal places.
S <- 19 + 20 + 24 + 17
paste0("sample Space is  ",S)
## [1] "sample Space is  80"
pr <- 20/S
paste0("probability of red ball ",pr)
## [1] "probability of red ball 0.25"
  1. A pizza delivery company classifies its customers by gender and location of residence. The research department has gathered data from a random sample of 1399 customers. The data is summarized in the table below. What is the probability that a customer is not male or does not live with parents? Write your answer as a fraction or a decimal number rounded to four decimal places.
Total <- 1399
P_M <- 215/Total # probability of male living with parents
P <- 1 - P_M
paste0("customer is not male or does not live with parents is = ",P)
## [1] "customer is not male or does not live with parents is = 0.846318799142245"
  1. Determine if the following events are independent. Going to the gym. Losing weight.

Answer: A) Dependent - Going to gym helps stay fit and loose extra fats

  1. A veggie wrap at City Subs is composed of 3 different vegetables and 3 different condiments wrapped up in a tortilla. If there are 8 vegetables, 7 condiments, and 3 types of tortilla available, how many different veggie wraps can be made?

Answer: Total_different_wraps = (selecting 3 vegetables from 8) * (selecting 3 condiments from 7) * (select 1 tortilla from 3)

T <- choose(8,3) * choose(7,3) * choose(3,1)
paste0("Total veg wraps = ",T)
## [1] "Total veg wraps = 5880"
  1. Determine if the following events are independent. Jeff runs out of gas on the way to work. Liz watches the evening news. Answer: A) Dependent B) Independent

Answer :- Independant - Not able to find any connection between running out of gas and watching TV

  1. The newly elected president needs to decide the remaining 8 spots available in the cabinet he/she is appointing. If there are 14 eligible candidates for these positions (where rank matters), how many different ways can the members of the cabinet be appointed?

Answer:-

C <- choose(14,8)
C
## [1] 3003

No of ways members can be appointed is 3003

  1. A bag contains 9 red, 4 orange, and 9 green jellybeans. What is the probability of reaching into the bag and randomly withdrawing 4 jellybeans such that the number of red ones is 0, the number of orange ones is 1, and the number of green ones is 3? Write your answer as a fraction or a decimal number rounded to four decimal places.

Answer:- Here Sample space S = 9 + 4 + 9 = 22

Now probability of drawing 0 red and 1 orange and 3 green from 4 beans is

r <- choose(9,0)
r
## [1] 1
o <- choose (4,1)
g <- choose(9,3)

T <- r * o * g
#Now probability of choosing 4 beans from sample 22
S <- choose(22,4)
T/S
## [1] 0.04593301
  1. Evaluate the following expression. 11!/7!

Answer :- Manually doing this

(11x10x9x8x7x6x5x4x3x2x1)/(7x6x5x4x3x2*1) solving this we get 11x 10x9x8 = 7920

S <- factorial(11)/factorial(7)
S
## [1] 7920
  1. Describe the complement of the given event. 67% of subscribers to a fitness magazine are over the age of 34.

Answer:- 1 - 0.67 = 0.33 So complement will be 33% of subscribers of fitness magazine are below age of 34

  1. If you throw exactly three heads in four tosses of a coin you win $97. If not, you pay me $30.

Answer:- Probability of getting head in 1 toss = 1/2 So P(head in 3 toss) = 1/21/21/2 = 1/8

Step 1. Find the expected value of the proposition. Round your answer to two decimal places.

So expected value = P(win)97+(1-P(win)(-30)

P <- 1/8*97 - ((1-1/8)*30)
paste0("expected value is = ",P)
## [1] "expected value is = -14.125"

Step 2. If you played this game 559 times how much would you expect to win or lose? (Losses must be entered asnegative.)

Answer:- we already know the expected value of each possible game. So now you just need to multiply that by 559 to get expected loss on 559 games.

P <- 559 * -14.125
paste0("Loss is  = ",P)
## [1] "Loss is  = -7895.875"
  1. Flip a coin 9 times. If you get 4 tails or less, I will pay you $23. Otherwise you pay me $26.

Answer:- Calculating using R

P_tails = pbinom(4,size = 9,prob = 0.5) 
P_tails
## [1] 0.5

Step 1. Find the expected value of the proposition. Round your answer to two decimal places.

Answer:- So expected value = P(tails)x23+(1-P(tail)x(-26)

Exp_vl <- P_tails*23 - ((1-P_tails)*26)
paste0("expected value is = ",Exp_vl)
## [1] "expected value is = -1.50000000000001"

Step 2. If you played this game 994 times how much would you expect to win or lose? (Losses must be entered as negative.)

Answer:-

P <- 994 * Exp_vl
paste0("Loss is  = ",P)
## [1] "Loss is  = -1491.00000000001"
  1. The sensitivity and specificity of the polygraph has been a subject of study and debate for years. A 2001 study of theuse of polygraph for screening purposes suggested that the probability of detecting a liar was .59 (sensitivity) and that the probability of detecting a “truth teller” was .90 (specificity). We estimate that about 20% of individuals selected for the screening polygraph will lie.
P_Liar <- 0.2
P_Truth <- 0.8
senstivity <- 0.59
specificity <- 0.90
P_detectliar <- 0.59 * P_Liar
P_detectliar
## [1] 0.118
P_detecttruth <- 0.90 * P_Truth
P_detecttruth
## [1] 0.72
P_falsedetectliar <- (1-0.59)*P_Liar
P_falsedetectliar
## [1] 0.082
P_falsedetecttruth <- (1-0.9)*P_Truth
P_falsedetecttruth
## [1] 0.08
  1. What is the probability that an individual is actually a liar given that the polygraph detected him/her as such? (Show me the table or the formulaic solution or both.)

ANswer:-

liar <- P_detectliar /(P_detectliar + P_falsedetecttruth)
liar
## [1] 0.5959596
  1. What is the probability that an individual is actually a truth-teller given that the polygraph detected him/her as such? (Show me the table or the formulaic solution or both.)
truth <- P_detecttruth / (P_detecttruth + P_falsedetectliar)
truth
## [1] 0.8977556
  1. What is the probability that a randomly selected individual is either a liar or was identified as a liar by the polygraph? Be sure to write the probability statement.

Answer:- P(Lair\(\cup\)detectliar) = P(Liar) + P(detectliar) - P(Liar\(\cap\)detectliar)

P <- 0.2 + 0.59 - 0.118
P
## [1] 0.672