Search code examples
statisticsprobabilitybayesian

Conditional Probability for fake reviews


I am working on a conditional probability question. enter image description here

A = probability of being legit review

B = probability of guessing correctly

P(A) = 0.98 → P(A’) = 0.02

P(B|A’) = 0.95

P(B|A) = 0.90

The question should be this: P(A’|B) =?


P(A’|B) = P(B|A’).P(A’) / P(B)

P(B) = P(B and A’) + P(B and A)
        = P(B|A’). P(A’) + P(B|A). P(A)
        = 0.901


P(A’|B) = P(B|A’).P(A’) / P(B)
              = 0.95 x 0.02 / 0.901
              = 0.021

However, my result is not listed on the choices of questions. Can you please tell me if I am missing anything? Or my logic is incorrect?


Solution

  • Example with numbers

    This example with numbers is meant as an intuitive way to understand how Bayes' formula works:

    Let's assume we have 10.000 typical reviews. We calculate what we would expect to happen with these 10.000 reviews:

    • 9.800 are real
    • 200 fake

    To predict how many review are classified as fake:

    • Of the 9800 real ones, 10% are classified as fake → 9800 * 0.10 = 980
    • Of the 200 fake ones, 95% are classified as fake → 200 * 0.95 = 190
    • 980 + 190 = 1.170 are classified a fake.

    Now we have all the pieces we need to calculate the probability that a reviews is fake, given that it is classified as such:

    • All reviews that are classified as fake → 1.170
    • Of those, are actually fake → 190
    • 190 / 1170 = 0.1623 or 16.23%

    Using general Bayes' theorem

    Let's set up the events. Note that my version of event B is slightly different from yours.

    • P(A): Real review
    • P(A'): Fake review
    • P(B): Predicted real
    • P(B'): Predicted fake
    • P(A'|B'): Probability that a review is actually fake, when it is predicted to be real

    Now that we have our events defined, we can go ahead with Bayes:

    P(A'|B') = P(A' and B') / P(B')                         # Bayes' formula
             = P(A' and B') / (P(A and B') + P(A' and B'))  # Law of total probability
    

    We also know the following, by an adapted version of Bayes' rule:

    P(A and B') = P(A)  * P(B'|A )
                = 0.98 * 0.10
                = 0.098
    
    P(A' and B') = P(A') * P(B'|A')
                 = 0.02  * 0.95
                 = 0.019
    

    Putting the pieces together yields:

    P(A'|B') = 0.019 / (0.098 + 0.019) = 0.1623