package com.imsl.test.example.stat;
import com.imsl.stat.*;
import com.imsl.math.PrintMatrix;
/**
*
Generates a pseudorandom permutation.
*
*
* In this example, the getPermutations()
method is used to produce
* a pseudorandom permutation of the integers from 1 to 10.
*
* @see Code
* @see Output
*/
public class RandomSamplesEx1 {
public static void main(String[] args) {
int k = 10;
RandomSamples rs = new RandomSamples();
Random r = new Random(123457L);
r.setMultiplier(16807);
rs.setRandomObject(r);
int[] idx = rs.getPermutation(k);
PrintMatrix pm = new PrintMatrix("Random permutation of the integers "
+ "from 1 to 10");
pm.print(idx);
}
}