RandomElement Command

From GeoGebra Manual
Revision as of 13:18, 26 August 2015 by Markus.winkler (talk | contribs) (changed CAS example)
Jump to: navigation, search


RandomElement[ <List> ]
Returns randomly chosen element from the list (with uniform probability). All elements in the list must be of the same type.
Example:
RandomElement[{3, 2, -4, 7}] yields one of {-4, 2, 3, 7}.


Note: In the Menu view cas.svg CAS View this command also works with symbolic input.
Example:
RandomElement[{a,b,c,d}] yields one of {a,b,c,d}.
Note:
See also Element Command.
© 2024 International GeoGebra Institute