Let denote the set of arrangements with fifth, and those with sixth. Each contains arrangements, while their intersection contains . The inclusion-exclusion principle gives
For finite sets, the inclusion-exclusion principle states
An element present in of the sets is counted times, which explains the alternating corrections.
There are positive integers strictly below divisible by . For the divisors , the single counts are . Their pairwise intersections correspond to divisibility by , giving . The triple intersection has elements. Therefore
There are unrestricted placements, since one colour has occupancy vectors. For any specified empty box, the two remaining boxes admit placements. For any specified pair of empty boxes, the one remaining box admits one placement. All three boxes cannot be empty.
The inclusion-exclusion principle therefore gives
The empty-box events are not disjoint events, so subtracting their counts without restoring their pairwise overlaps would be incorrect.
Let be the number in box and put . We count integer compositions satisfying and . Without the upper bounds, stars and bars gives . If a specified , subtract five from it; the remaining nonnegative integer variables sum to one, giving possibilities. Two violations cannot occur because they would require a sum at least ten. The inclusion-exclusion principle therefore gives
The boxes are distinguished by their positions in the composition; individual objects are not distinguished.
Use the inclusion-exclusion principle on the multiples of in . The pairwise least common multiples are , and the triple least common multiple is . Therefore the count is
The endpoint is excluded, which is why the numerators are rather than .
Let be the set of permutations fixing object . If a specified collection of objects is fixed, the remaining objects can be arranged in ways. There are such collections. Applying the inclusion-exclusion principle to exclude all fixed objects gives
For , the terms and cancel. Thus the number of derangements is , interpreting the remaining sum as empty when . The full inclusion-exclusion formula also gives .
Let contain the multiples of among . Its cardinality is , using the floor function. Because are pairwise coprime, their pairwise intersections correspond to divisibility by , and their triple intersection to divisibility by . The inclusion-exclusion principle gives
For finite sets, the inclusion-exclusion principle states
Thus single-set cardinalities are added, pairwise-intersection cardinalities subtracted, triple-intersection cardinalities added, and so on.
Let and be the finite sets of objects satisfying the two properties. The rule of sum says that mutually exclusive alternatives have additive counts: if , then . Without disjointness, the corresponding inclusion-exclusion principle is
The rule of subtraction counts objects satisfying the first property but not the second:
In particular, if the objects with the second property form a subset of those with the first, the count is . These conditions prevent either double counting an overlap or subtracting objects that were not counted initially.
Percolation theory Created 2026-09-24 Updated 2026-10-14
Percolation theory asks how many local connections must be available before a large connected structure appears. Start with a graph, randomly retain some edges or vertices, and study the resulting percolation clusters. In independent bond percolation, every edge is open with probability , independently of the others. In independent site percolation, the random decisions concern vertices instead. A percolation cluster is a connected component of a graph formed by the available connections; an open path joins two vertices exactly when they belong to the same percolation cluster.
The attraction is that a local rule can produce a global change. One open edge says little about travel across a large graph. Many alternative graph paths can nevertheless make distant connections likely. The model separates the geometry of possible connections from the probability distribution of which connections are usable. This was the central perspective of Broadbent and Hammersley's 1957 paper, which discussed porous solids and disease transmission as interpretations of the same mathematical structure: [ref]. Independent bond percolation supplies a simplified model of those systems; the physical interpretation still requires justification of its independence assumptions.
For a completely calculable example, consider the four edges around a square and ask whether opposite corners and are connected. There are two graph paths, each using two edges. Each open path has probability . Their events are independent events because the paths share no edges, even though they share endpoints. The inclusion-exclusion principle therefore gives
At , the connection probability is , larger than the for either chosen graph path. Counting all sixteen equally likely edge configurations gives the same answer: two configurations with exactly two open edges, four with three, and one with four connect to . Connectivity benefits from alternative routes; adding their probabilities without subtracting their overlap would count the all-open configuration twice.
Figure 1.
Two alternative paths increase the probability of connecting opposite corners
. Details.
This finite calculation is already useful for studying redundant connections. The deeper question is what happens as the graph becomes arbitrarily large: does connectivity remain confined to finite percolation clusters, or can an infinite percolation cluster appear? The percolation probability and percolation critical probability make that question precise. A finite picture can illustrate the geometry, but cannot establish the existence of an infinite percolation cluster.
Probability measure Created 2026-09-24 Updated 2026-10-14
A probability measure is a nonnegative, countably additive measure with total mass one. Thus , and for pairwise disjoint events ,
The complement of an event has probability . The probability of a union of overlapping events needs a correction: . Counting the overlap once is the simplest instance of the inclusion-exclusion principle.
A zero-probability event need not be impossible as a member of the sample space. Under the continuous uniform distribution on , every individual point has probability zero, while the whole interval has probability one. Countable additivity applies to countable unions, not arbitrary uncountable ones; there is no contradiction.
Stars and bars counts tuples of nonnegative integers with a prescribed sum. For integers and , its statement is
Such a tuple is a weak composition of an integer. Think of labelled bins: counts identical objects in the first bin, in the second, and so on. Bin names distinguish positions even when counts agree. Stars and bars counts these count tuples; assigning individually distinct objects requires additional information. [ref]
Computed example. With and , the number of weak compositions of an integer is . The string ••|•|•• encodes : two dots before the first bar, one between the bars, and two after the second. For a fixed first-bin count , the second-bin count can be any integer from to and the third is forced. Thus the direct count is .
Figure 1.
Stars and bars for five identical objects and three labelled bins: ordinary splits, adjacent bars, and bars at either end
. Details.
Adjacent bars encode an empty middle bin: ••||••• gives . A bar at the left end encodes an empty first bin, as in |••|••• for ; a bar at the right end encodes an empty third bin, as in ••|•••| for . These are valid weak compositions of an integer. For every count is zero, and for the unique tuple is , consistent with .
Proof outline. Replace each count by that many dots and separate successive groups with bars. Reading the group sizes reverses this construction, so it is a bijection between weak compositions of an integer and strings of dots and bars. Choose the bar positions among positions; the binomial coefficient counts the choices. The beauty is that empty bins need no separate cases: end bars and adjacent bars encode them automatically.
If every bin must be nonempty, the tuples are compositions of an integer, and their count is for ; for there are none. Subtract one from every count, setting . This is a bijection to weak compositions of an integer of , so stars and bars gives . For five objects and three bins, this is , with the six positive tuples
For instance, shifts to , whose sum is . Sorting the six positive tuples collapses them to just two integer partitions, and . Thus named bins and unordered summands answer different questions.
Stars and bars is useful for allocating identical resources or enumerating integer solutions without listing them individually. Prescribed lower bounds can be subtracted just like the nonempty-bin requirement. Upper bounds require removing forbidden tuples; the existing bounded weak compositions article applies the inclusion-exclusion principle to those violations.
For nonnegative integers , the Stirling number of the second kind
counts the set partitions of an -element finite set into exactly unlabelled blocks of a set partition. Set , for , and for . Also for . Grassl and Levin develop these counts through explicit set partitions and a recurrence relation. [ref]
Insert one distinguished element. For and , the Stirling numbers of the second kind obey
Proof outline. Inspect the block of a set partition containing . If it contains another element, removing leaves a set partition into blocks of a set partition; conversely, insert into any of those blocks of a set partition. If is alone, remove its singleton set and obtain a set partition into blocks of a set partition. The cases cannot overlap, and deletion reverses each construction. This explains the factor even though the blocks of a set partition have no names. [ref]
For , start with the three two-block set partitions of . Inserting into either block of a set partition gives six possibilities. The remaining possibility is , obtained by making a singleton set. Hence . The seven set partitions in the diagram comprise four with sizes and three with sizes ; this grouping by sizes independently gives .
Figure 1.
Exact construction of all seven two-block set partitions of : six insert into an existing block of a set partition, and one creates a singleton set
. Details.
Three different counting questions. The binomial coefficient selects one -element subset. The Stirling number of the second kind groups all distinct elements into nonempty unnamed blocks of a set partition. The power counts all functions to a specified -element finite set, allowing some destination labels to go unused. At , these counts are respectively , , and . Choosing two people, making two unnamed nonempty teams, and assigning each person a red or blue label are different tasks.
When the destinations have labels. For fixed finite sets of sizes , respectively, the number of surjective functions is
Here every element of must be used. Each surjective function gives a set partition of into its nonempty preimages . Conversely, assign the distinct destination labels to the blocks of a set partition in ways, where is a factorial. For two labelled teams of four people this gives : of the assignments, exactly two use only one label. Dividing arbitrary function counts by fails in general because unused labels can be permuted without changing a function. For example, cannot count set partitions. The empty-to-empty function is a surjection, consistent with . Stanley gives the bijection underlying this qualification.[ref]
For example, the inclusion-exclusion principle counts the surjections from four elements to three labelled destinations as . Thus . An independent check chooses the only two-element block of a set partition in ways; the other two elements form singleton sets.
Why these numbers also occur in algebra. Classifying all functions to an -element finite set by the size of their image gives
For a fixed set partition, the falling factorial counts assignments of distinct labels to its blocks of a set partition, and is zero when . At , this reads . Replacing by yields a polynomial identity: both sides agree at every nonnegative integer. Thus the Stirling numbers of the second kind translate powers into falling factorials. Grouping by equal values turns a counting rule into an algebraic change of coordinates. Summing without destination labels instead gives the Bell number.
Two-toss sample space 2026-10-14
Model two fair independent coin tosses, recording their order. Here denotes heads and tails, and
The power set includes every question expressible as a subset of these four outcomes. The mass comes from the fairness and independence assumptions. These are exact model probabilities, rather than measured toss frequencies.
Let be the event that the first toss is heads and the event that the second toss is heads. Then
The union means “at least one head,” while the intersection means “both heads.” Their probabilities are and . Counting the union through the inclusion-exclusion principle gives ; alternatively its complement of an event is , of probability .
Figure 1.
Four ordered outcomes and the event of at least one head
. Rows record the first toss and columns the second. Each cell has probability under fair independent tosses. The highlighted union includes , , and ; the overlap contains only . Details.
On the same sample space, assigning masses to would still make each toss fair: . But , so the tosses would be dependent. The event of at least one head would have probability . Changing the probability measure changes the answer even when the sample space and the single-toss probabilities stay the same.