Discrete Mathematics: Counting and the Pigeonhole Principle
Foundations of Combinatorics and Basic Counting Principles
- Combinatorics Overview:
- Combinatorics is the branch of discrete mathematics dedicated to the study of arrangements, configurations, patterns, and selections of objects within finite or discrete systems.
- Enumeration constitutes the fundamental core of combinatorics, focusing specifically on counting the total number of objects that satisfy defined collections of properties and constraints.
- Practical problem models addressed by enumeration include password complexity analysis (such as determining the total number of valid passwords composed of six, seven, or eight alphanumeric characters containing at least one digit), determining sample space and event cardinalities within discrete probability theory, and evaluating the exact time complexity and computational operation counts executed by algorithms.
The Product Rule and Extended Product Rule
The Fundamental Product Rule:
- If a procedure can be broken down into a sequence of two consecutive tasks, such that there are distinct ways to perform the first task, and for each of these choices there are distinct ways to perform the second task, then the total number of ways to perform the complete procedure is given by the product:
Elementary Two-Choice Examples:
- Office Allocation: Two individuals, Sanchez and Patel, must each be assigned a distinct office out of a total of available physical offices. Assigning an office to Sanchez yields independent possibilities. Following this choice, Patel must receive a different office, leaving exactly available choices. The total number of unique office assignments is:
- Chair Inventory Labeling: Each chair in an auditorium is assigned an identifier consisting of a single uppercase English letter followed immediately by a positive integer not exceeding . There are possible uppercase English letters and allowable integers (from to ). By the product rule, the maximum number of unique chair labels that can be generated is:
- Network Port Access: A computing facility houses microcomputers, and each individual microcomputer is equipped with communication ports. The task of specifying a port consists of first choosing one of the microcomputers ( options) and subsequently selecting one port on that chosen device ( options). The total number of distinct computer ports available across the center is:
The Extended Product Rule:
- Suppose a composite procedure consists of performing an ordered sequence of distinct tasks .
- If each task can be executed in ways, regardless of the individual choices made for all preceding tasks , then the total number of distinct ways to complete the entire sequence of procedures is given by the product of the individual counts:
Applications of the Product Rule
Bit String and Plate Encodings:
- Length-7 Bit Strings: A bit string of length consists of seven ordered positions, where each position can independently hold either a or a ( choices per position). The total count of unique length-7 bit strings is:
- Standard Vehicle License Plates: A state license plate consists of three uppercase English letters followed by three numeric decimal digits ( through ), where repetitions of characters are permitted and no letter sequences are banned. The first three character tasks each have possibilities, and the subsequent three digit tasks each have possibilities. The total number of possible license plates is:
Enumeration of Functions Between Finite Sets:
- Total Number of Functions: Let be a domain set containing elements, and let be a codomain set containing elements. A function must assign exactly one image element in to each of the elements in . Since each input element can be independently mapped to any of the available elements in , the total number of distinct functions is:
- Example: For a domain with elements and a codomain with elements, the total number of functions is:
- Total Number of One-to-One (Injective) Functions: A function is one-to-one if distinct elements in the domain map to distinct elements in the codomain ().
- If the domain cardinality exceeds the codomain cardinality (), no injective functions can exist; the count is identically .
- If , distinct codomain images are selected successively: the first element has image options, the second has , the third has , and in general, the -th input element has unused image choices. The total number of one-to-one functions is:
- Example: For domain elements and codomain elements, the number of injective functions is:
- Note on Onto (Surjective) Functions: Determining the number of onto functions requires advanced combinatorial principles, such as the generalized principle of inclusion–exclusion or Stirling numbers of the second kind.
Telephone Numbering Systems Comparison:
- Historical North American telephone numbering plans structure each 10-digit telephone number into a three-digit area code, a three-digit office code, and a four-digit station code.
- Defined digit sets: ( choices), ( choices), and ( choices).
- Old Plan (1960s Format:
NYX-NNX-XXXX): - Area code format
NYX: - Central office code format
NNX: - Station code format
XXXX: - Total unique telephone numbers:
- Later Plan (Expanded Format:
NXX-NXX-XXXX): - Area code format
NXX: - Central office code format
NXX: - Station code format
XXXX: - Total unique telephone numbers:
- Model Notes: These figures represent the historical counting baseline; secondary administrative constraints (such as reserved
N11service codes like 411 or 911) are excluded from the counting model.
Nested Loop Complexity Analysis:
- Consider an algorithm featuring deeply nested loops, where index variables step sequentially through positive integer upper bounds :
- Initial assignment:
k := 0 - Loop structure:
for i1 := 1 to n1 do for i2 := 1 to n2 ... for im := 1 to nm do k := k + 1 - The increment instruction executes precisely once for every unique integer -tuple in the Cartesian space.
- By the extended product rule, the total number of iterations and the resulting final value of the accumulator is:
Power Set Cardinality and Cartesian Products:
- Counting Subsets of a Finite Set: Let be a finite set with cardinality . Every subset corresponds uniquely to a characteristic bit string of length , obtained by fixing an arbitrary sequence of elements in . The -th bit is defined as if the -th element is present in , and if it is absent. Because each of the positions has independent choices, the cardinality of the power set is:
- Cartesian Product of Multiple Sets: Selecting an element from a Cartesian product requires picking one element from each constituent finite set in order. Consequently:
Genetic and Biological Information Encoding:
- Nucleotide Structure: DNA is composed of two anti-parallel nucleotide strands containing four nitrogenous bases: Adenine (), Cytosine (), Guanine (), and Thymine (). Canonical complementary base pairing enforces and . Single-stranded RNA replaces Thymine with Uracil (), producing complementary RNA pairs and .
- Amino Acid Codon Requirements: Cellular proteins are formed from linear polypeptide chains of amino acids. Modeling the biological genetic code requires encoding distinct amino acid types using strings composed of the four-letter base alphabet:
- A sequence of two bases generates only unique permutations, which is insufficient to encode all amino acid types.
- A sequence of three bases produces permutations, demonstrating that codons must consist of at least three consecutive nucleotides. Because , the genetic code exhibits redundancy, where multiple distinct base triplets encode the same amino acid.
- Genome Scales: A gene is a functional segment of DNA that encodes a protein; the sum total of an organism's genetic information packaged into chromosomes is its genome. The combinatorial space of potential nucleotide sequences of length over the four bases is :
- Algae and bacteria: Genome lengths span to base positions, corresponding to at least distinct theoretical base sequences.
- Insects, birds, and mammals: Genome lengths span to base positions, yielding at least distinct sequences.
- The human genome comprises approximately protein-coding genes, with each gene typically spanning or more nucleotide base positions. The assembly, mapping, and analysis of these vast sequences rely heavily on combinatorial algorithms in bioinformatics and computational biology.
The Sum Rule and Disjoint Alternatives
The Fundamental Sum Rule:
- If a task can be accomplished either by choosing one of ways or by choosing one of ways, and the set of the first options shares no common elements with the set of the second options (the options are mutually exclusive), then the total number of ways to perform the task is:
- Disjointness is a strict requirement; the alternatives must have zero overlap.
Disjoint Selection Examples:
- Committee Representative: A representative must be selected for a university committee who is either a member of the mathematics faculty or a declared undergraduate mathematics major. The faculty pool comprises members, while the student pool contains majors. Assuming no faculty member is simultaneously an undergraduate major, the two candidate pools are completely disjoint. The sum rule yields:
- Project Selection: A student chooses exactly one computer science project from one of three non-overlapping project lists containing , , and projects, respectively. Because no project appears on more than one list, the total number of selectable projects is:
The Extended Sum Rule:
- If a task can be performed by selecting from any of mutually exclusive alternatives, where the -th alternative can be carried out in ways, and no two alternatives share a common method, the total number of possibilities is:
Sequential Loop Complexity:
- Consider an algorithm where separate, non-nested
forloops execute consecutively, each updating a single shared counter variablek: - Initial setting:
k := 0 - Sequence:
for i1 := 1 to n1 do k := k + 1; for i2 := 1 to n2 do k := k + 1; ... for im := 1 to nm do k := k + 1 - Because each loop executes independently after the previous one finishes, each loop contributes exactly increments to the counter. By the sum rule, the final value of the variable is:
- Consider an algorithm where separate, non-nested
Set-Theoretic Formulation of the Sum Rule:
- Let be a collection of pairwise disjoint finite sets such that for all . The cardinality of their union equals the sum of their individual cardinalities:
If the sets are not pairwise disjoint, this equality fails, necessitating inclusion–exclusion corrections to prevent double-counting overlapping elements.
Applications of the Sum Rule and Complex System Models
Variable Names in BASIC:
- In a historical implementation model of the BASIC programming language, a valid variable identifier consists of either one or two alphanumeric characters, case-insensitive (letters through and digits through , giving alphanumeric characters).
- Syntax Constraints:
- The initial character must always be an alphabetic letter ( choices).
- If a second character is present, it can be any alphanumeric character ( choices).
- Exactly five specific two-character identifiers are reserved by the system language and cannot be used.
- Calculation by Disjoint Length Classes:
- Identifiers of length 1 (): Must be a single letter, so .
- Identifiers of length 2 (): Formed by one letter followed by one alphanumeric character, excluding the 5 reserved names:
- Since a variable name cannot simultaneously have length 1 and length 2, the alternatives are disjoint. The total number of valid identifiers is:
Password Design with Minimum Digit Constraints:
- Determine the total number of passwords that have a length of 6, 7, or 8 characters, where each character must be an uppercase English letter () or a decimal digit (), for a total of possible symbols, subject to the condition that every password must contain at least one digit.
- Complementary Counting Strategy for Length :
- Total unrestricted strings of length :
- Total invalid strings containing exclusively uppercase letters:
- Total valid passwords of fixed length :
- Evaluation per Length:
- For :
- For :
- For :
- Total Valid Passwords (Sum Rule across disjoint lengths):
Class-Based IPv4 Network Address Space:
- An Internet Protocol version 4 (IPv4) address consists of a 32-bit binary sequence partitioned logically into a network identifier (
netid) and a host identifier (hostid). - Modern internet routing historically evolved from class-based network architectures:
- Class A: Assigned prefix
0, uses 7netidbits and 24hostidbits. - Class B: Assigned prefix
10, uses 14netidbits and 16hostidbits. - Class C: Assigned prefix
110, uses 21netidbits and 8hostidbits. - Class D (Multicast): Assigned prefix
1110, uses 28 multicast group bits (excluded from host enumeration). - Class E (Reserved): Assigned prefix
11110, uses 27 reserved experimental bits (excluded from host enumeration). - Contrast with IPv6, which deploys 128-bit addresses to eliminate address exhaustion.
- An Internet Protocol version 4 (IPv4) address consists of a 32-bit binary sequence partitioned logically into a network identifier (

- Enumeration Model Restrictions:
- The Class A
netidconsisting of all 1s (network 127, reserved for loopback) is excluded from allocation. - Within every class,
hostidbit strings containing exclusively 0s (referencing the network itself) and exclusively 1s (reserved for local broadcast) are excluded.
- The Class A
- Address Computations per Class:
- Class A Host Addresses ():
- Class B Host Addresses ():
- Class C Host Addresses ():
- Aggregate Usable Host Addresses:
The Subtraction Rule and Principle of Inclusion–Exclusion
The Subtraction Rule:
- When a counting task can be satisfied by actions from either of two sets that are not mutually exclusive, simply summing their sizes counts elements in their intersection twice.
- The subtraction rule corrects for this double-counting by subtracting the size of the shared intersection. For finite sets and :
- This relation represents the principle of inclusion–exclusion applied to two sets, which generalizes to larger collections of sets.
Applications of the Subtraction Rule:
- Bit Strings with Affix Constraints: Count the number of 8-bit strings that either begin with the digit or end with the two digits .
- Let be the set of 8-bit strings beginning with . Fixing the first bit leaves free bits: .
- Let be the set of 8-bit strings ending in . Fixing the final two bits leaves free bits: .
- The intersection contains strings that both begin with and end with . This fixes three bits (), leaving free bits: .
- Applying the subtraction rule:
- Applicant Major Exclusions: A corporate hiring pool contains applicants. Among them, majored in computer science, majored in business, and held joint majors in both fields. To find the number of applicants who majored in neither discipline:
- First compute the total number of applicants majoring in at least one of these areas:
- Subtract this union from the total applicant pool:
The Division Rule and Equivalence Classes
The Division Rule:
- If a finite task or set has operational descriptions or representations, and exactly () of these descriptions correspond to each distinct outcome, then the total number of uniquely distinct outcomes is:
- Set Form: If a finite set is partitioned into disjoint equivalence classes or subsets, where every subset contains exactly elements, then the number of subsets is given by:
- Function Form: Let be a function mapping between finite sets. If every element has exactly distinct preimages in (that is, is a -to-one mapping), then the cardinality of the codomain is:
Circular Seating Permutations:
- Determine how many distinct circular seating arrangements exist for four individuals seated around a round table, where two arrangements are declared identical if and only if each person has the exact same left neighbor and right neighbor.
- First consider the four seats as distinct, labeled locations arranged clockwise. The number of linear permutations for four people in these labeled chairs is:
- Because the table is circular, shifting every person simultaneously by one, two, or three seats clockwise does not alter anyone's relative neighbors. Each distinct circular arrangement is counted exactly times among the labeled assignments (corresponding to the choices of who sits in the first labeled chair).
- By the division rule, the number of distinct circular seating arrangements is:
- Reflectional symmetries are not considered identical here, because flipping the table reverses each person's left and right neighbors, meaning mirrored configurations remain distinct.
Tree Diagrams in Sequential Decision Processes
Structure of Tree Diagrams:
- A tree diagram provides a visual representation of multi-step decision processes.
- The tree begins at an initial root node, and directed branches extend outward to represent available choices at each stage.
- Terminal nodes with no outgoing branches are called leaves, and each leaf represents a unique, fully realized final outcome.
- Tree diagrams are particularly useful when the number of choices available in subsequent stages depends on the specific decisions made in earlier stages.
Four-Bit Strings with No Consecutive Ones:
- Construct all 4-bit strings that contain no adjacent s (the sequence is prohibited).
- Branching Rules: From the root, the initial bit may be either or . Following a , branching allows either or . Following a , the next bit must be .
- Following all valid branches down to depth four produces exactly 8 leaves:

- Tournament Series (Best-of-Five Playoff):
- Two athletic teams compete in a playoff series that terminates as soon as one team wins three games.
- Every branch in the decision tree represents a game outcome (a win for Team 1 or Team 2). Any path stops as soon as either team accumulates three total victories.
- The series can terminate in 3, 4, or 5 games. Summing all valid terminal leaves on the tree yields exactly 20 distinct possible playoff sequences.

- Apparel Inventory Configuration:
- A souvenir retailer stocks "I Love New Jersey" T-shirts in five standard sizes: Small (S), Medium (M), Large (L), Extra Large (XL), and Double Extra Large (XXL).
- The available colors depend on the size:
- Sizes S, M, and L each come in four colors: White (W), Red (R), Green (G), and Black (B).
- Size XL comes in three colors: Red (R), Green (G), and Black (B).
- Size XXL comes in two colors: Green (G) and Black (B).
- Counting the leaves of the corresponding decision tree, or summing the colors across sizes, gives the total number of distinct shirts needed to stock every variety:

The Pigeonhole Principle (Dirichlet Drawer Principle)
- Basic Formulation:
- If pigeons fly into pigeonholes, at least one pigeonhole must contain two or more pigeons. If every pigeonhole contained at most one pigeon, the maximum number of pigeons that could be accommodated would be , contradicting the fact that .

Theorem 1 (The Pigeonhole Principle):
- Let be a positive integer. If or more objects are placed into boxes, then at least one box must contain two or more objects.
- Proof by Contradiction: Suppose every one of the boxes contains at most one object. Summing across all boxes, the total number of objects cannot exceed . This directly contradicts the hypothesis that there are at least objects present.
- Historical Nomenclature: This principle is also known as the Dirichlet drawer principle (Schubfachprinzip), named after the mathematician Peter Gustav Lejeune Dirichlet, who used it extensively. Earlier formulations include a 17th-century argument regarding residents of Paris sharing identical hair counts.
Biographical Profile: G. Lejeune Dirichlet (1805–1859):
- Dirichlet was born into a family of Belgian descent near Cologne, where his father served as a local postmaster.
- He showed early mathematical ability, using his allowance to purchase mathematics books. He entered secondary school in Bonn at age 12, attended the Jesuit College in Cologne at 14, and began advanced studies in Paris at 16.
- Dirichlet held academic appointments in Breslau (from 1825) and Berlin (from 1828), before succeeding Carl Friedrich Gauss at the University of Göttingen in 1855.
- He was known for carrying and studying Gauss's Disquisitiones Arithmeticae throughout his travels. His major mathematical contributions include the theorem proving the existence of infinitely many primes in arithmetic progressions where , resolving the case of Fermat's Last Theorem, and laying foundations in mathematical analysis. He was praised for the clarity of his teaching and was married to Rebecca Mendelssohn.

Corollary 1 (Mapping Cardinalities):
- A function mapping from a domain set containing or more elements into a codomain set containing elements cannot be one-to-one.
- Proof: Let such that and . For each element , define a box . The collection of these boxes forms a partition of . Since , the pigeonhole principle guarantees that at least one box contains at least two distinct domain elements with . Because , the function is not injective.
Elementary Examples:
- Shared Birthdays: A group of people must contain at least two individuals who share a birthday. There are at most possible birthdays in a leap year (including February 29), so treating the dates as boxes and the people as objects forces at least one duplicate.
- Initial Letters: Among any selection of English words, at least two must begin with the same letter, since the English alphabet contains only initial letters.
- Exam Scores: If an examination is scored using integer grades ranging from through , there are possible distinct scores. Therefore, a class must contain at least students to guarantee that at least two students achieve identical scores.
Decimal Multiples Composed Exclusively of Digits 0 and 1:
- Claim: Every positive integer possesses a non-zero multiple whose decimal expansion contains only the digits and .
- Proof for :
- Construct a list of integers composed solely of the digit 1:
- Under modular division by , there are only possible remainder values: {0, 1, 2, \dots, n - 1}.
- Since there are numbers and only possible remainders, the pigeonhole principle guarantees that at least two of these numbers must share the exact same remainder modulo :
- Subtracting the smaller number from the larger number leaves an integer that is an exact positive multiple of . Its decimal form consists of one or more 1s followed by one or more 0s:
- For negative integers (), the multiple obtained for satisfies the condition. For , the multiple satisfies the condition.
The Generalized Pigeonhole Principle
Theorem 2 (The Generalized Pigeonhole Principle):
- If objects are placed into boxes, where and are positive integers, then at least one box must contain at least:
- Proof by Contradiction: Suppose every box contains at most objects. The total number of objects in all boxes combined would then satisfy:
- (This uses the standard ceiling property \,).
- The total number of objects would be strictly less than , contradicting the fact that there are objects in total.
Minimum Elements Required to Guarantee a Target Box Size:
- To guarantee that at least one box contains at least objects when distributed among available boxes, the total number of objects must satisfy:
- The minimum integer that guarantees this threshold is:
- Proof of Minimality: If only objects are distributed, exactly objects can be placed into each of the boxes, leaving every box with fewer than objects. Adding one more object () must place an object into a box that already holds , bringing its total to .
Standard Examples of the Generalized Principle:
- Birth Months: Among any group of individuals, the number who share a birth month is at least:
- Grade Distribution Guarantees: Given the set of five standard letter grades {A, B, C, D, F} (), find the minimum class size needed to guarantee that at least six students receive the same letter grade ():
- A class of students could have exactly five students for each of the five grades, failing the requirement.
- Card Drawing from a Standard Deck: A standard deck contains cards divided equally into four suits (hearts, diamonds, clubs, spades) of cards each.
- To guarantee drawing at least three cards of the same suit (any suit), treat the four suits as boxes ():
- A hand of cards could consist of exactly two cards of each suit.
- To guarantee drawing at least three cards of a specified suit (such as hearts), the pigeonhole principle does not apply directly. An adversary could select all non-heart cards first. The next cards drawn must then be hearts:
- Area Code Capacity for Telephony: A growing region needs to allocate distinct phone numbers for million subscribers using the
NXX-NXX-XXXXplan, where a single area code provides capacity for local numbers. The number of area codes needed is: - Four area codes provide total capacity for numbers, which is sufficient.
Advanced Applications of the Pigeonhole Principle
Workstation-to-Server Bipartite Interconnections:
- A computing laboratory contains workstations () and centralized servers (). Each server can support only one active direct link at a time. The goal is to install direct cables between workstations and servers such that any arbitrary subset of at most workstations can simultaneously connect to distinct servers.
- A Working Configuration of 60 Cables:
- Connect workstation directly to server for ( cables).
- Connect each of the remaining five workstations () to all servers ( cables).
- Total cables installed: .
- Verification: Suppose a set of workstations is active. Let of them be from {W_1, \dots, W_{10}} and from {W_{11}, \dots, W_{15}}, with . Each of the workstations uses its dedicated server. This leaves servers completely free. Since , we have . The remaining workstations are connected to all servers, so they can freely take any of the available free servers.
- Proof that 59 Cables are Insufficient:
- Suppose fewer than cables are used (at most cables).
- The average number of cables connected to a server is at most .
- By the generalized pigeonhole principle, at least one server must be connected to at most workstations.
- This means there are at least workstations that have no direct cable connection to this particular server.
- If these specific workstations are active simultaneously, none of them can use that server. They must therefore share the remaining servers. By the pigeonhole principle, workstations cannot simultaneously connect to servers.
- Therefore, is the absolute minimum number of cables required.
Consecutive Game Sequences in Athletics:
- A baseball team plays at least one game every day over a -day month, playing at most total games. Prove that there must exist a sequence of consecutive days during which the team plays exactly games.
- Proof:
- Let denote the cumulative number of games played from the start of the month through day , where .
- Since the team plays at least one game each day, the sequence of cumulative totals is strictly increasing:
- Add to each term to generate a second strictly increasing sequence:
- Now combine both sequences into a single collection of positive integers:
- Every one of these integers lies within the range between and inclusive.
- By the pigeonhole principle, placing integers into possible values means at least two integers in the list must be equal.
- Because the terms within the first list are strictly increasing, no two elements of the first list can be equal. For the same reason, no two elements of the second list can be equal.
- Therefore, an element from the first list must equal an element from the second list:
- Rewriting gives:
- This means that exactly games were played during the consecutive period from day through day .
Divisibility Within Constrained Integer Sets:
- Let be a positive integer. Prove that among any collection of positive integers none of which exceed , there must exist at least one pair where one integer divides the other.
- Proof:
- By the fundamental theorem of arithmetic, any positive integer can be factored uniquely into a non-negative power of two multiplied by an odd integer:
- Since each integer satisfies , each odd part must be an odd positive integer strictly less than .
- The set of odd positive integers less than is: This set contains exactly elements.
- We have integers , but only possible odd parts.
- By the pigeonhole principle, at least two of the chosen integers, say and (), must have the exact same odd part :
If , then , which means .
If , then , which means .
In either case, one integer divides the other.
Monotonic Subsequences and the Erdős–Szekeres Result
Definitions of Subsequences and Monotonicity:
- Subsequence: For a given sequence of real numbers , a subsequence is an ordered selection of terms: The selected terms maintain their original relative order from the parent sequence.
- Strictly Increasing: A sequence is strictly increasing if each term is strictly greater than the one before it ().
- Strictly Decreasing: A sequence is strictly decreasing if each term is strictly smaller than the one before it ().
Theorem 3 (Erdős–Szekeres Monotonic Subsequence Theorem):
- Let be a positive integer. Every sequence of distinct real numbers must contain a subsequence of length that is either strictly increasing or strictly decreasing.
Worked Example ():
- Consider the sequence of terms (, so and ):
- Theorem 3 guarantees the existence of a monotonic subsequence of length at least .
- The strictly increasing subsequences of length 4 are:
- A strictly decreasing subsequence of length 4 is:
Proof of the Monotonic Subsequence Theorem:
- Let the sequence of distinct real numbers be denoted by .
- For each term , define an ordered pair of positive integers , where:
- is the length of the longest strictly increasing subsequence starting at .
- is the length of the longest strictly decreasing subsequence starting at .
- Contradiction Assumption: Assume that the sequence contains no strictly increasing or strictly decreasing subsequence of length .
- Under this assumption, for every index , both and must be integers between and :
- The set of all possible ordered pairs has size .
- There are terms in the sequence, so there are ordered pairs.
- By the pigeonhole principle, at least two terms in the sequence must be assigned the exact same ordered pair. That is, there must exist indices such that:
- Because all terms in the sequence are distinct, we must have either or :
- Case 1 (): Take the longest strictly increasing subsequence starting at (which has length ). Prepending to the front of this subsequence produces a valid strictly increasing subsequence starting at of length . Therefore, , which contradicts .
- Case 2 (): Take the longest strictly decreasing subsequence starting at (which has length ). Prepending to the front of this subsequence produces a valid strictly decreasing subsequence starting at of length . Therefore, , which contradicts .
- Both cases lead to a contradiction. Thus, the assumption is false, and there must exist at least one strictly increasing or strictly decreasing subsequence of length .
Ramsey Theory and Ramsey Numbers
Foundational Problem (Party of Six):
- Ramsey theory studies the emergence of regular patterns within sufficiently large mathematical systems. A classic problem examines a party of six people, where every pair consists of either mutual friends or mutual enemies.
- Claim: Any group of six people must contain either three mutual friends or three mutual enemies.
- Proof:
- Select an arbitrary person from the group, denoted .
- The remaining five people are partitioned into two sets: friends of and enemies of .
- By the generalized pigeonhole principle, dividing people into categories means at least one category must contain at least:
- Thus, must have at least three friends, or at least three enemies.
- Case 1 (At least three friends): Let three of 's friends be denoted , , and .
- If any pair among {B, C, D} are friends with each other (say, and ), then {A, B, C} forms a set of three mutual friends.
- If no two people among {B, C, D} are friends, then {B, C, D} must all be enemies with each other, forming a set of three mutual enemies.
- Case 2 (At least three enemies): Let three of 's enemies be denoted , , and .
- If any pair among {B, C, D} are enemies with each other (say, and ), then {A, B, C} forms a set of three mutual enemies.
- If no two people among {B, C, D} are enemies, then {B, C, D} must all be friends with each other, forming a set of three mutual friends.
- In all cases, the group must contain a triple of mutual friends or a triple of mutual enemies.
Ramsey Numbers Definition:
- For integers , the Ramsey number is defined as the minimum number of people at a gathering required to guarantee that there are either mutual friends or mutual enemies, under the assumption that every pair of people consists of either friends or enemies.
- In graph-theoretic terms, is the minimum number of vertices such that every edge 2-coloring (e.g., blue for friends, red for enemies) of the complete graph must contain either a monochromatic blue clique or a monochromatic red clique .
Exact Value of :
- The party problem above establishes the upper bound:
- A group of five people can avoid having three mutual friends or three mutual enemies. Arrange the five people in a circle where each person is friends only with their two immediate neighbors, and enemies with the two people not adjacent to them. In this arrangement, there are no three mutual friends (the friendship graph has no triangles) and no three mutual enemies (the enemy graph also has no triangles). This configuration shows:
- Combining these bounds gives the exact value:
Biographical Profile: Frank Plumpton Ramsey (1903–1930):
- Ramsey was the son of the president of Magdalene College, Cambridge.
- He studied at Winchester College and Trinity College, Cambridge. After graduating in 1923, he was elected a fellow of King's College, Cambridge, where he spent his academic career.
- His seminal 1930 paper, On a Problem of Formal Logic, introduced the combinatorial theorems that founded Ramsey theory.
- Beyond combinatorics, Ramsey made significant contributions to mathematical logic, philosophical foundations of mathematics, and theoretical economics (including seminal models of taxation and capital accumulation). He was married, had two daughters, and was active in English literature and politics. He died at the age of 26 from chronic liver disease.

General Properties of Ramsey Numbers:
- Symmetry: For all integers , swapping the roles of friends and enemies shows that:
- Base Boundary Condition (): For every integer , we have:
- Reasoning: In a group of people, either at least one pair is friendly (giving mutual friends), or no pair is friendly, which means all people are mutual enemies.
Historical and Computational Values:
- Computing exact Ramsey numbers is notoriously difficult due to the super-exponential growth of combinatorial configurations.
- Only nine exact non-trivial Ramsey numbers with are known.
- Known exact values include:
- For , the exact value remains unknown; the known theoretical bounds are:
- Most other combinations of parameters are known only in terms of broad upper and lower bounds.