NousRandom -- Intelligent Randomness
API Details
Unique Numbers
Copyright 2016 Scott Michael Doctor
NousMind, NousCrypt, and NousRandom are trademarks of Scott Michael Doctor
Patents Pending
The Unique Numbers API creates a list of numbers that are drawn without replacement. The process uses The Scrambler algorithm which is described in my Theory Paper. The technique creates a table of all possible values, then scrambles the table. This creates a randomized list of numbers where each possible number is drawn exactly once. The API can create a list of integers or equally spaced floating point numbers.

The following are the API commands for Unique Numbers:

uniqint -- This is one of two possible process id. The uniqint id specifies that you want a list of unique integers.

uniqflt -- This is one of two possible process id. The uniqflt id specifies that you want a list of equally spaced floating point numbers.

min=n -- Sets the minimum value for scaling the numbers. Default: -1.0
n
is any number specified by an integer, floating point decimal, or scientific notation number. min and max cannot be equal.  You must set a value for max if setting a value for min.

If using uniqint, (max-min) must be equal or greater than 1. Note that although n may be a floating point value, when using uniqint, only its integer value is used. The number is not rounded. The fractional part is truncated. For example, if n is set to 4.9, then min will be assigned the value 4.

max=n -- Sets the maximum value for scaling the numbers. Default: 1.0
n
is any number specified by an integer, floating point decimal, or scientific notation number.  min and max cannot be equal.

If using uniqint, (max-min) must be equal or greater than 1. Note that although n may be a floating point value, when using uniqint, only its integer value is used. The number is not rounded. The fractional part is truncated. For example, if n is set to 4.9, then min will be assigned the value 4.

If you set max without setting min, the scaling will be set to +/- the value of max. For example, if max=3 without specifying a value for min, then min will be set by the API to -3.

The value of max should be the greater than the value of min. However, the API always checks both values and if it finds that max is less than min, then the API will swap their values.

cnt=d -- Sets the total count of numbers in the list. Default: 1
The cnt command is only used with the uniqflt command. It defines the total count of numbers in a list of unique floating point numbers. It is used to calculate the spacing between max and min numbers. The value is ignored if using uniqint. The spacing between floating point numbers is calculated by (max-min)/cnt.

If using uniqint, the value of cnt is set by the API to (max-min)+1;

d
is a positive integer greater than zero. A negative value for d returns an error. The value of d can be a floating point number. However, only the integer value of the number is used. For example, a value of 4.9 will set the value of cnt to 4. The API does not round the value, simply truncates the fractional part. The maximum count of numbers per request is 100,000.

draw=d -- Sets the count of numbers to send from the unique list.  Default: draw = cnt
The draw command specifies how many numbers to return from the scrambled list of numbers. This is used to limit the length of the sent list when only a portion of the list is needed. The drawall option will send the entire list. If using drawall, the API ignores the value of draw. The entire list is created and scrambled regardless of the value of draw.

d is a positive integer greater than zero. A negative value for d returns an error. The value of d can be a floating point number. However, only the integer value of the number is used. For example, a value of 4.9 will set the value of cnt to 4. The API does not round the value, simply truncates the fractional part. The maximum count of numbers per request is 100,000.

drawall -- Tells the API to send the entire scrambled unique numbers list. Default: OFF
Tells the API to send the entire list of scrambled unique numbers. This command overrides any value set by the draw command.

cols=d -- Sets the number of columns per row. Default: 1
d is a positive integer greater or equal to zero. A negative value for d returns an error. The value of d can be a floating point number. However, only the integer value of the number is used. For example, a value of 4.9 will set the value of cols to 4. The API does not round the value, simply truncates the fractional part.

If cols is set to 0, then all of the numbers will be sent in a single line.
If cols is greater than the value of cnt, then cols is set by the API to the value of cnt.

The following are common formatting options. Full details are on the Results Formatting page.

nohtml -- disables sending HTML tags. The tags are used for proper display in a web browser. HTML tags are not used if the numbers are sent as a text file.

astextfile -- Send the numbers as a text file. If the total count of numbers sent exceeds 16384, then the numbers will always be sent as a file.

asbinaryfile -- Send the numbers as a flattened binary file. The API converts each number into the resolution number of binary encoded bytes as read left to right. For example, if using hex32, the first byte of the file is the left most hex pair of its text representation. Binary files do not use any formatting.

csv -- Separate columns of numbers with a single space character.

csvq -- Same as csv with each number surrounded by the double quote character.

json -- Sends the numbers as a JSON array. See the Results Formatting page for details.

jsonq -- Same as json with each number surrounded by the double quote character.