Variations of this encoding can be obtained by counting inversions ("i","j") for fixed "j" rather than fixed "i", by counting inversions with a fixed smaller "value" rather than smaller index "i", or by counting non-inversions rather than inversions; while this does not produce a fundamentally different type of encoding, some properties of the encoding will change correspondingly. In particular counting inversions with a fixed smaller value gives the inversion table of "σ", which can be seen to be the Lehmer code of the inverse permutation. The usual way to prove that there are "n"! different permutations of "n" objects is to observe that the first object can be chosen in different ways, the next object in different ways (because choosing the same number as the first is forbidden), the next in different ways (because there are now 2 forbidden values), and so forth. Translating this freedom of choice at each step into a number, one obtains an encoding algorithm, one that finds the Lehmer code of a given permutation. One need not suppose the objects permuted to be numbers, but one needs a total ordering of the set of objects. Since the code numbers are to start from 0, the appropriate number to encode each object "σ""i" by is the number of objects that were available at that point (so they do not occur before position "i"), but which are smaller than the object "σ""i" actually chosen. (Inevitably such objects must appear at some position , and ("i","j") will be an inversion, which shows that this number is indeed "L"("σ")"i".) This number to encode each object can be found by direct counting, in several ways (directly counting inversions, or correcting the total number of objects smaller than a given one, which is its sequence number starting from 0 in the set, by those that are unavailable at its position). Another method which is in-place, but not really more efficient, is to start with the permutation of {0, 1, … } obtained by representing each object by its mentioned sequence number, and then for each entry "x", in order from left to right, correct the items to its right by subtracting 1 from all entries (still) greater than "x" (to reflect the fact that the object corresponding to "x" is no longer available). Concretely a Lehmer code for the permutation B,F,A,G,D,E,C of letters, ordered alphabetically, would first give the list of sequence numbers 1,5,0,6,3,4,2, which is successively transformed where the final line is the Lehmer code (at each line one subtracts 1 from the larger entries to the right of the boldface element to form the next line).