Sample Command

From GeoGebra Manual
Revision as of 12:47, 9 August 2011 by Andrea.duringer (talk | contribs)
Jump to: navigation, search



Sample[ <List L>, <Size n> ]
Returns list of n randomly chosen elements of L; elements can be chosen more times.
Sample[ <List L>, <Size n>, <Boolean for replacement> ]
Returns list of n randomly chosen elements of L. Elements can be chosen more times if and only if the last parameter is true.

CAS Syntax

Sample[ <List L>, <Size n> ]
Returns list of n randomly chosen elements of L; elements can be chosen more times.
Sample[ <List L>, <Size n>, <Boolean for replacement> ]
Returns list of n randomly chosen elements of L. Elements can be chosen more times if and only if the last parameter is true.
Example: Sample[{1, 2, 3, 4, 5}, 5, true] yields for example {2,3,3,4,5}.
© 2024 International GeoGebra Institute