Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2001

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

Search the Archive

Re: Random Sampling Without Replacement

  • To: mathgroup at
  • Subject: [mg26594] Re: Random Sampling Without Replacement
  • From: "Ersek, Ted R" <ErsekTR at>
  • Date: Thu, 11 Jan 2001 10:39:08 -0500 (EST)
  • Sender: owner-wri-mathgroup at

A. E. Seigman wanted a neat compact way to randomly selected three integers
from 1 to N (N>3).  Everything needed is in a standard package.


For three random numbers between 1 and 50 use:

  Part[ RandomKSubset[Range[50], 3],  RandomPermutation[3] ]

  {14, 12, 38}

You can also use RandomPermutation1 or RandomPermutation2 instead of
RandomPermutation which are in the same package.  However, I haven't figured
out the difference between the three types.  You can also check the
implementation of the package to possibly get ideas on how to make it work

Ted Ersek

Download Mathematica tips, tricks from

  • Prev by Date: Re: Random Sampling Without Replacement?
  • Next by Date: Re: Random Sampling Without Replacement?
  • Previous by thread: Re: Plotting complex points
  • Next by thread: Re: Expansion Coefficients in Multivariable Series Expansions?