MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Needing a Random List of Non-repeating Values whose Range and Length


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]




  • Prev by Date: Can you profile compiled code?
  • Next by Date: Re: Needing a Random List of Non-repeating Values whose Range and Length
  • Previous by thread: Re: Needing a Random List of Non-repeating Values whose Range and Length
  • Next by thread: Re: Needing a Random List of Non-repeating Values whose Range and Length