Write R code to solve the following problem using the function bayes(): Alex, Al
ID: 3049598 • Letter: W
Question
Write R code to solve the following problem using the function bayes(): Alex, Alicia, and Juan fill orders in a fast-food restaurant. Alex incorrectly fills 20% of the orders he takes. Alicia incorrectly fills 12% of the orders she takes. Juan incorrectly fills 5% of the orders he takes. Alex fills 30% of all orders, Alicia fills 45% of all orders, and Juan fills 25% of all orders. An order has just been filled. a. What is the probability that Alicia filled the order? b. If the order was filled by Juan, what is the probability that it was filled correctly? c. If the order was filled incorrectly, what is the probability that it was filed by Juan?
Explanation / Answer
Alex, Alicia, and Juan fill orders in a fast-food restaurant. Alex incorrectly fills 20% of the orders he takes. Alicia incorrectly fills 12% of the orders she takes. Juan incorrectly fills 5% of the orders he takes. Alex fills 30% of all orders, Alicia fills 45% of all orders, and Juan fills 25% of all orders
R -Code
> Pro_Alicia = ((45*88/100)/100)+((45*12/100)/100)
> Pro_Alicia
[1] 0.45
> Pro_Juan_correctly=((25*95/100)/100)
> Pro_Juan_correctly
[1] 0.2375
> Pro_Juan_incorrectly=((25*5/100)/100)
> Pro_Juan_incorrectly
[1] 0.0125
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.