Class RandomEx4

java.lang.Object
com.imsl.test.example.stat.RandomEx4

public class RandomEx4 extends Object

Generates a pseudorandom sample from a discrete uniform distribution.

In this example, nextDiscrete and nextUniformDiscrete are each used to generate discrete uniform pseudorandom numbers. Note that the probabilities across the possible values must be equal, in order to generate uniformly from nextDiscrete. Also note that since the same random seed is used, the methods produce the same results.

$$\begin{array}{c}\operatorname{Pr}(X=1)=0.20\\ \operatorname{Pr}(X=2)=0.20\\\operatorname{Pr}(X=3)=0.20 \\ \operatorname{Pr}(X=4)=0.20\\\operatorname{Pr}(X=5)=0.20\end{array}$$
See Also:
  • Constructor Details

    • RandomEx4

      public RandomEx4()
  • Method Details

    • main

      public static void main(String[] args)