The Permutation (PERM) software calculates permutation quantities for Base Numbers from 1-999 and Number of Digits from 1-99. If enabled, permutation number/name groups will also be generated and displayed.
Although permutation quantities increase exponentially as a function of Base ^ Digits, constraints such as Sort, Unique and Sum can be used to significantly reduce the number of permutations.
Note: All numbers must be Integers (whole numbers).
In addition to New, Save, and Print functions, the File menu provides Load Map File and Load Number File functions that can be used to load data for the Map Names and Number File options.
The Edit menu provides Copy, Select All and Edit Permutation Comments functions.
By selecting Edit Permutation Comments, 1 to 20 lines of text can be entered to document the Permutation setup data and options.
These comments and all data/option settings info can be saved using the Save Input menu item.
The Examples menu provides a number of examples with comments to demonstrate both basic and advanced features of the Permutation Generator.
Base Number / Number Count
This text box is used to specify the number base such as 2 (Binary),
8 (Octal) or 10 (Decimal).
For example, for Base Number:2 and Numbers:0 to Base# -1, numbers range from 0 to 1.
Note: If Numbers:Number File is checked, this text box is named "Number Count" and the text box indicates the number of lines in the Number File.
Number of Digits
This text box is used to specify the number of digits in each permutation.
For example, for Base Number:2, Numbers:0 to Base# -1, and Number of Digits:3, eight 3-digit permutations are generated: 000, 001 ... 111.
This text box is used to specify the number of groups within each permutation number.
The default "number of groups" is 1, that is the numbers of a permutation are NOT separated into groups.
Example: If the permutation is 123456, it will be displayed as "123456" if Groups is blank or "1". However if Groups is "2" the permutation will be displayed as "123 456".
The Groups number is also used with options Sort Groups and RevSort Groups.
This text box is used to specify the required arithmetic Sum of the digits in each permutation. The Sum number
is used to filter the permutations when Constraints:Sum is checked.
For example, for Base Number:2, Number of Digits:3, Numbers:0 to Base# -1, and Constraints:Sum:2 checked, three permutations whose digit sum=2 are generated: 011, 101, 110.
The Search box can be used to highlight names or numbers in the Output window. To search, enter the text to be found and then press the Enter key. This will highlight up to 100 instances of the Search text.
To clear all highlighting, delete all text in the Search box and press Enter.
Calculate Only - If this option is checked, permutation quantities are calculated but permutations are not generated. If this option is NOT checked, up to 2147 MB of permutation data can be generated.
Map Names - Replaces numbers (1 2 3) with letters/names/symbols (a b c Dog Cat Bird @ # $) listed in a standard ASCII text file.
Note: Replacement is done after the Sort/Unique/Sum filter steps. That is, Sort/Unique/Sum applies to the numbers, not the MapFile names which will replace the numbers.
Several example Map files are provided in the SSolver\bin\MapFile directory including a list of hexadecimal numbers 0-F, a list of alphabet letters a-z and a list of 90 animal names.
These options select the set of numbers used in the permutations:
0 to Base#-1 - The number set will range from 0 to the Base Number - 1
1 to Base# - The number set will range from 1 to the Base Number
Number File - The number set is the list of Integers in a Number File.
One number can be listed on each line of a standard ASCII text file. A maximum of 999 numbers can be specified.
Several example Number files are provided in the SSolver\bin\NumberFile directory including a list of even numbers and a list of odd numbers.
These options provide filters that can reduce, sometimes dramatically, the quantity of permutations generated:
Sort - Eliminates combinations whose digits are not in ascending sort order. This eliminates combinations with the same numbers arranged in a non-sorted order. For example: (1 2 3, 1 3 2, 2 1 3, 2 3 1, 3 1 2, 3 2 1) reduces to (1 2 3)
Sort Groups - Eliminates combinations whose digit-groups are not in ascending sort order. This eliminates combinations with groups having the same numbers arranged in a non-sorted order.
Reverse Sort - Eliminates combinations whose digits are not in descending sort order.
RevSort Groups - Eliminates combinations whose digit-groups are not in descending sort order. This eliminates combinations with groups having the same numbers arranged in a non-sorted order.
Unique - Eliminates combinations with duplicate numbers. For example: (1 1, 1 2, 2 1, 2 2) reduces to (1 2, 2 1)
Note: The Unique constraint applies to the permutation numbers, not the MapFile letters/names which will replace the numbers.
For example if a Mapfile has 4 letters "a b c b", then letters "a" and "c" will be unique while the letters "b b" will be treated as two different letters (such as "d e").
Sum - Eliminates combinations whose digits do not add up to the Sum number.
These options specify the spacing (if any) between permutation digits. Note that the Groups text-box number may also add a space between groups.
Space - Adds a space before each item in each row
Align - Right-justifies Numbers in each column, with a minimum of one space between each column. Left-justifies Mapped Names in each column, with a minimum of one space between each column.
These options specify the maximum storage space (in Megabytes) allowed for the permutations:
10 MB - Data is saved in RAM and then displayed in the Output Data window. This option is faster than the 50 MB, 250 MB, or Custom >= 250 MB options.
50 MB - Data is saved to hard disk and then displayed in the Output Data window
250 MB - Data is saved to hard disk. An external editor must be used to view the data
Custom MB - The Storage Limit can range from 1 to 2147 MB
- Data is saved to RAM or hard disk based on the 10/50/250 MB limits
To view or edit very large files, a file splitter may be useful.
For example, a 500MB file could be split into 10 50MB files. The following free Windows utility has been tested up to 2147MB:
fSplit.exe can be run from the Command line or as a Windows program.
Although the Permutation tool supports Base-Numbers up to 999 and Number-of-Digits up to 99, the number of permutations generated is limited to 2147 MB of data.
This is for practical limitations of size and time:
» Permutation data can quickly grow to a size too large for most text editors
» The data may also grow too large for any hard drive
» The time to generate a large permutation set may take hours or days
or weeks or years or eons...
Example: 5^20 (Base=5, Digits=20) has 95,367,431,640,625 permutations
» 10 MB of data is generated in about 1/2 second
This generates only 454,569 permutations
» If all permutations are generated, 95,367,431,640,625/454,569 =
209,797,482 half-second periods are required
This is 209,797,482/2 seconds = 104,898,741 seconds = 1,214 days
» The amount of storage required is 10 MB * 209,797,482 = 210 TB (terabytes)