For two [[discrete random variable|discrete random variables]] $X$ and $Y$, $f(x,y) = P(X=x, Y=y)$ is the probability that $X$ takes the value $X$ at the same time $Y$ takes the value $y$. The joint [[probability mass function]] for X and Y is denoted $f(x, y)$ and sometimes with subscripts to denote the joint pmf as in $f_{X,Y}(x,y)$. Typically the joint pmf will be described by a table rather than a formula, such as | | 1 | 2 | 3 | | ---- | ---- | ---- | ---- | | 5 | 0.20 | 0.30 | 0.15 | | 11 | 0.15 | 0.30 | 0.15 | where $y$ are rows and $x$ are columns and the values in each cell are the joint probability $P(X = x, Y= y)$. The [[marginal probability]] of a single variable is the sum of that row or column in the table. For example, from the table above, we can calculate the marginal probability $P(X = 1) = 0.20 + 0.15 = 0.35$. The marginal pmfs for each variable can be written as $f_x(x) = \sum_y f(x,y)$ $f_y(y) = \sum_x f(x,y)$ > [!Example] Example > A room has two lightbulbs, the lifetimes of which can be modeled by an exponential distribution $X \sim exp(\lambda)$ where $\lambda$ equals 1/2000 and 1/3000 hours, respectively. Assuming the lightbulbs lifetimes are independent, what is the probability that the room is dark after 4000 hours? > $P(X_1<=4000,X_2<=4000))=P(X_1<=4000) * P(X_2 <=4000)$ > > In R, we can easily solve this with > ```R > pnorm(4000, rate=1/2000)**2 > ```