MathGroup Archive 1994

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

Search the Archive

Re: Unique List

  • To: mathgroup at christensen.cybernetics.net
  • Subject: [mg371] Re: [mg358] Unique List
  • From: Benno Puetz <puetz at london.ks.uiuc.edu>
  • Date: Tue, 27 Dec 94 18:34:28 -0600

> I'm trying to simulate a lottery pick of 6 numbers between 1 and 42  

> but no repeats are allowed.  Any clever tricks to get a list with  

> no members repeated?

Try:

In[1]:= <<DiscreteMath`Combinatorica`

In[2]:= ?RandomKSubset
RandomKSubset[l,k] returns a random subset of set l with exactly k  
elements.

In[3]:= RandomKSubset[Range[1,49],6]

Out[3]= {7, 24, 34, 37, 41, 45}




  • Prev by Date: Re: Suggestions needed for Mathematica course
  • Next by Date: Re: Unique List
  • Previous by thread: Re: Unique List
  • Next by thread: Re: Unique List