Generates an integer array of length k whose entries are selected randomly, without repetition, from the integers 0 through n-1 (inclusive).
Generated arrays represent permutations of n taken k at a time.
Preconditions:
k <= n
n > 0
If the preconditions are not met, an IllegalArgumentException is thrown.
@param n domain of the permutation
@param k size of the permutation
@return random k-permutation of n
aths.abdn.ac.uk/~igc/tch/mx4002/notes/node83.html"> here.
@param n domain of the permutation (must be positive)
@param k size of the permutation (must satisfy 0 < k <= n).
@return the random permutation as an int array
@throws NumberIsTooLargeException if {@code k> n}.
@throws NotStrictlyPositiveException if {@code k <= 0}.
{@inheritDoc}This method calls {@link MathArrays#shuffle(int[],RandomGenerator) MathArrays.shuffle} in order to create a random shuffle of the setof natural numbers {@code} 0, 1, ..., n - 1 }}.
@throws NumberIsTooLargeException if {@code k > n}.
@throws NotStrictlyPositiveException if {@code k <= 0}.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.