On the probability distribution of the gcd and lcm of $r$-tuples of integers