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 = round((54+75) / (54+75+9),4)
P
## [1] 0.9348
The probability that it is red or blue is 0.9348
2.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.
total_ball = 19+20+24+17
red = 20
P = round(red / total_ball,4)
The probability that you end up with a red golf ball is 0.25
3.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.
male_with_parents = 215
total_number = 81+116+215+130+129+228+79+252+97+72
P = round(1- male_with_parents/total_number,4)
The probability that a customer is not male or does not live with parents is 0.8463
4.Determine if the following events are independent. Going to the gym. Losing weight
Answer: Dependent
selections = choose(8,3) * choose(7,3)*choose(3,1)
5880 different veggue wraos can be made.
Answer: Independent
cabinet = factorial(14) / factorial(14-8)
1.210809610^{8} different wayss the members of the cabinet be appointed.
P=round(choose(9,0)*choose(4,1)*choose(9,3) / choose(22,4),4)
P
## [1] 0.0459
The probability is ‘r P’
9.Evaluate the following expression. 11! / 7!
factorial(11) / factorial(7)
## [1] 7920
67% of subscribers to a fitness magazine are over the age of 34.
33% of subscribers to a fitness magazine are less than or equal to the age of 34.
11.If you throw exactly three heads in four tosses of a coin you win $97. If not, you pay me $30.
Step 1. Find the expected value of the proposition. Round your answer to two decimal places.
proposition = round(1/4*97 - (1-1/4)*30,2)
The expected value of the proposition is 1.75
Step 2. If you played this game 559 times how much would you expect to win or lose? (Losses must be entered as negative.)
result = 559* proposition
I would expect to win 978.25.
Step 1. Find the expected value of the proposition. Round your answer to two decimal places.
P_lose = (choose(9,4) + choose(9,3) +choose(9,2)+choose(9,1)+choose(9,0) )/ 2^9
P_win = 1-P_lose
value = round(P_lose*(-23)+ P_win*(26),2)
The expected value of the proposition is ‘r value’
Step 2. If you played this game 994 times how much would you expect to win or lose? (Losses must be entered as negative.)
result = value * 994
I would expect to lose ‘r result’
L= Liar
D = Detected as Liar
P(L) = 0.2
P(L’) = 1 - P(L) = 0.8
Sensitivity = P(D|L) = 0.59
Specificity = P(D’|L’)= 0.90
P(D|L’) = 1 - P(D’/L’)= 0.1
P(D’|L) = 1 - P(D|L)= 0.41
P(L|D) = P(D|L) * P(L) / P(D)
= P(D/L) \* P(L) / (P(D/L)*P(L) + P(D/L')*P(L'))
= 0.59 * 0.2 / (0.59*0.2+ 0.1 *0.8)
0.59 * 0.2 / (0.59*0.2+ 0.1 *0.8)
## [1] 0.5959596
P(L’|D’) = P(D’|L’) * P(L’) / P(D’)
= P(D'|L') * P(L') / (P(D'|L')*P(L') + P(D'|L)*P(L))
= 0.9*0.8 / (0.9*0.8+0.41*0.2)
0.9*0.8 / (0.9*0.8+0.41*0.2)
## [1] 0.8977556
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. P(L or D) = P(L) + P(D) - P(L and D)
= P(L) + P(L'|D)
= 0.2 + (1 - P(L|D))
= 0.2 + (1 - 0.5959596)0.2 + (1 - 0.5959596)
## [1] 0.6040404