Courses / Computer Science I
Discrete Mathematics

Counting and Combinatorics

Computer Science I 157 words Free to read

Counting Foundations

Combinatorics answers "how many ways?" for passwords, committees, and outcomes. Two basic rules build everything:

RuleMeaningOperation
Sum ruleMutually exclusive choices (mm or nn)m+nm + n
Product ruleSequential choices (mm and then nn)m×nm \times n

Common pitfall: Mixing up sum and product rules. Remember that "and" multiplies while "or" adds. Reaching for the wrong operation severely inflates or deflates your total count.

Permutations vs Combinations

The vital distinction is order. Rearranging chosen items creates a Permutation (P(n,k)P(n,k)) if order matters, but a Combination ((nk)\binom{n}{k}) if order is irrelevant.

Common pitfall: Using permutations when order doesn't matter. Combinations divide by k!k! to remove duplicate orderings.

Six arrangements collapse to three the moment order stops mattering

Practise this lesson

The explanation above is free to read. The graded practice for this lesson lives in the Tryals app.

9practice questions
2interactive scenes

Discrete Mathematics