Laws of Boolean Logic
A comprehensive guide to the algebraic laws used to simplify logical expressions.
Laws of Boolean Logic
Just as you use to simplify algebra, you can use Boolean Laws to simplify complex logical circuits and expressions. These laws allow us to transform a complicated statement into a much simpler, equivalent one.
1. The Fundamental Laws
| Law Name | Conjunction (AND) | Disjunction (OR) |
|---|---|---|
| Identity Laws | ||
| Domination Laws | ||
| Idempotent Laws | ||
| Double Negation | — | |
| Commutative Laws |
2. Distributive & Associative Laws
These laws are critical when dealing with more than two variables ().
- Associative:
- Distributive:
3. De Morgan's Laws (The Powerhouse)
As we've seen, De Morgan's laws allow us to move a negation inside parentheses by flipping the operator.
4. Absorption Laws
These laws are incredibly useful for cleaning up "redundant" logic in competitive exams and programming.
Think about it: If is already true, the status of doesn't change the fact that the whole OR expression is true!
5. Applying Laws in Python
In programming, we often use these laws to simplify if statements, making the code more readable and efficient.
# Before Simplification
if (is_member or (is_member and has_coupon)):
print("Access Granted")
# After applying Absorption Law: p or (p and q) == p
if is_member:
print("Access Granted")
Summary Checklist for Simplification
When you are asked to "Simplify the expression," follow this order:
- Remove Arrows: Replace with .
- Apply De Morgan's: Move negations inward.
- Double Negation: Clean up any .
- Distribute/Absorb: Use the laws above to cancel out variables.
Congratulations! You have mastered the algebraic side of Propositional Calculus.
Next Step: We move from fixed statements to Quantifiers and Variables in Level 2: Predicate Logic.