Generating random numbers

Concept Information

RANDOM command

You can use Analytics to generate a set of random numbers. You can specify certain parameters, such as the size of the set, and the range.

Typically, the set of generated values is used for applications outside Analytics, such as drawing a random selection of hard-copy files.

Note

If you require a random selection to be statistical valid or representative of the entire population, you need to follow a more formal sampling process. For more information, see Sampling data.

To generate random numbers:

  1. Select Tools > Generate Random Numbers.
  2. In the Main tab enter the following information:

    Number – The size of the set of random numbers to be generated.

    A maximum of 32767 numbers can be generated.

    Seed – Optional. The value used to initialize the random number generator.

    You can specify a seed value, or you can enter a seed value of ‘0’, or leave the seed value blank, if you want Analytics to randomly select a seed value.

    If you specify a seed value, it can be any number. Each unique seed value results in a different set of random numbers. If you respecify the same seed value, the same set of random numbers is generated. Explicitly specify a seed value, and save it, if you want to replicate a particular set of random numbers.

    Minimum – The smallest possible number in the set of random numbers. Any valid numeric value or expression is allowed.

    Maximum – The largest possible number in the set of random numbers. Any valid numeric value or expression is allowed.

    Columns – The number of columns used to display the set of random numbers. The default number of columns is 6.

    Unique – Specifies that only unique numbers are included in the set of random numbers.

    The default behavior is to allow duplicates in the set of random numbers.

    Note

    You should not select Unique when the specified size of the set of random numbers exceeds 75 percent of the range between Minimum and Maximum. Doing so can result in too many random number selections being discarded.

    Sorted – Specifies that the set of random numbers is displayed in ascending order.

    By default, the numbers are displayed in the order in which they are randomly selected.

    Append To Existing File – Specifies that the output results should be appended to the end of an existing file instead of overwriting the existing file.

  3. Click the Output tab.
  4. Select the appropriate output option in the To panel:

    Screen – displays the set of random numbers in the Results tab in the Analytics display area.

    File – saves the set of random numbers to a text file.

  5. If you selected File as the output type, specify the file name in the Name text box in the As panel, or click Name and browse to select an existing file.

    If the Append To Existing File checkbox is selected the output is appended to a file with the same name, if found, otherwise you are prompted to either overwrite the file or append the output.

    You can also specify an absolute or relative file path, or navigate to a different folder, to save or append the output to a file in a location other than the project location. For example: C:\Output\random.txt or Output\random.txt.

  6. Click OK.