DOWNLOAD Ranks


Introduction
Ranks is a program that assigns a sequential number (rank)
to a combination, permutation or partition.

Given a rank, the combination, permutation or partition may be generated.
Given a combination, permutation or partition, the rank may be calculated.

Ranks is freeware and may be copied without restriction.
Please refer to this website in this case.

Installation
Ranks ships as a single .exe file.
It contains In-Line help information.
The system is Windows 95 and up.
Minimum screen resolution is 600*800.

There is no installation procedure, just copy to a map of choice.
The Windows Registry is not changed.
The size is 268kB.

Combinations
A combination is a selection of elements from a set, where each element may be choosen once
and the sequence of selection is unimportant.
Elements are always named 1,2,3,4,......
The maximum number of elements is 50.

The ranking of combinations may be usefull in the analyses of lotto games or any case where
combinations have to be generated in a systematical way.

The number of possible combinations of k elements from a set of n is written as Below, all combinations of 2 elements from a set of 4 are listed
together with the rank of that combination.

There are 6 possible combinations, the ranks are 0 to 5.

Permutations
A permutation is a sequence of elements.
Elements are always named 1,2,3,4,....
The maximum number of elements is 12.

n elements have n! permutations, where n! = n.(n-1).(n-2)........(3).(2).(1)

Ranking a permutation is usefull when sequences have to be generated in a systematical way,
as is the case in logigram puzzle solving.

Below are listed all permutations of a set of 4 elements So, there are 24 permutations, ranked 0 to 23.

Partitions
A partition of a number n is a list of numbers which have a sum of n.
The sequence of the list is not important.

The maximal number is 50.

Ranking a partition may be usefull in cases where partitions have to be generated in a
systematical way, which is needed in the analyses of certain Nimm games.

Below are listed all partitions of the number 6, together with the ranks. Note, that the partitions are sorted.
Number 6 has 11 partitions, ranked 0 to 10.


How it works
Table below lists some type definitions and variables.

Note: faculties[n] is set to n! on creation of the form.
Note: elements[] holds the combination, permutation or partition.

number,choice and rank are the numeric values of edit components on the form.

Calculating the combination from a rank
Calculating the rank of a combination
Calculating the permutatation of a rank
Calculating the rank of a permutation
Calculating the partition of a rank
Calculating the rank of a partition
Note: I do not know a direct way to generate a partition from a rank.
Partitions are generated sequentially, starting from (rank) 0.