Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2013

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg129524] Re: Needing a Random List of Non-repeating Values whose
  • From: Tomas Garza <tgarza10 at msn.com>
  • Date: Sun, 20 Jan 2013 01:22:08 -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: <20130118055413.82B97691E@smc.vnet.net>

Good, but it is not new in v9. It dates back to v6 (cf. Help browser).
-Tomas

Date: Sat, 19 Jan 2013 00:13:21 -0600
From: brtubb090530 at cox.net
To: tgarza10 at msn.com
Subject: [mg129524] Re: Needing a Random List of Non-repeating Values whose Range and Length


 
   
 
 
    On 1/18/2013 2:41 PM, Tomas Garza
      wrote:

   
   
     
     
        Have you
          tried RandomSample?
       

         
        -Tomas
         

         

          > From: brtubb090530 at cox.net

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

            > To: mathgroup at smc.vnet.net

            > Date: Fri, 18 Jan 2013 00:54:13 -0500

            >

            > 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.

            >

         
       
     
   
    Thanks. Yes that new v9 function is the solution I needed.  It has
    since been pointed out to me by several others :>)

   

    --
Benjamin Robert Tubb, Finale Music Engraver
Owner of Public Domain Music
Email: brtubb at pdmusic.org
Website: www.pdmusic.org


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