Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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

Alex Alicia Juan Correct 0.24 0.396 0.2375 0.8735 Incorrect 0.06 0.054 0.0125 0.1265 0.3 0.45 0.25 1
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote