140 2 − 80 2 ≅ 115 {\displaystyle {\sqrt {140^{2}-80^{2}}}\cong 115}
e ln x = x , ∀ x ∈ R + {\displaystyle e^{\ln {x}}=x,\forall x\in \mathbb {R} ^{+}}
ln ( a ⋅ b ) = ln a + ln b {\displaystyle \ln({a\cdot b})=\ln a+\ln b}
ln a b = ln a − ln b {\displaystyle \ln {a \over b}=\ln a-\ln b}
P ( w i | C ) = N C , i N C {\displaystyle P(w_{i}|C)={N_{C,i} \over N_{C}}}
P ( A | B ) = P ( B | A ) ⋅ P ( A ) P ( B ) {\displaystyle P(A|B)={{P(B|A)\cdot P(A)} \over {P(B)}}}
P ( w 1 , w 2 , . . . , w n | C ) = P ( w 1 | C ) ⋅ P ( w 2 | C ) ⋅ . . . ⋅ P ( w n | C ) = ∏ k = 1 n N C , k N C {\displaystyle P(w_{1},w_{2},...,w_{n}|C)=P(w_{1}|C)\cdot P(w_{2}|C)\cdot ...\cdot P(w_{n}|C)={\prod _{k=1}^{n}{N_{C,k} \over N_{C}}}}
P ( S p a m | w 1 , w 2 , . . . , w n ) = ∏ k = 1 n N Spam , k N Spam ⋅ P ( S p a m ) P ( w 1 , w 2 , . . . , w n ) {\displaystyle P(Spam|w_{1},w_{2},...,w_{n})={\frac {{\prod _{k=1}^{n}{{\color {Red}N_{{\text{Spam}},k}} \over {\color {Brown}N_{\text{Spam}}}}}\cdot P(Spam)}{P(w_{1},w_{2},...,w_{n})}}}
P ( H a m | w 1 , w 2 , . . . , w n ) = ∏ k = 1 n N Ham , k N Ham ⋅ P ( H a m ) P ( w 1 , w 2 , . . . , w n ) {\displaystyle P(Ham|w_{1},w_{2},...,w_{n})={\frac {{\prod _{k=1}^{n}{{\color {OliveGreen}N_{{\text{Ham}},k}} \over {\color {Blue}N_{\text{Ham}}}}}\cdot P(Ham)}{P(w_{1},w_{2},...,w_{n})}}}
V = ∏ k = 1 n N Spam , k N Spam ⋅ P ( S p a m ) P ( w 1 , w 2 , . . . , w n ) ⋅ ∏ k = 1 n N Ham N Ham , k ⋅ P ( w 1 , w 2 , . . . , w n ) P ( H a m ) {\displaystyle V={\frac {{\prod _{k=1}^{n}{{\color {Red}N_{{\text{Spam}},k}} \over {\color {Brown}N_{\text{Spam}}}}}\cdot P(Spam)}{P(w_{1},w_{2},...,w_{n})}}\cdot {\frac {{\prod _{k=1}^{n}{{\color {Blue}N_{\text{Ham}}} \over {\color {OliveGreen}N_{{\text{Ham}},k}}}}\cdot P(w_{1},w_{2},...,w_{n})}{P(Ham)}}}
V = P ( S p a m ) P ( H a m ) ⋅ ∏ k = 1 n N Spam , k N Spam ⋅ ∏ k = 1 n N Ham N Ham , k {\displaystyle V={\frac {P(Spam)}{P(Ham)}}\cdot {\prod _{k=1}^{n}{{\color {Red}N_{{\text{Spam}},k}} \over {\color {Brown}N_{\text{Spam}}}}}\cdot {\prod _{k=1}^{n}{{\color {Blue}N_{\text{Ham}}} \over {\color {OliveGreen}N_{{\text{Ham}},k}}}}}
V = N Spam ∏ k = 1 n N Spam , k N Spam N Ham ∏ k = 1 n N Ham , k N Ham {\displaystyle V={{\color {Brown}N_{\text{Spam}}}\prod _{k=1}^{n}{{\color {Red}N_{{\text{Spam}},k}} \over {\color {Brown}N_{\text{Spam}}}} \over {{\color {Blue}N_{\text{Ham}}}\prod _{k=1}^{n}{{\color {OliveGreen}N_{{\text{Ham}},k}} \over {\color {Blue}N_{\text{Ham}}}}}}}
∏ k = 1 n N Spam , k N Spam ∏ k = 1 n N Ham , k N Ham {\displaystyle {\prod _{k=1}^{n}{{\color {Red}N_{{\text{Spam}},k}} \over {\color {Brown}N_{\text{Spam}}}} \over {\prod _{k=1}^{n}{{\color {OliveGreen}N_{{\text{Ham}},k}} \over {\color {Blue}N_{\text{Ham}}}}}}}
V = N Spam N Ham ∏ k = 1 n N Spam , k N Ham , k ∏ k = 1 n N Ham N Spam | ln ( . . . ) {\displaystyle V={{{\color {Brown}N_{\text{Spam}}} \over {\color {Blue}N_{\text{Ham}}}}{\prod _{k=1}^{n}{{\color {Red}N_{{\text{Spam}},k}} \over {\color {OliveGreen}N_{{\text{Ham}},k}}}}{\prod _{k=1}^{n}{{\color {Blue}N_{\text{Ham}}} \over {\color {Brown}N_{\text{Spam}}}}}}\quad |\ln(...)}
ln ( V ) = ln ( N Spam ) − ln ( N Ham ) + ∑ k = 1 n ln ( N Spam , k N Ham , k ) + ∑ k = 1 n ln ( N Ham N Spam ) {\displaystyle \ln(V)={\ln({\color {Brown}N_{\text{Spam}}})-\ln({\color {Blue}N_{\text{Ham}}})+\sum _{k=1}^{n}{\ln \left({{\color {Red}N_{{\text{Spam}},k}} \over {\color {OliveGreen}N_{{\text{Ham}},k}}}\right)}+\sum _{k=1}^{n}{\ln \left({{\color {Blue}N_{\text{Ham}}} \over {\color {Brown}N_{\text{Spam}}}}\right)}}}
ln ( V ) = ( n − 1 ) ( ln ( N Ham ) − ln ( N Spam ) ) + ∑ k = 1 n ( ln ( N Spam , k ) − ln ( N Ham , k ) ) {\displaystyle \ln(V)={{\Bigl (}n-1{\Bigr )}{{\Bigl (}\ln({\color {Blue}N_{\text{Ham}}})-\ln({\color {Brown}N_{\text{Spam}}}){\Bigr )}}+\sum _{k=1}^{n}{{\Bigl (}\ln({\color {Red}N_{{\text{Spam}},k}})-\ln({\color {OliveGreen}N_{{\text{Ham}},k}}){\Bigr )}}}}
V = exp ( ( n − 1 ) ( ln ( N Ham ) − ln ( N Spam ) ) + ∑ k = 1 n ( ln ( N Spam , k ) − ln ( N Ham , k ) ) ) {\displaystyle V=\exp {\Biggl (}{{\Bigl (}n-1{\Bigr )}{{\Bigl (}\ln({\color {Blue}N_{\text{Ham}}})-\ln({\color {Brown}N_{\text{Spam}}}){\Bigr )}}+\sum _{k=1}^{n}{{\Bigl (}\ln({\color {Red}N_{{\text{Spam}},k}})-\ln({\color {OliveGreen}N_{{\text{Ham}},k}}){\Bigr )}}{\Biggr )}}}
P ( S p a m ) = exp ( s u m ( l n ) + ( n − 1 ) ( h a m − s p a m ) ) {\displaystyle P(Spam)=\exp {\bigl (}{sum(ln)+(n-1)({\color {Blue}ham}-{\color {Brown}spam}){\bigr )}}}
( n − 1 ) ( ln ( N Ham ) − ln ( N Spam ) ) {\displaystyle (n-1)(\ln({\color {Blue}N_{\text{Ham}}})-\ln({\color {Brown}N_{\text{Spam}}}))}
10 − 1500 {\displaystyle 10^{-1500}}
ln N S p a m , i N H a m , i {\displaystyle \ln {N_{Spam,i} \over N_{Ham,i}}}
s p a m = s p a m + Δ s p a m {\displaystyle spam=spam+\Delta spam}
ln ( s p a m + Δ s p a m ) − ln e ( ln ( s p a m ) − l n ) , s p a m = s p a m + n {\displaystyle \ln(spam+\Delta spam)-\ln {e^{(}\ln(spam)-ln)},spam=spam+n}