Function Composition

Context: FIT1058_MOC Β· chains functions into a pipeline Β· needs codomain/domain to match Β· reverses on inversion Β· powers a Cryptosystem

Quick Revision

  • 🎯 Objective: feed one function’s output into another βž” , β€œg after f”.
  • πŸ“¦ Core Components: matching (codom = dom ) βž” associative βž” identity neutral.
  • ⚑ Key Constraint: not commutative; inverting reverses order ().

πŸ“ Core

1. Composition (g after f)

  • Definition βž” , ⟹ , .
  • Order βž” right-hand function runs first (textual order reverses evaluation).
  • Matching βž” defined only when codomain of = domain of .

2. Algebraic Properties

  • Not commutative βž” in general.
  • Associative βž” .
  • Identity neutral βž” ; iteration βž” .

3. Inverses (Socks-and-Shoes)

  • Cancel βž” , (Inverse Function).
  • Reverse order βž” .
  • Application βž” cascaded encryptions build a stronger Cryptosystem.

Key identities:

βš–οΈ Core Decision Matrix

PropertyHolds?Statement
commutativeno
associativeyes
identityyes
bijection preservedyes bijective iff both are

When It Flips: composition models multi-stage computation; non-commutativity means swapping stages changes the result. Cascading two ciphers gives key space and decryption (socks-and-shoes).

πŸ“Š Exam Execution Trace

Applied Exercise

Problem: Compute and at ; confirm non-commutativity. Derivation Proof / Hand-Calculation Walkthrough:

Final Extracted Output: , ; non-commutative.

⚠️ Common Mistakes

  • πŸ’‘ Written order β‰  evaluation order βž” in , runs first though is written first; to invert, reverse ().

🧠 Active Recall