Discrete Mathematics – Counting, Induction & Functions
Fundamental Counting Principles
• Sum/Addition Rule
– If a task can be accomplished by doing either in ways or in ways (and these choices are mutually exclusive), total number of ways .
– Generalizes to mutually–exclusive tasks done one‐at‐a‐time: .
– Classroom example ①: Choose either a boy (16 choices) or a girl (18 choices) from a class ⇒ ways.
• Product/Multiplication Rule
– If a procedure consists of performing (in ways) then (in ways), the ordered pair of tasks can be carried out in ways.
– Extends to successive tasks : .
– Example ②: 8 shirts and 5 pants give outfits.
• Inclusion–Exclusion for 2 Sets
– .
– Example ③: Prime <10: (4). Even <10: (4). 2 is common (1) ⇒ integers that are prime or even and $<10$.
Illustrative Counting Problems
• Library selection: 12 Maths, 10 Physics, 16 Computer, 11? Electronics ⇒ choices for one book.
• Code construction (2 letters + 2 digits)
– Repetition allowed: .
– Repetition disallowed: .
• License plate (4 letters followed by 2 even digits)
– If all 6 characters can repeat and vowels‐only restriction on letters:
* Vowels = 5 ⇒ possible plates.
• Couple party: choose 1 woman and 1 man from 20 married couples but not married to each other ⇒ .
• 8–bit byte enumeration
– Total bytes: .
– Begin with 11 & end with 11 ⇒ interior 4 bits free .
– Begin with 11 only ⇒ .
– End with 11 only ⇒ .
– Begin with 11 or end with 11 ⇒ (inclusion–exclusion).
Permutations
• Definition: Ordered arrangement of objects chosen from distinct ones:
.
• Special cases
– (arrange all distinct objects).
– With repetition of alike objects: for multiset sizes summing to , permutations .
• Seating 6 men & 6 women in a row
– No conditions: .
– Alternating sexes:
1. Fix the pattern M–W–M–⋯ or W–M–⋯ (2 ways).
2. Arrange 6 men ; arrange 6 women .
Total .
• Books on a shelf (4 Maths, 5 CS, 2 Control Theory)
– All books of the same subject kept together ⇒ treat each subject as a block ⇒ block permutations , internal orders ⇒ .
– Only Maths books together: treat the 4 maths as 1 block + other 7 singles ⇒ 8 objects ⇒ ways to arrange blocks, internal ⇒ .
• Word permutations
– “DIFFICULT” (9 letters; 2 F’s, 2 I’s) ⇒ forms.
– “MASSASAUGA” (10 letters; counts: A=4, S=3, others distinct) ⇒ .
• 4–digit numbers from digits 1,2,3,5,6,7
– All permutations (no repetition) .
– Evens: last digit even (2 or 6) ⇒ 2 choices, remaining 3 places ⇒ .
– Odds: similar logic ⇒ .
– Multiples of 5: last digit 5 ⇒ .
Combinations
• Definition: Unordered selection of objects from distinct ones:
.
• Committee with chairperson: choose chair in ways, other 4 members from remaining 11 ⇒ .
• Examination paper choice: Part A (4 Q’s), Part B (4 Q’s); answer 5 total with at least 2 from each part
– Case1: 2 from A & 3 from B ⇒ .
– Case2: 3 from A & 2 from B ⇒ same count .
– Total .
• Dinner invite problem: 11 close relatives, 2 specific people refuse to attend together.
– Total ways to pick any 5 out of 11: .
– Both absent: choose all 5 from remaining 9 ⇒ .
– Both present: fix the 2 ⇒ choose 3 more from 9 ⇒ .
– Valid selections (not together) (transcript lists 210 under alternative counting; adapt per given numbers).
Mathematical Induction (M.I.)
• Principle of M.I.
Base step: prove statement true for initial .
Inductive step: assume true, prove .
Conclude holds .
• Standard proofs
– Sum of first integers: .
– Sum of cubes: .
– Sum of squares: .
– Sum of first odd squares: .
– Divisibility results:
* is divisible by for all .
* is divisible by for all .
* Inequality 3^n < n! for (by showing 3^{k+1} < (k+1)! from assumption 3^k<k!).
Relations & Functions
• Relation: subset of .
• Function
– Each assigned exactly one (uniqueness & totality).
– Domain , Codomain , Image of is .
– Range .
• Types of Functions
– Identity (bijective). – Constant: all inputs map to same . – Injective (one–one): .
– Surjective (onto): Range Codomain.
– Bijective: both injective & surjective ⇔ invertible.
• Examples from transcript
– on is identity ⇒ bijective.
– constant ⇒ neither injective nor onto (if codomain larger).
– not injective (1 & 2 share 2) and not necessarily onto.
• Checking one–one/onto for real‐valued maps
–
* Injective: .
* Surjective: For any , ⇒ onto. Bijective.
–
* Injective.
* Not onto (negatives never hit). Not bijective.
– Piecewise f(x)=\begin{cases}3x-5,&x>0\-3x+1,&x\le0\end{cases}
* Injective (monotone pieces, intersect only at with distinct images).
* Surjectivity tested via inverse intervals; inverse exists on range segments provided.
Inverse Functions
• A function possesses an inverse iff it is bijective.
• Example (previous piecewise ):
– For y> -5, (coming from ).
– For , (from ).
Composition of Functions
• Given and , define by .
• Notation: .
• Example ①
– (real–to–real).
– .
– .
– .
• Example ② (Associativity check)
– , verify ; holds because composition of functions is associative.
Miscellaneous Named Maps
• Identity map: for all . • Totally constant map: for fixed .
• Bijection between set and itself may be called a permutation of the set (in algebraic context).
Key Algebraic Formulas Collected
• — permutations.
• — combinations.
• .
• — number of ‐bit binary strings.
• \left(\sum{i=1}^n i\right)=\dfrac{n(n+1)}{2},\qquad \left(\sum{i=1}^n i^2\right)=\dfrac{n(n+1)(2n+1)}{6},\qquad \left(\sum_{i=1}^n i^3\right)=\left(\dfrac{n(n+1)}{2}\right)^2.$
Ethical & Practical Implications Discussed
• Accurate counting underpins algorithm analysis, cryptography (license plates, codes), and real–world resource allocation.
• Correctly distinguishing injective vs surjective functions is crucial for defining inverses and for database integrity where uniqueness of keys matters.
Connections
• Counting principles feed directly into probability theory: sample‐space sizing.
• Induction proofs parallel recursive algorithm correctness proofs.
• Bijections correspond to permutations studied earlier; their counts are given by n!$$.
• Composition of functions mirrors chaining of algorithms or data transformations.