---
title: Inclusion-Exclusion
description: The principle of inclusion-exclusion is a counting technique for finding the size of the union of multiple sets. Learners will understand how to calculate probabilities and solve enumeration problems by correcting for overlapping elements.
category: mathematics
subcategory: combinatorics
difficulty: beginner, intermediate, advanced
url: /subject/inclusion-exclusion
---

# Inclusion-Exclusion

The principle of inclusion-exclusion is a counting technique for finding the size of the union of multiple sets. Learners will understand how to calculate probabilities and solve enumeration problems by correcting for overlapping elements.

## Available Resources

2 Books • 1 Courses • 4 Websites

## Websites

### 1. Art of Problem Solving Wiki

Community-maintained Art of Problem Solving wiki page stating the inclusion-exclusion principle and illustrating it with worked examples and competition problems. Readers learn to count the elements of overlapping sets without double-counting and apply the method to contest-style counting questions.

**Difficulty:** Beginner | **Price:** Free

**Link:** https://artofproblemsolving.com/wiki/index.php/Inclusion-exclusion_principle

**Tags:** inclusion-exclusion, combinatorics, counting, competition-math, set-theory

### 2. The Inclusion-Exclusion Principle — cp-algorithms

Derives the principle in set-theoretic and probabilistic form, proves it with binomial coefficients, generalises to elements in exactly r sets, then works eleven applications including derangements, coprime counting, bounded integer equations and lattice paths, each with complexity analysis and C++ code.

**Difficulty:** Intermediate | **Language:** English | **Price:** Free

**Link:** https://cp-algorithms.com/combinatorics/inclusion-exclusion.html

**Tags:** inclusion-exclusion, competitive-programming, combinatorics, algorithms, number-theory

### 3. Applied Combinatorics — Chapter 7: Inclusion-Exclusion

**Author:** Mitchel T. Keller, William T. Trotter

Chapter of an open-source undergraduate combinatorics textbook. Proves the inclusion-exclusion formula, then applies it to enumerating surjections, derangements and the Euler phi-function, closing with a discussion section and a graded exercise set.

**Difficulty:** Beginner | **Language:** English | **Price:** Free

**Link:** https://www.appliedcombinatorics.org/book/ch_inclusion-exclusion.html

**Tags:** inclusion-exclusion, combinatorics, derangements, euler-phi-function, open-textbook

### 4. Wolfram MathWorld

**Author:** Eric W. Weisstein

MathWorld is an online mathematics encyclopedia from Wolfram Research offering detailed, browsable articles on topics across the math spectrum, including algebra, geometry, calculus, and number theory. Each entry includes definitions, theorems, formulas, diagrams, worked examples, and links to further reading.

**Difficulty:** Intermediate | **Language:** English | **Price:** Free

**Link:** https://mathworld.wolfram.com

**Tags:** mathematics-reference, encyclopedia, abstract-algebra, number-theory, geometry

## Courses

### 1. Mathematics for Computer Science (MIT 6.042J)

**Author:** Tom Leighton, Marten van Dijk

Discrete mathematics for computer science with an emphasis on definitions and proofs: logic, induction, sets and relations, graph theory, modular arithmetic, asymptotics, counting and discrete probability. 25 lecture videos, problem sets and exams with solutions build fluency in writing proofs.

**Difficulty:** Intermediate | **Price:** Free

**Link:** https://ocw.mit.edu/courses/6-042j-mathematics-for-computer-science-fall-2010/

**Tags:** discrete-mathematics, mathematical-proofs, induction, graph-theory, combinatorics, discrete-probability

## Books

### 1. Introductory Combinatorics (Classic Version), 5th Edition

**Author:** Richard A. Brualdi

The single printed reference worth owning for this topic. Chapter 6 of the standard junior-level combinatorics text states the inclusion-exclusion principle, then applies it to combinations with repetition, derangements, permutations with forbidden positions, and Möbius inversion on partially ordered sets, with graded exercises.

**Difficulty:** Intermediate | **Language:** English | **Price:** Paid

**Link:** https://www.amazon.com/dp/0134689615?tag=edmonddante07-20

**Tags:** combinatorics, inclusion-exclusion, derangements, mobius-inversion, discrete-mathematics

### 2. Enumerative Combinatorics, Volume 1 (2nd edition, free author PDF)

**Author:** Richard P. Stanley

Author-hosted PDF of the second edition. Chapter 2, Sieve Methods, develops inclusion-exclusion, permutations with restricted positions, Ferrers boards, involutions and determinantal formulas; Chapter 3 places the principle inside Möbius inversion on posets.

**Difficulty:** Advanced | **Language:** English | **Price:** Free

**Link:** https://math.mit.edu/~rstan/ec/ec1.pdf

**Tags:** enumerative-combinatorics, sieve-methods, inclusion-exclusion, posets, mobius-inversion

---

*This content is part of Dantes.io - Your Treasure Map to Knowledge*

*Curated by humans at Dantes.io. Personal study use welcome; republishing this curation requires permission (team@dantes.io).*

View this page online: https://dantes.io/subject/inclusion-exclusion