Print Friendly and PDF

Generate a Vector of Random Numbers

Ryan Roper -

This model addresses the need to randomly order a given number of indexed items. In this example, integers 1, 2, 3, ..., 11, 12 are stored in random order in an array, RandomizedIntegers. The number of integers to be randomized is based on the size of the array label set IntegerSet.

To use a different number of integers, simply edit the array label set IntegerSet to include more or fewer values. The set must start at 1 and include all integers between 1 and the maximum value. Because of the manner in which index values are sampled (see notes inside the container 'Randomizer') changing the size of the array label set is the only requirement.

Experience Level:

Advanced

Download the Model File:

 

Tags:

  • stochastic
  • vector
  • looping
  • array
Have more questions? Submit a request

Comments