How do you write 1 and 2 dimensional distributions in TeX?

I use the TeXbook all the time and I can write matrices and determinants,

But I can't find how to type a discrete prob distribution via Tex.

That's with X and Y on the sides, and their values and the joint probabilities.

Thanks in advance.