# Combinatorial Enumeration: Theory and Practice · PDF file Combinatorial Enumeration: Theory and Practice Gordon Royle Semester 1, 2004 Gordon Royle Combinatorial Enumeration: Theory

• View
29

0

Embed Size (px)

### Text of Combinatorial Enumeration: Theory and Practice · PDF file Combinatorial Enumeration: Theory...

• Subsets Permutations

Combinatorial Enumeration: Theory and Practice

Gordon Royle

Semester 1, 2004

Gordon Royle Combinatorial Enumeration: Theory and Practice

• Subsets Permutations

Counting Generating Ranking

k-subsets

For many applications we wish to only consider subsets of a fixed size — the k-subsets of an n-set.

There are two common orderings used to list k-subsets, shown here for 2-subsets of a 5-set.

I Lexicographic

12, 13, 14, 15, 23, 24, 25, 34, 35, 45

I Co-lexicographic

12, 13, 23, 14, 24, 34, 15, 25, 35, 45

Note: Here we are using 12 as shorthand for {1, 2}.

Gordon Royle Combinatorial Enumeration: Theory and Practice

• Subsets Permutations

Counting Generating Ranking

Enumeration

Theorem The number of k-subsets of an n-set is given by the binomial coefficient (

n

k

) =

n! k!(n− k)!

.

Proof. The number of sequences of k distinct elements from an n-set is

n(n− 1)(n− 2) · · · (n− k + 1).

Every k-subset will occur in k! different orders in this list of sequences, and so the total number of k-subsets is

n(n− 1)(n− 2) · · · (n− k + 1) k!

.

Gordon Royle Combinatorial Enumeration: Theory and Practice

• Subsets Permutations

Counting Generating Ranking

Binomial Identities

A significant area of “classical” combinatorics is the discovery and proof of the many binomial identities relating appropriate binomial coefficients.

For example, ( n

k − 1

) +

( n

k

) =

( n + 1

k

)

Many of these identities can be proved in two ways - an algebraic proof or a combinatorial proof.

Gordon Royle Combinatorial Enumeration: Theory and Practice

• Subsets Permutations

Counting Generating Ranking

Algebraic Proofs

Algebraic proofs simply involve manipulation of the formulas to get the stated identity. (

n

k − 1

) +

( n

k

) =

n! (n− (k − 1))!(k − 1)!

+ n!

(n− k)!k!

= kn! + (n + 1− k)n!

(n + 1− k)!k!

= (

n + 1 k

)

Gordon Royle Combinatorial Enumeration: Theory and Practice

• Subsets Permutations

Counting Generating Ranking

Combinatorial Proofs

A combinatorial proof aims to explain the identity, rather than simply verify it.

Suppose there are n + 1 objects, one of which is “distinguished” from the others. Any k-subset of this set either

I contains the distinguished object, or

I doesn’t contain the distinguished object.

There are (

n k−1

) sets in the first category and

( n k

) in the second

category and so the stated identity holds.

A combinatorial proof is usually viewed as conveying more information than an algebraic proof, but there are many situations where only an algebraic proof is known.

Gordon Royle Combinatorial Enumeration: Theory and Practice

• Subsets Permutations

Counting Generating Ranking

Exercise

Find a combinatorial proof of the following identity:

n∑ k=0

( n

k

)2 =

( 2n n

) Hint: Consider the 2n objects as consisting of two groups of n objects.

Gordon Royle Combinatorial Enumeration: Theory and Practice

• Subsets Permutations

Counting Generating Ranking

The odometer principle

Lexicographic order is related to the “odometer” principle used in a car odometer: increase the least significant digit if possible, and otherwise roll that digit over to 0 and increase the next least significant digit.

1 4 3 2 2 1 4 3 2 3

2 3 7 9 9 2 3 8 0 0

Gordon Royle Combinatorial Enumeration: Theory and Practice

• Subsets Permutations

Counting Generating Ranking

Representing a k-set

We will represent a k-set T by a sequence (or array) listing its elements in increasing order

t1 < t2 < . . . < tk,

which we can view as a sort of k-digit odometer

t1 t2 · · · tk

with strange properties.

Gordon Royle Combinatorial Enumeration: Theory and Practice

• Subsets Permutations

Counting Generating Ranking

Example: 3-subsets of a 7-set

This “odometer” starts at the smallest possible value

1 2 3

because no digits can be repeated.

Using the odometer principle is easy for the first few successors:

1 2 4 1 2 5 1 2 6 1 2 7

Gordon Royle Combinatorial Enumeration: Theory and Practice

• Subsets Permutations

Counting Generating Ranking

Successor of {1, 2, 7}

We cannot increase the last position any more, so we

I propagate the increase one position to the left, and

I put the lowest possible value in the last position.

1 2 7 1 3 4

If the next position over is already in its highest possible position, then the increase must be propagated further to the left:

1 6 7 2 3 4

Gordon Royle Combinatorial Enumeration: Theory and Practice

• Subsets Permutations

Counting Generating Ranking

In GAP

nextLex := function(T,n,k) local S,pos,i; pos := k; while (pos > 0) and (T[pos] = n+pos-k) do pos := pos-1;

od; if (pos = 0) then S := [1..k];

else S := T; S[pos] := S[pos]+1; for i in [pos+1..k] do S[i] := S[i-1]+1;

od; fi; return S;

end;

Gordon Royle Combinatorial Enumeration: Theory and Practice

• Subsets Permutations

Counting Generating Ranking

Ranking A ranking function is much less pleasant to calculate for this ordering — for example, consider finding the rank of {2, 5, 7} in the ordering of 3-subsets of a 7-set. This equivalent to finding the number of sets that occur before {2, 5, 7} in the ordering, which are the sets of the form:

1 ? ? 2 3 ? 2 4 ? 2 5 6

The key to counting these is to observe that the number of each type is just a binomial coefficient, and in fact we have(

6 2

) +

( 4 1

) +

( 3 1

) + 1 = 23.

Gordon Royle Combinatorial Enumeration: Theory and Practice

• Subsets Permutations

Counting Generating Ranking

Ranking (cont.)

The number of subsets before

t1 t2 · · · tk

is the sum of the numbers of subsets that

I · · · I Start with t1t2 · · · tk−1uk where uk < tk.

Gordon Royle Combinatorial Enumeration: Theory and Practice

• Subsets Permutations

Counting Generating Ranking

Ranking (cont.)

The number of subsets whose i lowest values are

t1 t2 . . . ti

is ( n− ti k − i

) because the remaining positions determine a k − i subset chosen from a set of size n− ti.

Gordon Royle Combinatorial Enumeration: Theory and Practice

• Subsets Permutations

Counting Generating Ranking

Ranking (cont.)

So, the number of subsets that start with u1, where u1 < t1 is

t1−1∑ j=1

( n− j k − 1

) with the index j running over all the feasible values for u1. Similarly the number of subsets that start with t1u2 is

t2−1∑ j=t1+1

( n− j k − 2

) again with the index j running over all possible values for u2 (notice that the lowest possible value for u2 is t1 + 1).

Gordon Royle Combinatorial Enumeration: Theory and Practice

• Subsets Permutations

Counting Generating Ranking

The final expression

The rank of the subset {t1, t2, . . . , tk} is

k∑ i=1

 ti−1∑ j=ti−1+1

( n− j k − i

) where t0 = 0.

(This is the kind of equation that you derive once, then program in a reusable manner and hope you never have to derive again!)

Gordon Royle Combinatorial Enumeration: Theory and Practice

• Subsets Permutations

Counting Generating Ranking

Colexicographic order

The other ordering on k-sets that is common is called colexicographic order. To determine this order, we represent a k-set by a sequence t1, t2, . . ., tk with the property that

t1 > t2 > · · · > tk.

Set Representative Set Representative

{1, 2, 3} 321 {1, 2, 4} 421 {1, 2, 5} 521 {1, 3, 4} 431 {1, 3, 5} 531 {1, 4, 5} 541 {2, 3, 4} 432 {2, 3, 5} 532 {2, 4, 5} 542 {3, 4, 5} 543

Gordon Royle Combinatorial Enumeration: Theory and Practice

• Subsets Permutations

Counting Generating Ranking

Colexicographic order (cont)

Colexicographic (colex) order is then defined by listing these representatives in normal lexicographic order:

321, 421, 431, 432, 521, 531, 532, 541, 542, 543

One of the important properties of colex order is that the ordering does not depend on n. More precisely, the colex ordering for the k-subsets of an n-set is the leading portion of the colex ordering for the k-subsets of an (n + 1)-set.

Gordon Royle Combinatorial Enumeration: Theory and Practice

• Subsets Permutations

Counting Ge ##### Combinatorial Enumeration in Chemistry FAMNIT-knjiga/ · PDF file 8 Combinatorial Enumeration in Chemistry BY A. MILICˇEVIC´a AND N. TRINAJSTIC´b a The Institute of Medical Research
Documents ##### Fast and Accurate Enumeration of Combinatorial · PDF file 2013-02-21 · Fast and Accurate Enumeration of Combinatorial Libraries Keith A Harrington, Julian Hayward & Roger Upton
Documents ##### Combinatorial Enumeration of Ragas (Scales of Integer ... baluk/raga_full.pdf · PDF file2 I. Introduction Ragas or scales of musical notes with a characteristic pattern of ascent
Documents ##### An introduction to randomized nickle/randAlg/Karp91.pdf · PDF fileKarp, R.M., An introduction to randomized algorithms, ... imate solution of combinatorial enumeration problems are
Documents ##### 106-Reporting Guideline 3 - ធនាគារជាតិ នៃ កម្ពុជា · PDF file 2013. 1. 9. · enumeration ALB enumeration AND enumeration ANT enumeration ARE
Documents ##### Combinatorial Enumeration: Theory and Practice · PDF file Gordon Royle Combinatorial Enumeration: Theory and Practice. Introduction Sets and Subsets All subsets Gray Codes Proof
Documents ##### CSM Week 1: Introductory Cross-Disciplinary Seminar Combinatorial Enumeration Dave Wagner University of Waterloo
Documents ##### ASC NEWSLETTER # 17| May 2019 · PDF file Jake Miller Lily Miller Noah Miller Connor O'Brien Phillip Pearce Elizabeth Parkinson Issy Royle Pat Royle Peter Royle Al Seaman Luke Stephens
Documents ##### Combinatorial Enumeration of Ragas (Scales of Integer ... · PDF fileCombinatorial Enumeration of Ragas (Scales of Integer Sequences) ... where, for example, there are 12 hexatonic
Documents ##### E–cient Enumeration of Combinatorial · PDF file1.3 Algorithms for Enumeration ... Sometimes a list of objects of a particular class is useful to search ... such exhaustive generation
Documents ##### Combinatorial Enumeration in Chemistry - sicmm. FAMNIT-knjiga/ · PDF file8 Combinatorial Enumeration in Chemistry BY A. MILICˇEVIC´a AND N. TRINAJSTIC´b a The Institute of Medical
Documents ##### Combinatorial Enumeration in Pascal’s › bmiceli › research › MajorsS16.pdf · PDF file Combinatorial Enumeration in Pascal’s Triangle How To Count Without Counting Brian
Documents ##### Minimal dominating sets in graph classes: combinatorial ... kratsch/publications/sofsem2012.pdf Minimal dominating sets in graph classes: combinatorial bounds and enumeration￿ Jean-Franc¸ois
Documents ##### Combinatorial Algorithms for the Design of · PDF fileCombinatorial Algorithms for the De- ... To improve the backtrack search, we introduced an enumeration ... well as the generation
Documents ##### A Java Library of Graph Algorithms and Optimization · PDF file... Combinatorial Algorithms: Generation Enumeration and Search Series Editor ... Computer algorithms. 3. Combinatorial
Documents ##### Classification of self-assembling protein nanoparticle ... 4 Nanoparticles and fullerenes An exhaustive enumeration of nanoparticle graphs is a combinatorial chal-lenge. We introduce
Documents ##### SYSTEMS OF FUNCTIONAL EQUATIONS AND INFINITE · PDF file 2012-11-26 · SYSTEMS OF FUNCTIONAL EQUATIONS AND INFINITE DIMENSIONAL GAUSSIAN LIMITING DISTRIBUTIONS IN COMBINATORIAL ENUMERATION
Documents ##### Skeletal Program Enumeration for Rigorous Compiler · PDF file programs makes SPE a unique and challenging combinatorial enumeration problem. Existing techniques for enumeration are
Documents ##### Royle House CT-1297 The Royle House (also known msa. ... Royle House CT-1297 9740 Old Solomons Island Road, Owings (Calvert County) 1920, private access The Royle House (also known
Documents Documents