4A4. π€ Case Study: Boolean Algebra - JulTob/Mathematics GitHub Wiki
We will explore abstract algebra concepts step by step using Boolean Algebra as our case study. π²β¨
What is Boolean Algebra?
π§© The Light Switch Game
π― Understand how Boolean Algebra models binary operations.
π‘ You enter a mysterious room with two light bulbs π‘π‘ and two switches π³π³.
-
Each switch has two states: ON (1)[π²] or OFF (0)[π³].
-
The room follows a strange logic:
- If either switch is ON, the red light π΄ turns ON.
- If both switches are ON, the green light π’ turns ON.
- The lights turn off if these conditions don't apply.
π€ Question: What kind of operation describes this behavior?
π Defining the Boolean Set
The light switch system follows a binary structure:
\color{gold}
B=ο½0,1ο½
where:
- π³ 0 means OFF,
- π² 1 means ON.
β Boolean algebra operates on just two values: $ο½0,1ο½$ .
π Boolean Operations
The room follows two main rules:
- 1οΈβ£ π΄ The "OR" Switch (Logical OR $β¨$ )
- The light turns on if at least one switch is ONπ².
- 2οΈβ£ π’ The "AND" Switch (Logical AND $β§$ )
- The light turns on only if both switches are ONπ².
π³ Switch 1 | π³ Switch 2 | π΄ Light (A OR B) | π’ Light (A AND B) |
---|---|---|---|
π³ 0 | π³ 0 | β« 0 | β« 0 |
π³ 0 | π² 1 | π΄ 1 | β« 0 |
π² 1 | π³ 0 | π΄ 1 | β« 0 |
π² 1 | π² 1 | π΄ 1 | π’ 1 |
π Boolean Algebra as a Lattice
π§© The Hierarchy of Truth
π― Understand how Boolean Algebra forms a lattice, a fundamental structure in algebra.
π The Hierarchy of Truth π
π What is a Lattice?
A lattice is a set where every pair of elements has:
- πΊ A Greatest Lower Bound (GLB, also called meet, denoted $β$)
- π» A Least Upper Bound (LUB, also called join, denoted $β$ )
In Boolean Algebra:
- $Aβ§B$ gives the "greatest" truth that is common to both statements.
- $Aβ¨B$ gives the "least" truth that includes both statements.
π Question:
- What happens when you combine the statements "It is raining" and "It is cloudy" using AND $(β§)$? What happens when you combine them using OR $(β¨)$?
Each statement (A, B, etc.) forms part of a hierarchical structure, where:
-
$0$ (false) is the lowest element.
-
$1$ (true) is the highest element.
-
$Aβ¨B$ is the lowest truth that contains A and B.
-
$Aβ§B$ is the highest truth that is contained in both A and B.
-
π Check if $Aβ§B=Bβ§A$ (Commutativity).
-
π Check if $Aβ§(Bβ§C)=(Aβ§B)β§C$ (Associativity).
Why Boolean Algebra Forms a Lattice
Boolean Algebra satisfies lattice properties because:
- 1οΈβ£ It is a set B={0,1}B={0,1} with two operations $β§$ and $β¨$.
- 2οΈβ£ Every pair of elements has a GLB (meet) and LUB (join).
- 3οΈβ£ It satisfies
- Associativity: $\frac{Aβ§(Bβ§C)=(Aβ§B)β§C}{Aβ¨(Bβ¨C)=(Aβ¨B)β¨C}$
- Commutativity: $\frac{Aβ§B=Bβ§A }{Aβ¨B=Bβ¨A }$
- Idempotency: $\frac{Aβ§A=A }{Aβ¨A=A }$
This is a fundamental structure in logic, computing, and abstract algebra!
π Boolean Algebra as a Group?
A group is a set with a single binary operation that satisfies:
- Closure: $aβb$ is still in the set.
- Associativity: $(aβb)βc=aβ(bβc)$.
- Identity Element: There exists an element $e$ such that $aβe=a$.
- Inverses: Every element has an inverse $a^{β1}$ such that $aβa^{β1}=e$.
π³ A | π³ B | π΄ A OR B | π’ A AND B | A XOR B |
---|---|---|---|---|
π³ 0 | π³ 0 | β« 0 | β« 0 | β« 0 |
π³ 0 | π² 1 | π΄ 1 | β« 0 | π‘ 1 |
π² 1 | π³ 0 | π΄ 1 | β« 0 | π‘ 1 |
π² 1 | π² 1 | π΄ 1 | π’ 1 | β« 0 |
-
AND:
- Closure β (only 0 and 1 appear)
- Associativity β $(Aβ§B)β§C=Aβ§(Bβ§C)$
- Identity? β There is no element $e$ such that $Aβ§e=A$ for all $A$.
- Inverses? β There is no inverse for $1$ (since $1β§x=1$ has no solution for $x$).
- π¨ Boolean Algebra under AND is NOT a group.
-
OR:
- Closure β (only $0$ and $1$ appear)
- Associativity β $(Aβ¨B)β¨C=Aβ¨(Bβ¨C)$
- Identity? β There is no element $e$ such that $Aβ¨e=A$ for all $A$.
- Inverses? β No inverse for $0$ (since $0β¨x=0$ has no solution for $x$).
-
XOR
-
β Closure
-
β Associativity
-
β Identity: $0$ since $Aβ0$ = A$
-
β Inverses: $AβA=0$ (so every element is its own inverse!)
-
π₯ Boolean Algebra under XOR is a Group! In fact, it forms an Abelian group of order 2 (isomorphic to $β€β$β).
-