package com.imsl.test.example.stat; import com.imsl.stat.*; import com.imsl.math.PrintMatrix; /** *

* Generates a set of pseudorandom indices.

*

* In this example, the getSampleIndices() method is used to * generate the indices of a pseudorandom sample of size 5 from a population of * size 100.

* * @see Code * @see Output */ public class RandomSamplesEx2 { public static void main(String[] args) { int nSamp = 5; int nPop = 100; RandomSamples rs = new RandomSamples(); Random r = new Random(123457L); r.setMultiplier(16807); rs.setRandomObject(r); int[] idx = rs.getSampleIndices(nSamp, nPop); PrintMatrix pm = new PrintMatrix("Random Sample"); pm.print(idx); } }