If X, Y can take values from the set (1, 2, 3 ,4), find the…