Logo Data Structures and Algorithms with Object-Oriented Design Patterns in Java
next up previous contents index

Uniformly Distributed Random Variables

Program gif defines the UniformRV class. This class generates random numbers which are uniformly distributed in an arbitrary interval (u,v), where u<v. The parameters u and v are specified in the constructor.

   program33682
Program: UniformRV class.

The UniformRV class is also quite simple. Given that the RandomNumberGenerator class generates a sequence random numbers tex2html_wrap_inline68247 uniformly distributed on the interval (0,1), the linear transformation

displaymath68237

suffices to produce a sequence of random numbers tex2html_wrap_inline68251 uniformly distributed on the interval (u,v).


next up previous contents index

Bruno Copyright © 1998 by Bruno R. Preiss, P.Eng. All rights reserved.