AandB <- jointRV(outcomes = list(1:3, 0:2), probs = 1:9 / sum(1:9))
A <- marginal(AandB, 1)
B <- marginal(AandB, 2)
independent(A, B) # FALSE
CandD <- jointRV(outcomes = list(1:3, 0:2))
C <- marginal(CandD, 1)
D <- marginal(CandD, 2)
independent(C, D) # FALSE
Run the code above in your browser using DataLab