Simulates an "oblique" random variable,
between a and b, the straight line having a given slope,
m. The slope must be
|m| ≤ 2 ⁄ (b − a)²
(as probability cannot be negative). The 'pdf' is, thus,
y = p + m (x − a), with
m = (q − p) ⁄ (b − a) .
So, y(a) = p and y(b) = q .
A plot is shown for the simulated f,
and for F, the simulated 'cdf'.
Other suggested data: vary slope. |