Law of total probability

issue here relates to this mission:
https://app.dataquest.io/m/432/the-naive-bayes-algorithm/4/ignoring-the-division

according to the law of total probability, below should be true since non-spam is a complement of spam hence should cover the sample space
:
p_new_message = p_non_spam_given_new_message + p_spam_given_new_message

but the nbrs in the mission doesn’t add up according to the theory.

am i missing something?

`P(M|L) + P(Mc|L)`.
The law of total probability calculates probability not for an event associated with the “given event” (`p_new_message` in your example here) but an event given multiple mutually exclusive and collectively exhaustive scenarios. Whether these scenarios/events are binary depends on our own definitions to our liking (like calling a cat a cat, dog a dog).
So if we follow what you wrote on the left hand side, the right hand side demonstrating law of total probability would be `p_new_message = p_new_message|p_spam*p_spam + p_new_message|p_non_spam*p_non_spam`