Definition:

i \ j012
0P(X=0, Y=0)P(X=0, Y=1)P(X=0, Y=2)
1P(X=1, Y=0)P(X=1, Y=1)P(X=1, Y=2)
2P(X=2, Y=0)P(X=2, Y=1)P(X=2, Y=2)