The correct answer is B. $\frac{1}{{{\text{y}} – {\text{x}}}}$.
A probability density function (PDF) is a function that describes the probability of a continuous random variable taking on a certain value. The PDF of a uniform distribution is a constant function over the interval of interest, and zero elsewhere. In this case, the interval of interest is $[x, y]$, so the PDF is $\frac{1}{{{\text{y}} – {\text{x}}}}$.
Option A, $y – x$, is not a probability density function because it is not non-negative and does not integrate to 1. Option C, $x – y$, is also not a probability density function because it is not non-negative. Option D, $\frac{1}{{{\text{x}} – {\text{y}}}}$, is not a probability density function because it is not defined for $x > y$.