146. Joint, Marginal & Conditional Probability

Setup

Imagine we have 100 emails. We track two things about each one: is it spam or not, and does it contain the word “free” or not. Here’s the count of every combination:

𝐹𝐹𝑐margin
𝑆0.200.100.30
𝑆𝑐0.050.650.70
margin0.250.751.00

146.1. Joint Probability

𝑃(𝑆𝐹)=0.20

146.2. Marginal Probability

𝑃(𝐴)=𝑖=1𝑛𝑃(𝐴𝐵𝑖)𝑃(𝑆)=𝑃(𝑆𝐹)+𝑃(𝑆𝐹𝑐)=0.20+0.10=0.30

146.3. Conditional Probability

𝑃(𝐴|𝐵)=𝑃(𝐴𝐵)𝑃(𝐵)𝑃(𝑆|𝐹)=𝑃(𝑆𝐹)𝑃(𝐹)=0.200.25=0.80

146.4. Convolution

You have two independent random variables, 𝑋 and 𝑌. You add them: 𝑍=𝑋+𝑌. What’s the distribution of 𝑍?

146.4.1. Discrete

𝑃(𝑍=𝑧)=𝑥𝑃(𝑋=𝑥)𝑃(𝑌=𝑧𝑥)

146.4.2. Continuous

𝑓𝑍(𝑧)=+𝑓𝑋(𝑥)𝑓𝑌(𝑧𝑥)