MathGroup Archive 2009

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

Search the Archive

Re: Random choice

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99832] Re: Random choice
  • From: Ray Koopman <koopman at sfu.ca>
  • Date: Fri, 15 May 2009 06:25:07 -0400 (EDT)
  • References: <guj8ef$hv6$1@smc.vnet.net>

On May 15, 1:17 am, Valeri Astanoff <astan... at gmail.com> wrote:
> Good day,
>
> Given this example :
>
> In[1]:= RandomChoice[Range[500], 100] // Union // Length
>
> Out[1]= 91
>
> what is the best way to get *exactly* 100 different
> random numbers ranging from 1 to 500 ?
>
> Any piece of advice would be appreciated.
>
> --
>
> Valeri Astanoff

RandomSample[Range[500], 100] // Union // Length

Given the well-established meaning of m_Choose_n for sampling without
replacement, whoever decided on the new terminology got RandomChoice
and RandomSample backwards.


  • Prev by Date: Re: Random choice
  • Next by Date: Re: Question about filenames for Export[...]
  • Previous by thread: Re: Random choice
  • Next by thread: Re: Random choice