Armstrong's axioms in DBMS Theory - Time & Space Complexity
We want to understand how the time to find all functional dependencies grows when using Armstrong's axioms.
How does the number of steps change as the number of attributes and dependencies increases?
Analyze the time complexity of applying Armstrong's axioms to find all implied functional dependencies.
-- Given a set of functional dependencies (FDs)
-- Apply Armstrong's axioms: reflexivity, augmentation, transitivity
-- Repeat until no new FDs are found
WHILE new FDs are added DO
FOR each FD X -> Y DO
FOR each FD W -> Z DO
IF Y includes W THEN
Add FD X -> Z
END IF
END FOR
END FOR
END WHILE
This process finds all functional dependencies implied by the initial set using Armstrong's axioms.
Look for loops and repeated checks in the process.
- Primary operation: Nested loops comparing pairs of functional dependencies.
- How many times: Repeated until no new dependencies are added, potentially many times.
As the number of attributes and dependencies grows, the number of pairs to check grows quickly.
| Input Size (number of FDs) | Approx. Operations |
|---|---|
| 10 | About 100 checks per iteration |
| 100 | About 10,000 checks per iteration |
| 1000 | About 1,000,000 checks per iteration |
Pattern observation: The number of operations grows roughly with the square of the number of dependencies.
Time Complexity: O(n^3)
This means the time to find all implied dependencies grows roughly with the cube of the number of initial dependencies.
[X] Wrong: "Applying Armstrong's axioms takes linear time because we just check each dependency once."
[OK] Correct: The process repeats many times and compares pairs of dependencies, causing the time to grow much faster than linear.
Understanding how Armstrong's axioms scale helps you reason about database design and normalization efficiently in real projects.
"What if we had a way to avoid rechecking all pairs every time? How would that affect the time complexity?"
Practice
Solution
Step 1: Recall Armstrong's axioms
Armstrong's axioms include Reflexivity, Augmentation, and Transitivity.Step 2: Identify the option not in the axioms
Normalization is a database design process, not an axiom.Final Answer:
Normalization -> Option DQuick Check:
Armstrong's axioms exclude Normalization [OK]
- Confusing normalization with axioms
- Thinking all database terms are axioms
- Mixing up augmentation with normalization
Y is a subset of X, then X functionally determines Y?Solution
Step 1: Understand the axiom definitions
Reflexivity states if Y is subset of X, then X determines Y.Step 2: Match the statement to the axiom
The given statement matches Reflexivity exactly.Final Answer:
Reflexivity -> Option AQuick Check:
Subset implies functional dependency by Reflexivity [OK]
- Confusing reflexivity with transitivity
- Choosing decomposition which is not an axiom
- Mixing augmentation with reflexivity
A -> B and B -> C, what can we infer using Armstrong's axioms?Solution
Step 1: Identify the given dependencies
We have A determines B, and B determines C.Step 2: Apply Transitivity axiom
Transitivity says if A -> B and B -> C, then A -> C.Final Answer:
A -> C -> Option AQuick Check:
Transitivity gives A -> C [OK]
- Reversing dependencies incorrectly
- Ignoring transitivity rule
- Assuming dependencies go backward
A -> B, the conclusion is B -> A.Solution
Step 1: Analyze the given dependency
A -> B means A determines B, not the other way around.Step 2: Check the conclusion
Concluding B -> A reverses the dependency, which Armstrong's axioms do not allow.Final Answer:
Mistakenly reversed dependency -> Option CQuick Check:
Dependencies do not reverse automatically [OK]
- Assuming dependencies are symmetric
- Confusing augmentation with reversal
- Ignoring direction of functional dependency
A -> B and A -> C, which Armstrong's axiom allows you to combine these into A -> BC?Solution
Step 1: Understand the given dependencies
A determines B and A determines C separately.Step 2: Apply the Union axiom
Union allows combining A -> B and A -> C into A -> BC.Final Answer:
Union -> Option BQuick Check:
Union combines dependencies into one [OK]
- Confusing union with augmentation
- Using decomposition instead of union
- Applying transitivity incorrectly here
Ready to prove it?
Pass the test and this pattern moves unknown
