🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Probability and Bayes: all 15 questions

Quiz: Probability and Bayes · Question 3 of 15

What does this print? (code)

What does this print?

def bayes(prior, hit, false_alarm):
    return prior * hit / (prior * hit + (1 - prior) * false_alarm)
print(round(bayes(0.5, 0.9, 0.1), 2))
  1. A.0.5
  2. B.0.82
  3. C.0.9
  4. D.0.45
Answer & explanation

Correct answer: 0.9

0.45 / (0.45 + 0.05) = 0.9. With a 50% base rate the flag is much more trustworthy.

Can you get the rest right without peeking?

Take the timed Quiz: Probability and Bayes quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →