Give a technique for simulating a random variable having the probability density function $$f(x)=\left\{\begin{array}{ll}\frac{1}{2}(x-2) & 2 \leq x \leq 3 \\
\frac{1}{2}\left(2-\frac{x}{3}\right) & 3<x \leq 6 \\0 & \text { otherwise }\end{array}\right.$$