University Discrete Math · Sheet 07 of 9 All 9 sheets →
  1. Home
  2. Worksheets
  3. University Discrete Math
  4. Counting Techniques
University Discrete Math Counting Techniques Free · no sign-up

University Discrete Mathematics — Counting Techniques Worksheet

Six ways of counting, and the judgement about which one a sentence is asking for. The sum and product rules, on subsets, relations and divisors; the pigeonhole principle, where the work is naming the boxes rather than doing arithmetic; permutations, and the injective functions that are the same thing in other words; combinations, bit strings and lattice paths; the binomial theorem and Pascal's identity, used to get a coefficient without expanding anything; and counting with repetition, where the objects are identical and the formula changes. Have a look on this page, then print the free PDF when you want to write on it.

Page 1 of the University Discrete Math Counting Techniques practice worksheet

Practice worksheet — free PDF

6 pages 11 questions Letter size, print-ready

No email, no account, no watermark. Teachers: photocopy it for your classes freely. Worked solutions and 7 harder problems come with the University Discrete Math bundle.

All 11 questions

Each question targets one named concept from the sheet. Read them here, or print the PDF — it has working space under each one.

  1. Q1The Sum and Product Rules

    Let A={1,2,3,4}. A relation on A is any subset of A×A.

    1. How many relations on A are there?
    2. How many of them are reflexive, that is, contain (a,a) for every aA?
    3. How many of them are symmetric, that is, contain (b,a) whenever they contain (a,b)?
    4. How many subsets of {1,2,,10} contain 1 but do not contain 2?
  2. Q2The Sum and Product Rules
    1. Given 720=24·32·5, how many positive divisors does 720 have?
    2. How many of those divisors are even?
    3. How many positive integers less than 1000 have every digit odd?
  3. Q3The Pigeonhole Principle
    1. What is the least number of integers that must be chosen from {1,2,,30} to guarantee that two of them leave the same remainder on division by 7? Show that one fewer is not enough.
    2. 58 students each choose one of 5 project topics. What is the largest number of students that is guaranteed to share a topic, whatever they choose?
    3. How many students would there have to be to guarantee that at least 15 of them share a topic?
  4. Q4The Pigeonhole Principle

    A set S of 7 integers is chosen from {1,2,,12}.

    1. Explain, naming the pigeons and the boxes, why S must contain two consecutive integers.
    2. Give a set of 6 integers from {1,2,,12} with no two consecutive, and say what this shows about part (a).
  5. Q5Permutations
    1. How many permutations of {1,2,,8} are there?
    2. In how many of them do the four even numbers occupy the first four positions?
    3. In how many of them is 1 immediately followed by 2?
    4. How many injective (one-to-one) functions f:{1,2,3}{1,2,,8} are there?
  6. Q6Combinations

    A bit string is a string of 0s and 1s.

    1. How many bit strings of length 12 have exactly five 1s?
    2. How many bit strings of length 12 have at least ten 1s?
    3. How many 4-element subsets of {1,2,,12} have largest element 9?
  7. Q7Combinations

    A lattice path from (0,0) to (7,4) is a sequence of unit steps, each one to the right (+1,0) or up (0,+1).

    1. How many lattice paths go from (0,0) to (7,4)?
    2. How many of them pass through the point (3,2)?
    3. How many of them avoid (3,2)?
  8. Q8The Binomial Theorem and Pascal's Identity
    1. Find the coefficient of x5y3 in the expansion of (2xy)8.
    2. Find the term independent of x in the expansion of (x2+3x)6.
    3. Find the coefficient of x4 in (1+x)6(1x)2.
  9. Q9The Binomial Theorem and Pascal's Identity
    1. Given (156)=5005 and (157)=6435, find (167) and (169) without computing any factorial.
    2. Find the integer n5 with (n3)=(n5).
    3. Evaluate k=08(1)k(8k)38k.
  10. Q10Permutations and Combinations with Repetition
    1. How many solutions does x1+x2+x3+x4=15 have in nonnegative integers?
    2. How many of those solutions have every xi2?
    3. How many different strings can be formed by rearranging all the letters a,a,b,b,b,c,c,c?
  11. Q11Synthesis — drawing on several topics in this unit

    Count the functions f:{1,2,3,4}{1,2,3,4,5,6} that are

    1. arbitrary;
    2. injective;
    3. strictly increasing, f(1)<f(2)<f(3)<f(4);
    4. nondecreasing, f(1)f(2)f(3)f(4).

The 7 challenge problems for this topic are a separate, paid sheet and are not reproduced here.

What does this set assume? This set assumes Secondary 5 mathematics only — no calculus and no linear algebra, whatever a calendar lists as a prerequisite — plus comfortable algebraic manipulation and the exponent laws. From the earlier University Discrete Mathematics sets it leans on Sets, Functions and Relations, because half of what is counted here is a set of subsets or a set of functions and the words injective, subset and ordered pair are used without being redefined, and on Methods of Proof, because a pigeonhole argument and a counting argument are proofs and are marked as such. Probability is not in this course at all: a question here may ask how many, never how likely, and no sheet mentions an outcome, an event or a sample space. The counting is the technique and the proof, not a tool for something else. Inclusion–exclusion, derangements and counting problems modelled by a recurrence come later, in Recurrence Relations and Advanced Counting; generating functions are out of the course entirely.

Which course is this for? In the public course calendars of Montreal universities, this material is part of the courses numbered MATH 240, MAT1500 and MAT210. Each course orders and weights the topics its own way, so check your own outline for what your exam covers. Which sets match your course.

How to do every concept on this sheet

This is the part worksheet sites usually leave out. Below is the actual reasoning behind each group of questions — not a full solution set, the decisions that get you to one. Read it before you start, or after you get stuck.

The sum and product rules

Every count in this set begins with one question about the thing being counted: is it built by a sequence of independent decisions, or does it split into cases, exactly one of which happens? Decisions in sequence multiply; cases add. Nothing else on this sheet is new.

Setting up a count

Three moves, before any arithmetic.

  1. 1
    Describe one object completely

    What exactly are you counting — a subset, an ordered pair, a divisor, a string? Write down what someone would have to tell you to specify one of them.

  2. 2
    Turn that description into decisions

    One blank per decision, in order, each with its own number of choices. If two decisions interfere, reorder them so the constrained one comes first.

  3. 3
    Multiply the blanks, and add across cases

    If the objects fall into kinds that cannot overlap, count each kind separately and add. Overlap is what makes adding wrong.

Q1 counts relations on a four-element set, and the whole question turns on the definition it gives you: a relation is a subset of A × A. So one decision per ordered pair — in or out — and the count of subsets of any finite set is a product of two-way choices. Q1(b) and Q1(c) add a constraint, and the method is the same in both: sort the ordered pairs into those the condition forces, those it leaves free, and those it ties to each other so that one decision settles two pairs at once. Reflexivity forces a pair; symmetry ties (a, b) to (b, a). Count the free decisions, not the pairs. Q1(d) is the same idea on plain subsets: two elements are decided for you, and the rest are free.

A divisor is a choice of exponents. Q2(a) hands you a prime factorization, and that is the whole method: by unique factorization, a positive divisor is built by choosing an exponent for each prime, independently, anywhere from zero up to the exponent in the factorization. Count the choices per prime and multiply. Q2(b) keeps the structure and shrinks one range — "even" is a condition on one prime's exponent and on nothing else.

Q2(c) is where the sum rule earns its place. "Less than 1000" is not one shape, it is three (one-digit, two-digit, three-digit), and those cases do not overlap, so count each with the product rule and add. Decide before you start whether a leading zero would count an object twice — that decision, made explicitly, is what keeps the cases disjoint.

The pigeonhole principle

The principle itself is one line: if more objects than boxes are placed into boxes, some box holds two objects. All the difficulty is in choosing the boxes, and a proof that does not name them is not a proof.

n objects in k boxes, n > k ⇒ some box holds at least two generalized: some box holds at least ⌈n/k⌉ objects

Q3(a) tells you what the boxes are — the possible remainders on division by 7 — so the work is counting them, stating the principle in the form "one more than the number of boxes forces a repeat", and then doing the second half, which is the half students skip: showing that one fewer is not enough. That takes an explicit selection with all remainders different. A bound is only proved least when both halves are there.

Two directions, two formulas. Q3(b) fixes the objects and the boxes and asks how full the fullest box must be: that is the generalized principle read forwards, ⌈n/k⌉. Q3(c) fixes the boxes and the required fullness and asks for the objects: read it backwards instead. If every box held at most m − 1 objects, the total would be at most k(m − 1), so k(m − 1) + 1 objects force some box to m. Derive the second from the first rather than memorizing two formulas that look alike.

Q4 gives you neither. Seven integers are chosen from a twelve-element set and you must show two of them are consecutive, "naming the pigeons and the boxes" — so the pigeons are the chosen integers, and the boxes are yours to invent. Design them against two requirements at once: there must be fewer boxes than chosen integers, and two integers that land in the same box must be consecutive automatically. Partition the whole set of twelve so that both hold, and the argument is three lines.

An example is a claim about sharpness, not a second answer. Q4(b) asks for a six-element selection with no two consecutive and then for a sentence about what it shows. The sentence is the marked part: an explicit selection of that size proves the threshold in part (a) cannot be lowered, so seven is not merely sufficient but least. Give the example and say what it rules out.

Permutations

A permutation is an ordered arrangement. n! counts the orders of n distinct objects, and P(n, r) = n!/(n − r)! counts the ordered selections of r of them, because each position placed removes one object from the pool for the next.

n! = n(n − 1)(n − 2)···2·1, P(n, r) = n!/(n − r)!

Q5 runs four variations on one set of eight. Part (a) is the plain factorial. Part (b) restricts which values may sit in which positions, and the method is the product rule over two independent blocks: arrange the values that must occupy the first four positions among themselves, arrange the rest among the remaining positions, and multiply. Part (c) is the block trick: when one value must be immediately followed by another, glue the two into a single object, arrange the objects that remain, and ask whether the glued block has more than one internal order — here the order inside it is fixed by the word "followed", which is exactly the detail to notice.

An injective function is a permutation in other words. Q5(d) counts injective f: {1, 2, 3} → {1, 2, …, 8}. Specifying such a function means choosing f(1), then f(2) from what is left, then f(3) — an ordered selection of three values from eight, which is P(8, 3). Recognising a counting question hidden in function language is the skill Q11 tests again at the end of the set.

Combinations

A combination is an unordered selection: C(n, r) = n!/(r!(n − r)!). The test is always the same — would rearranging the chosen items give a different object? If not, divide out the r! orders.

Q6 works with bit strings, where the useful move is to stop thinking about strings and start thinking about positions. A string of length 12 with exactly five 1s is determined by which five of the twelve positions hold the 1s, so the count is a choice of a five-element subset. Q6(b) says "at least ten", which is not one combination but a union of disjoint cases — exactly ten, exactly eleven, exactly twelve — so count each and add by the sum rule. Q6(c) is the same conversion in the other direction: fixing the largest element of a subset decides one element outright and confines the rest to the values below it, so count the rest as a combination from that smaller range.

Lattice paths

Q7, in three moves.

  1. 1
    Turn a path into a word

    Every path from the origin to (7, 4) is a sequence of right and up steps. Count how many steps of each kind a path must contain, and how many steps in total.

  2. 2
    Count the words

    A word is determined by which of its positions hold the up steps, so the number of paths is a combination — the same argument as Q6(a), in different clothes.

  3. 3
    Split at the forced point

    Q7(b): a path through (3, 2) is a path to (3, 2) followed by a path from there onward. Count each leg the same way and multiply, and remember the second leg's step counts are differences.

"Avoid" means complement. Q7(c) asks for the paths that miss the point. Every path either passes through it or does not, so subtract the answer to (b) from the answer to (a). Writing the complement down explicitly — "all paths, minus the ones through the point" — is what turns a hard direct count into a subtraction you have already done.

The binomial theorem and Pascal's identity

The binomial theorem says that expanding (a + b)ⁿ means choosing, from each of the n factors, either a or b — so the coefficient of the term with k copies of b is the number of ways to choose those k factors.

(a + b)ⁿ = Σ C(n, k) aⁿ⁻ᵏ bᵏ, k from 0 to n

Finding one term without expanding

The routine behind all of Q8.

  1. 1
    Name a and b exactly as they appear

    In Q8(a), a and b carry their coefficients and their signs: the 2 and the minus belong inside a and b, not outside the formula.

  2. 2
    Write the general term

    C(n, k) aⁿ⁻ᵏ bᵏ, with everything substituted and the powers of x collected into a single exponent in k.

  3. 3
    Solve for k

    Set that exponent equal to the one you want — Q8(b) wants it equal to zero — and solve. A k that is not a whole number between 0 and n means no such term exists.

  4. 4
    Evaluate only that term

    One binomial coefficient and one power. Never expand the whole thing.

Q8(c) is a product of two expansions, so one exponent is no longer enough. Expand the smaller factor in full — it is short — and then collect: the coefficient of x⁴ in the product is a sum of products of coefficients whose exponents add to four. Write the two lists side by side and pair them off; that bookkeeping is the question.

Q9 is about the identities rather than the expansion. Pascal's identity builds a coefficient from the two above it, and the symmetry identity reflects one across the middle of its row:

C(n, k) = C(n − 1, k − 1) + C(n − 1, k), C(n, k) = C(n, n − k)

Q9(a) hands you two coefficients from one row and forbids factorials, so the only route is the two identities: one of them steps down a row, the other moves along it, and the second half of the question is reachable from the first only if you spot which reflection lands on it. Q9(b) is the symmetry identity used as an equation — two coefficients from the same row are equal when their lower entries are equal or when they add to the top entry, and the condition n ≥ 5 is there to tell you which solutions to keep. Q9(c) is the binomial theorem read from right to left: match the sum term by term against the expansion of (a + b)ⁿ, reading n off the upper index, b off the factor carrying the sign, and a off the remaining power. It collapses to a single power of a number.

Read the alternating sign as part of b. A factor of (−1)ᵏ is not decoration to be handled separately — it is what you get when b itself is negative. Folding it in is what makes the pattern match, and leaving it outside is why a sum like Q9(c) can look unfamiliar.

Permutations and combinations with repetition

Two formulas, and they solve different problems. Choosing r objects from n kinds, with repetition allowed and order irrelevant, is counted by C(n + r − 1, r), equivalently C(n + r − 1, n − 1); arranging n objects that are not all distinct divides the factorial by the orders inside each group of identical objects.

nonnegative integer solutions of x₁ + ··· + x₄ = n: bars among stars arrangements of a multiset: n!/(n₁! n₂! n₃!)

Q10(a) is the equation form, and the translation is the point: a solution is a way of distributing n identical units among four labelled variables, so picture n stars in a row with three bars dropped among them, the bars marking where one variable ends and the next begins. The count is then a choice of positions for the bars, which is an ordinary combination. Q10(b) adds a floor to every variable, and the move is substitution: give each variable its required minimum up front, set yᵢ equal to what is left over, and count the solutions of the smaller equation in the yᵢ — which has no constraint beyond nonnegativity, so part (a) applies unchanged.

Identical letters divide, they do not multiply. Q10(c) rearranges a string whose letters repeat. Pretend every letter is distinguishable and arrange them; then divide by the number of orders within each group of identical letters, because each distinct-looking string was produced that many times. The denominator has one factorial per repeated letter, and the exponents must add back to the length of the string — a fast check on the setup.

The synthesis question

Q11 counts functions from a four-element set to a six-element set under four conditions, and the four answers use four different tools from this set — which is why it is last.

Part (a) is the product rule: specifying a function means choosing an output for each input, independently, with nothing ruled out. Part (b) is Q5(d) again — an injective function is an ordered selection of outputs, so P(n, r). Part (c) is the one worth thinking about: a strictly increasing function is completely determined by the set of its four output values, because once you know which four values are used there is exactly one order they can appear in. So the count is a choice of a four-element subset, with no arrangement at all. Part (d) allows equality, which is repetition — the same four values may be reused — so it is Q10's question in function language.

Say why the correspondence is one-to-one. In an argument like part (c), the marks are for showing that each subset gives exactly one function and each function gives exactly one subset. A count justified by "this is the same as choosing a subset", with no sentence about why nothing is counted twice and nothing is missed, is an answer without its proof — and in this course the proof is the tier above the arithmetic.

Preview all 6 pages

Click any page to open the full PDF.

Page 1 of the University Discrete Math Counting Techniques practice worksheet
Page 1
Page 2 of the University Discrete Math Counting Techniques practice worksheet
Page 2
Page 3 of the University Discrete Math Counting Techniques practice worksheet
Page 3
Page 4 of the University Discrete Math Counting Techniques practice worksheet
Page 4
Page 5 of the University Discrete Math Counting Techniques practice worksheet
Page 5
Page 6 of the University Discrete Math Counting Techniques practice worksheet
Page 6

Getting the most out of it

Describe one object before you count them all

Write a sentence saying what someone would have to tell you to pin down a single object — one relation, one divisor, one path, one function. Almost every counting error is a count of something slightly different from what was asked, and the sentence is what exposes it.

Ask "does order matter?" and "may things repeat?"

Those two questions, answered out loud, select among the four formulas in this set: P(n, r), C(n, r), counting with repetition and the multiset arrangement. Answer them before writing any symbol, not after.

Count the complement when the condition says "at least" or "avoid"

Write the complement beside the event and count whichever is shorter, as Q7(c) invites. A single subtraction beats a union of cases, and it is the habit that keeps Q6(b)-style case lists short enough to be right.

Check a small count by listing it

When the numbers allow it, list the objects and compare the length of the list with the formula. A disagreement tells you which assumption about order or repetition was wrong, and the habit carries into the counts far too large to list.

Write the argument, not just the number

The pigeonhole questions and the correspondence in Q11(c) are marked as proofs: name the objects and the boxes, state the principle you are applying, and say why the correspondence misses nothing. A number with no argument under it is a guess that happens to be right.

Want the solutions, or something more challenging?

The worksheet, the questions above and every explanation on this page stay free permanently. Three more PDFs exist for this topic — the worked answer key, a harder problem set, and the answer key to that. They come with the University Discrete Math Solutions Bundle, beside the unit notes and the unit test, which is what keeps the rest of the series free.

What else exists for Counting Techniques

Three PDFs · 10 pages · all three are in the bundle below.

  • Answer key — 2 pages. All 11 questions worked step by step, including the restrictions and the justifications. Not a list of final answers.
  • Challenge problems — 6 pages, 7 problems. A separate sheet at exam-plus difficulty covering the same 6 concepts. Harder than anything on the free sheet.
  • Challenge answer key — 2 pages. Every challenge problem worked to the same standard, with the checks shown.
  • PDF, letter size, print-ready.
In the bundle See what's in it Not sold separately

The one thing that's for sale

Best value for the whole year

Every University Discrete Math topic — the complete Solutions Bundle

One download, one payment, the whole program. For all 9 University Discrete Math units: the worksheet, the reference notes, the challenge set, the unit test and every answer key — including this one.

9 units · 36 PDFs · 155 pages$24.99
  • Worked solutions, not answer lists — every step written out
  • Covers the whole year's program at this level
  • Less than the price of one hour of tutoring — for the entire year's solutions
Everything paid, in one file $24.99CAD · one payment University Discrete Math bundle — coming soon Not on sale yet

Taking Secondary 1 Math as well? The Secondary 1 Math bundle covers all 15 of its units — 106 PDFs, 474 pages — on the same terms.

Taking Secondary 2 Math as well? The Secondary 2 Math bundle covers all 14 of its units — 98 PDFs, 449 pages — on the same terms.

Taking Secondary 3 Math as well? The Secondary 3 Math bundle covers all 11 of its units — 77 PDFs, 367 pages — on the same terms.

Taking Secondary 4 Math as well? The Secondary 4 Math bundle covers all 17 of its units — 122 PDFs, 466 pages — on the same terms.

Taking Secondary 5 Math as well? The Secondary 5 Math bundle covers all 21 of its units — 147 PDFs, 589 pages — on the same terms.

Taking CEGEP Calculus I as well? The CEGEP Calculus I bundle covers all 9 of its units — 72 PDFs, 371 pages — on the same terms.

Taking CEGEP Calculus II as well? The CEGEP Calculus II bundle covers all 8 of its units — 64 PDFs, 335 pages — on the same terms.

Taking CEGEP Linear Algebra as well? The CEGEP Linear Algebra bundle covers all 7 of its units — 56 PDFs, 298 pages — on the same terms.

Taking University Calculus III as well? The University Calculus III bundle covers all 9 of its units — 72 PDFs, 516 pages — on the same terms.

Taking University Linear Algebra as well? The University Linear Algebra bundle covers all 9 of its units — 72 PDFs, 496 pages — on the same terms.

Taking University Differential Equations as well? The University Differential Equations bundle covers all 9 of its units — 36 PDFs, 182 pages — on the same terms.

Taking University Business Math as well? The University Business Math bundle covers all 9 of its units — 36 PDFs, 190 pages — on the same terms.

Taking University Introductory Statistics as well? The University Introductory Statistics bundle covers all 9 of its units — 36 PDFs, 186 pages — on the same terms.

Taking AP Calculus AB as well? The AP Calculus AB bundle covers all 8 of its units — 64 PDFs, 527 pages — on the same terms.

Common questions

Is this worksheet really free?

Yes — the questions are on this page to read, and the PDF downloads directly, no email and no account. The one paid item is optional: the complete University Discrete Mathematics Solutions Bundle, which covers every set at this level.

Which university courses is this for?

The course codes listed on this page are taken from the public course calendars of universities that teach discrete mathematics to mathematics, computer science and engineering students. Each course orders and weights the chapters its own way, and some reach a chapter late in the term or not at all — so check the outline for your own section to see where this set falls in your term.

What do I need to know before starting this set?

Secondary 5 mathematics, comfortable algebra, and the vocabulary of Sets, Functions and Relations — subset, ordered pair, injective. The proof techniques from Methods of Proof help, because the pigeonhole questions are marked as arguments rather than as answers.

How do I tell a permutation from a combination?

Ask whether swapping two of the chosen objects gives a different object. Positions in a string, the order of a queue, the values of a function in order: yes, so it is a permutation. A team, a subset, a set of positions holding a 1: no, so it is a combination, and the r! orders are divided out.

Why is choosing the boxes the hard part of a pigeonhole problem?

Because the principle itself is one sentence and it is always the same sentence. The boxes have to do two jobs at once — there must be fewer of them than there are objects, and two objects sharing a box must automatically have the property you are trying to force. Q4 is exactly that design problem with nothing given to you.

Do I ever need to expand a binomial to find one coefficient?

No. Write the general term C(n, k) aⁿ⁻ᵏ bᵏ with a and b substituted, collect the powers of x into one exponent, set it equal to the exponent you want and solve for k. Only that single term is then evaluated.

Is there any probability in this course?

No. This set asks how many, never how likely, and the whole course leaves probability to University Introductory Statistics. The counting here exists for its own sake and for the arguments built on it — the pigeonhole principle, combinatorial identities, and the recurrence models in the next set.

Where are inclusion-exclusion and derangements?

In the following set, Recurrence Relations and Advanced Counting, together with counting problems modelled by a recurrence. This set stops at the binomial theorem and repetition.

Can teachers use this in class?

Yes. Print and photocopy it for your own classes freely — I just ask that the tutorinmontreal.ca footer stays on the page.

I'm stuck on one question. Can you help?

Yes — through one-on-one tutoring, in Montreal or online. Get in touch to arrange a session, or see the current rates.

← All 9 University Discrete Math worksheets  ·  Secondary 1 Math series (15 sheets) →  ·  Secondary 2 Math series (14 sheets) →  ·  Secondary 3 Math series (11 sheets) →  ·  Secondary 4 Math series (17 sheets) →  ·  Secondary 5 Math series (21 sheets) →  ·  CEGEP Calculus I series (9 sheets) →  ·  CEGEP Calculus II series (8 sheets) →  ·  CEGEP Linear Algebra series (7 sheets) →  ·  University Calculus III series (9 sheets) →  ·  University Linear Algebra series (9 sheets) →  ·  University Differential Equations series (9 sheets) →  ·  University Business Math series (9 sheets) →  ·  University Introductory Statistics series (9 sheets) →  ·  AP Calculus AB series (8 sheets) →

Download the free worksheet

Ready to improve your grades?

WhatsApp is the way to reach me — tell me the course you're taking and what you're stuck on, and we'll sort out a first session from there.

Message Me on WhatsApp

or send a message

I reply within a day, usually sooner. Your details are used only to answer you — see the Privacy Policy.

Private math & science tutoring in Montreal, QC — Westmount · Outremont · Town of Mount Royal · Hampstead · Côte-Saint-Luc · NDG · Nuns' Island · West Island — and online across Quebec.

Chat with Marius