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 ABA\to B number BA|B|^{|A|}; relations from AA to BB number 2AB2^{|A||B|}.
  • Types: one-one (injective), onto (surjective), bijective (both).
  • Composition (gf)(x)=g(f(x))(g\circ f)(x)=g(f(x)); inverse f1f^{-1} exists iff ff is a bijection.