You are here: Commands > Random

Random

Menu: Found in the TOOLS menu

Use the Random command to generate random numbers for use in programs other than Analyzer.

Random generates the specified number of random integers from a specified value range and displays them in columns. You can have Analyzer select unique values only (that is, no duplicates) and display the random numbers in ascending sort order.

Note: The maximum number of random values that may be generated is 32767.

Each random number generated is greater than or equal to the minimum value and less than the maximum value you specify. No random number is equal to the maximum value. For example, if you specify a minimum number of 0 and a maximum of 100, Analyzer will generate random numbers ranging from 0 to 99.

Parameters

In addition to the command parameters described below, the Random command has the following command parameters: To. For a description of these parameters, see Command Parameters. For a description of supported field modifiers see Field Modifiers.

Columns

Specifies the number of columns to be used to display the numbers. Enter a number or use the arrows to increase or decrease the number. Default: 6.

Maximum

Specifies the upper bound of the range under which the random numbers are generated. Any valid numeric value or expression is allowed. Maximum and Minimum must be specified together.

Note: The maximum number of random values that may be generated is 32767.

Minimum

Specifies the lower bound of the range over which the random numbers are generated. Any valid numeric value or expression is allowed. Minimum and Maximum must be specified together.

Number

Specifies the number of random numbers to be generated. Enter a number.

Seed

Specifies the starting point for the random number generator. If a Random command is duplicated with the same seed value, the random number sequence is reproduced exactly. Analyzer replaces a zero seed value with a random number. Default: Internally generated.

Sorted

Causes the output list of numbers to be displayed in ascending sort order. Default: Not sorted.

Unique

Causes only unique numbers to be included in the output. When you select Unique, each random number generated is compared to the entire list of previous numbers for this command. When duplication exists, the number is discarded without replacement.

Use Unique only when the range is at least 1/3 larger than the required number of samples. Default: Duplicates allowed.

Command Mode Syntax

RANDOM NUMBER=n

<SEED seed-value>

MINIMUM min MAXIMUM max

<UNIQUE>

<COLUMNS columns-in-output>

<SORTED>

<TO text-name|SCREEN>

<APPEND>¿

Examples

To generate 10 unique random numbers between 1 and 1000 sorted in ascending order, in 2 columns, use the Random command from the Tools menu.

The 10 random numbers generated are displayed in the Command Log. They are listed in sorted order from left to right reading from top to bottom. No number is repeated. If a duplication had occurred in this example, it would have been discarded and another number chosen.