n-ary Relation

Context: FIT1058_MOC Β· generalises the Binary Relation to columns Β· the formal model of a relational database table Β· counted via the Power Set

Quick Revision

  • 🎯 Objective: a subset of an -fold Cartesian product β€” a set of -tuples βž” the model of a relational table.
  • πŸ“¦ Core Components: domains βž” tuples (rows) βž” counted by the Power Set.
  • ⚑ Key Constraint: relations () vastly outnumber functions ().

πŸ“ Core

1. The Relation ( Columns)

  • Definition βž” β€” a set of ordered -tuples, -th from .
  • -th domain βž” ; common cases (binary), (ternary).

2. Databases

  • Table = relation βž” each column is a domain , each row is a tuple.
  • Why β€œrelational” βž” data is literally a set of tuples from a product.
  • Projection βž” extracting two columns yields a Binary Relation.

3. Counting via the Power Set

  • All relations βž” subsets of the product ⟹ its Power Set.
  • Formulas βž” (), (on ), (-ary).

Key identities:

βš–οΈ Core Decision Matrix

ObjectCount ()Constraint
binary relation none
relation on none
function single-valued + total
-ary relationnone

When It Flips: recovers the Binary Relation; restricting to single-valued total tuples recovers multi-argument functions . Dropping single-valuedness explodes to .

πŸ“Š Exam Execution Trace

Manual Execution Trace

, :

Step / StateObjectFormulaValue
0 (Init)β€”β€”β€”
1relations 64
2relations on 16
3functions 9

⚠️ Common Mistakes

  • πŸ’‘ Tuples are ordered βž” column order is part of the schema; relations vastly outnumber functions because each of the pairs is independently in or out.

🧠 Active Recall