Draft:Information theory/Permutations and combinations
THIS DRAFT IS BEING USED TO HELP ME EDIT Information theory/Permutations and combinations. DO NOT DELETE
The rate at which Template:Math increases for large Template:Math boggles the mind: Template:Math, and Template:Math But Template:Math, which likely outnumbers the number of atoms in the visible universe.
Suppose you have with the following collection of animal crackers: Two are Elephants, three are Crows, and two are Rats. How many seven-letter words can you make?
Combinations

Template:See also
The traditional view of combinations focuses on selecting k items from a collection (or set) of n items. In this discussion, the Template:Math items are positive integers, i.e., the set: . Rules of set theory[1] permit us to change the order of these Template:Math objects.[2] However for our purposes, these Template:Math objects (integers) are generally listed in the proper order because the integers denote the order in which the "letters" of a message are presented. In keeping with a parallel discussion of Shannon entropy, we associate the bins with Crow and Rat, using the notation Template:Math (
) and Template:Math (
). These refer to "letters" in a binary alphabet.[3]
Permute "Bin labels", not the order of the letters in the word
- Instead of placing the members of the set into "bins" , we shall instead permute "bin-labels" and attach them to the set Template:Math}
Simple example: 3-choose-2
This is equivalent to finding 3-choose-1. Our goal is to well to counting all the three-letter words that use Template:Math twice and Template:Math once. For reasons that will be understood later, we solve this problem attaching labels to letter that is used twice: As shown in the left-most column in Template:EquationNote, we begin by counting all Template:Math permutations of
The stationary columns represent Template:Math}, which are the order in which the letters appear. Equivalently Template:Math} represent the 3 distinguishable objects to be placed in either the C or R bins. The other two columns in the figure illustrate that there there is a two-fold redundancy in that each of the three combinations appears twice.[4]
Multinomial coefficients for non-binary alphabets
Application of the binomial theorem for Template:Nobreak, with Template:Math and Template:Math leads to the familiar result:
Template:EquationRefTemplate:Spaces
If more than two "bins" are involved, we define, and This results in a formula that is easier to remember and can be generalized to include counting the words that can be written with three or more letters:
Template:EquationRefTemplate:Spaces
Larger numbers: 5-choose-3



Template:EquationNoteillustrates how one can visualize the counting of 5-choose-3. As before, we begin with the 120 permutations of the 5 subscripted letters The goal is to organize these permutations in such a way that the duplicates associated with dropping the subscripts are accounted for. With 3-choose-1 the only duplicates involved the order of Crows ( versus ).
With 3 Crows and 2 Rats, we have ways to permute the Crows and permutations for the Rat. It is instructive to first consider how many of the 120 permutations are associated with a single word. Consider, for example all the ways subscripts can be added to the word that starts with two s, namely the word: :
well
Counting the words in Template:EquationNote, we see that there are 12 ways to attach our subscripts to Template:Math It can be shown that all words involving 3 Template:Maths and 2 Template:Maths can be subscripted in 12 different ways.
The product rule
It is instructive to closely examine how Template:EquationNoteenumerates the Template:Math ways that subscripts can be assigned to repeated letters in any given word. The Template:Math words are listed in two columns of six rows each. The first column places before , while the second column presents the Template:Maths in reverse order. Each of the six rows represents one of the Template:Math permutations of the subscripts Template:Math that are assigned to the Crows (these permutations were presented in Template:EquationNote.)[5]
The fact that all (six) ways to assign to subscripts to the three Crow letters is multiplied by all (two) ways to assign subscripts to the two Rat letters is known as the product rule.
This same element array of possible subscripts for Crow and Rat is also shown in Template:EquationNote. The boxed element at Template:Nobreak tells us the order in which the subscripted letters appear. The top three digits Template:Math informs us that the subscripted Crows follow the order . Meanwhile the lower pair Template:Math informs us that precedes .
Recap on efforts to count 5-choose-3
- We know from counting the permutations of Template:Math symbols that there are Template:Math ways to arrange the five subscripted letters .
- For any given five letter word (involving Template:Maths and Template:Maths) there are Template:Math ways to to separately[6] attach subscripts to the letters. Since these Template:Math versions of the word are identical if the subscripts are removed, we shall refer to these as duplicates of the word.
- This is all we need to calculate Template:Math.
Geometric "proof"
Template:EquationNoteillustrates how one can arrange the Template:Math permutation this collection. Taking the height to be an unknown, we create the box by stacking rectangles of Template:Math duplicates for each word. Since , we conclude that Template:Math is our desired result:
Template:EquationRefTemplate:Spaces
Algebraic proof and multinomial theorem
It is not difficult to extend the geometric argument associated with Template:EquationNoteto arbitrary values on Template:Math and Template:Math as as stated at Template:EquationNote. On the other hand, an important restriction results from using a three-dimensional box to account for duplicate words[7]. However, counting the words one can create with more than
On the other hand,
stophere
- There are Template:Math ways to permute[8] the subscripted version of RRCCC.
- Each combination (of 5-take-3) is duplicated 12 time if the subscripts are removed.
- ∴ The value of 5-take-3 is Template:Math
For reasons soon to be discussed, we express these ways as the product, . Since there there are Template:Math ways to permute the subscripted version of
Multinomials
Although the value of Shannon entropy is independent of how many letters are contained in the "alphabet", some users might wish to count how many words can be created by a non-binary alphabet. There are a number ways to do it
THIS SECTION NEEDS TO BE MOVED TO ANOTHER PAGE (MyOpenMath?)
File:Multinomial theorem mississippi.svg
Appendix
- ↑ In addition to Wikiversity's page Set theory, other wikis with good introductory pages are w:Simple:Set, b:Set Theory/Sets, and b:Discrete Mathematics/Set theory
- ↑ e.g., and are identical sets.
- ↑ Following the convention of Information theory/Shannon entropy the next "letter" would be E (
)
- ↑ ... depending on whether precedes or follows .
- ↑ In addition, Table 1 also distinguised between the even and odd permutations of 123 (see w:Parity of a permutation)
- ↑ By "separately" we mean subscripts {1,2,3) for Crow and (1,2) for Rat.
- ↑ i.e., words with the same letters but different subscripts
- ↑ Recall that "permute" means to rearrange the order. For example RCRRC is a permutation of RRCCC.