boolean algebra
A branch of algebra that uses 1 and 0 (true and false) as values, and OR, AND and NOT for basic operations. Expressions can be implemented using logic gates.
Specific laws
Boolean algebra follows some specific rules not found in classical algebra:
Idempotence
- x OR x = x
- x AND x = x
Absorbtion
- x OR (x AND y) = x
- x AND (x OR y) = x
Distributivity
Similar to distributivity with multiplication and addition, but works both ways:
- x AND (y OR z) = (x AND y) OR (x AND z)
- x OR (y AND z) = (x OR y) AND (x OR z)
De Morgan laws
- NOT(x AND y) = NOT(x) OR NOT(y)
- NOT(x OR y) = NOT(x) AND NOT(y)
Other laws
- x OR (NOT(x) AND y) = x OR y
- x AND (NOT(x) OR y) = x AND y