Macaulay2 » Documentation
Packages » CodingTheory > randNoRepeats
next | previous | forward | backward | up | index | toc

randNoRepeats -- list of random integers from a specified range with no repetitions

Synopsis

Description

Given the integers k and k, this function returns a list of k random integers between $0$ and n (inclusive) with no repetitions.

It is safe to use this in applications that have nothing to do with coding theory.

i1 : randNoRepeats(10,4)

o1 = {8, 1, 3, 7}

o1 : List
i2 : randNoRepeats(0,1)

o2 = {0}

o2 : List
i3 : randNoRepeats(25,5)

o3 = {8, 19, 24, 25, 15}

o3 : List

Ways to use randNoRepeats :

For the programmer

The object randNoRepeats is a method function.