Skip to main content
Logo image

In-Class Notes to Accompany Applied Combinatorics

Handout 7.1 Introduction; Counting Surjections

Overcounting. No, undercounting. Wait, overcounting! Hmm, undercounting?

Example 7.1. Revisiting an Old Problem.

How many lattice paths from \((0,0)\) to \((6,7)\) do not pass through \((2,3)\) or \((3,5)\text{?}\)
Solution.
We count all lattice paths from \((0,0)\) to \((6,7)\) and subtract those that path through either \((2,3)\) or \((3,5)\text{.}\) We do this by first subtracting those that pass through \((2,3)\) and then subtracting those that pass through \((3,5\)). However, this subtracts those that pass through both intermediate points twice, so we need to add back that number. This gives us
\begin{equation*} \binom{13}{6} - \binom{5}{2}\binom{8}{4} - \binom{8}{3}\binom{5}{3} + \binom{5}{2}\binom{3}{1}\binom{5}{3}\text{.} \end{equation*}
We need to introduce some notation:
  • A property \(P_{i}\) is something that an element of a set either satisfies or does not satisfy.
  • If \(\mc{P}=\{P_{1},\dots,P_{m}\}\) is a family of properties and \(S\subseteq [m]\text{,}\) then \(N(S)\) is the number of objects that satisfy \(P_{i}\) for every \(i\in S\text{.}\)
    • If \(S=\{1,2,5\}\text{,}\) then \(N(S)\) is the number of objects satisfying
Peer instruction question 1.

Activity 7.1.1.

A class of \(50\) students was polled to determine the programming languages in which they were proficient.
\(\#\) Language(s) \(\#\) Language(s) \(\#\) Language(s)
32 ALGOL60 12 ALGOL60 + PL/I 2 All 3
17 PL/I 17 ALGOL60 + COBOL
26 COBOL 3 PL/I + COBOL
How many of the students are proficient in none of the languages? Answer this question by doing the following:

Counting Surjections.

Definition 7.3.

A function \(f\colon X\to Y\) is called a surjection provided that for every \(y\in Y\text{,}\) there is at least one \(x\in X\) such that \(f(x) = y\text{.}\) Surjections are also called onto functions.

Definition 7.4.

The range of a function \(f\colon X\to Y\) is the set
\begin{equation*} \{y\in Y\colon \text{ there is }x\in X\text{ such that }f(x) = y\}\text{.} \end{equation*}
Peer instruction question 2.

Definition 7.5.

Let \(X\) be the set of all functions from \([n]\) to \([m]\text{.}\) We say \(f\in X\) satisfies property \(P_{i}\) if \(i\) is not in the range of \(f\text{.}\)
Peer instruction questions 3–4 followed by activity handout.
  • Formula will be provided to you on Test II and the Final Exam.
  • You will not be expected to derive this formula.
  • You will be expected to recognize when a counting problem calls for surjections and to use the formula in answers.