Quick Recap — Relations & Functions

  • A relation from AA to BB is a subset of A×BA\times B; a function assigns each input exactly one output.
  • Counting: functions A→BA\to B number ∣B∣∣A∣|B|^{|A|}; relations from AA to BB number 2∣A∣∣B∣2^{|A||B|}.
  • Types: one-one (injective), onto (surjective), bijective (both).
  • Composition (g∘f)(x)=g(f(x))(g\circ f)(x)=g(f(x)); inverse f−1f^{-1} exists iff ff is a bijection.