HP Forums
how to shuffle list / randomize list items ? - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: how to shuffle list / randomize list items ? (/thread-9153.html)



how to shuffle list / randomize list items ? - primer - 09-24-2017 08:03 PM

Hello,
is there a way to shuffle / randomize list items ?
for example, I have L1:={ 2, 4, 6, 8, 10}
and I want something randomly unsorted, (with same items).

Thank you.


RE: how to shuffle list / randomize list items ? - Didier Lachieze - 09-24-2017 08:37 PM

mat2list(randperm(L1)) will return a random permutation of the elements of L1.


RE: how to shuffle list / randomize list items ? - Arno K - 09-24-2017 08:40 PM

At least there is randperm which you can take as a basis für constructing your shuffled list using commands for lists.
Arno


RE: how to shuffle list / randomize list items ? - primer - 09-24-2017 09:02 PM

Thanks both,

Merci bcp Didier, Viele Danke Arno.


RE: how to shuffle list / randomize list items ? - Arno K - 09-24-2017 09:47 PM

Pas de quoi.