Starting from:

$25

AI5002-Assignment 3 Probability and Random Variables Solved

A factory has two machines A and B. Past record shows that machine A produced 60% of the items of output and machine B produced 40% of the items. Further, 2% of the items produced by machine A and 1% produced by machine B were defective. All

the items are put into one stockpile and then one item is chosen at random from this and is found to be defective. What is the probability that it was produced by machine B?
Figure 1: Result obtained from python code
 
II. Solution

Let A denote the random variables of an item Download latex code from hereproduced and D denote it being defectve (A=0) : Item produced by machine A

(A=1) : Item produced by machine A

(D=1) = Item produced is defective

P(A=0) = 60 % = 0.6

P(A=1) = 40 % =0.4

                 P(D = 1|A = 0) = P(1|0) = 2% = 0.02         (1)

                 P(D = 1|A = 1) = P(1|1) = 1% = 0.01         (2)

By Baye’s rule,

P(1) × P(1|1)

P(A = 1|D = 1) =  

P(1) × P(1|1) + P(0) × P(1|0)

(3)

P(A = 1|D = 1) =

 0.

(4)

P(A = 1|D = 1) = 0.25 (5)

The probability that the defective item selected at random is produced by machine B is 25%

Similar result is also obtained with random samples generated using the python code. Download python code from here

More products