Answer:
A) P(F) = 0.124
B) P(S|F) = 0.8065
C) P(V|F^(c)) = 0.886
Step-by-step explanation:
Let us denote as follows;
F = Message contains word free
S = message is spam
V = message is valid
From the question, we are given that;
The probability that word free occurs in spam messages;P(F|S) = 50% = 0.5
The probability of the valid messages that contain free; P(F|V) = 3% = 0.03
Spam messages; P(S) = 20% = 0.2
Valid messages; P(V) = 1 - 0.2 = 0.8
A) From rule of total probability ;
probability that the message contains the word free is given as;
P(F) = P(F|S)•P(S) + P(F|V)•P(V)
P(F) = (0.5 x 0.2) + (0.03 x 0.8)
P(F) = 0.124
B) From Baye's theorem;
probability that the message is spam given that it contains free is given as;
P(S|F) = P(F|S)•P(S)/P(F)
P(S|F) = (0.5 x 0.2)/0.124
P(S|F) = 0.8065
C) From combination of complement rule and Baye's theorem;
probability that the message is valid given that it does not contain free is given as;
P(V|F^(c)) = P(F^(c)|V)•P(V)/P(F^(c))
Thus,
P(V|F^(c)) = [(1 - P(F|V))•P(V)]/(1 - P(F))
P(V|F^(c)) = ((1 - 0.03)•0.8)/(1 - 0.124)
P(V|F^(c)) = 0.776/0.876
P(V|F^(c)) = 0.886