Sample Command
- Sample( <List>, <Size> )
-
Returns list of n randomly chosen elements of a list; elements can be chosen several times.
Sample({1, 2, 3, 4, 5}, 5)
yields for example list1 = {1, 2, 1, 5, 4}.
- Sample( <List>, <Size>, <With Replacement> )
-
Returns list of n randomly chosen elements of a list. Elements can be chosen several times if and only if the last parameter is true.
Sample({1, 2, 3, 4, 5}, 5, true)
yields for example list1 = {2, 3, 3, 4, 5}.
In the CAS View the input list can contain different types of objects:
|