Re: Needing a Random List of Non-repeating Values whose Range and Length
- To: mathgroup at smc.vnet.net
- Subject: [mg129510] Re: Needing a Random List of Non-repeating Values whose Range and Length
- From: Szabolcs Horvát <szhorvat at gmail.com>
- Date: Sat, 19 Jan 2013 01:14:49 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-newout@smc.vnet.net
- Delivered-to: mathgroup-newsend@smc.vnet.net
- References: <kdanrk$3ec$1@smc.vnet.net>
On 2013-01-18 05:50:44 +0000, brtubb090530 at cox.net said:
> Consider the following:
>
> ril[range_Integer]:= RandomInteger[{1,range},range]
>
> This function is almost what I want; but I need one which doesn't
> include any repeated values. This is intended for use, for example, for
> a card deck, or dice, etc.
The subject line is cut off. Please do not put the question in the
subject *only*.
>From the body of your message it looks like you want a random
permutation of Range[range] which can be computed using
RandomSample@Range[range]