1. Home
  2. Data Science
  3. Naive Bayes
  4. P(spam) = 0.4 and P(word | spam) = 0.5, while P(ham) = 0.6…

Added 2 Nov 2026

P(spam) = 0.4 and P(word | spam) = 0.5, while P(ham) = 0.6 and P(word | ham) = 0.1. Given the word appears, what is P(spam | word)?

  1. About 0.77 Correct answer
  2. About 0.20
  3. About 0.40
  4. About 0.50

Correct answer

A. About 0.77

11 views

MCQSEXAM

Explanation

By Bayes' theorem: P(spam | word) = (0.4 × 0.5) ÷ (0.4 × 0.5 + 0.6 × 0.1) = 0.20 ÷ 0.26 ≈ 0.77. Seeing the word raises the spam probability from 40% to 77%.

Reference

Asked in: Data Science Interviews, GATE DA

Preparing for an exam?

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Naive Bayes MCQs

Practise all Naive Bayes MCQs

Similar MCQs