Truth Values & NOT
The two-valued universe of Boolean logic and the simplest operation - negation.
Computers need certainty. A circuit is either on or off. A bit is either 1 or 0. Boolean logic gives us a mathematical framework that matches this binary reality—and that constraint is exactly what makes it so powerful. We will build NOT, AND, and OR—the three operations that combine to express any logical condition.
The Two-Valued Universe
In everyday reasoning, we often deal with uncertainty: "maybe", "probably", "I'm not sure". Boolean logic is different. It operates in a closed universe where every statement must be exactly one of two values: true or false.
There is no "maybe". There is no "unknown". If something isn't true, it must be false. If it isn't false, it must be true.
T and F Notation
Writing "true" and "false" over and over can be tedious. In many contexts, we abbreviate these values using single letters.
T stands for true, and F stands for false.
Binary Representation
In computer science and digital circuits, Boolean values are often represented as numbers:
- 1 represents true
- 0 represents false
This is why we call it "binary" - there are exactly two digits.
The NOT Operation
The NOT operation is the simplest operation in Boolean logic. It takes a single truth value and returns the other one. If the input is true, NOT returns false. If the input is false, NOT returns true.
NOT is also written as $\neg$ (logical negation symbol) or ! (in programming).
Notation for NOT
In logic and mathematics, we use the symbol $\neg$ (the negation sign) to represent NOT. So instead of writing "NOT P", we write $\neg$P.
In programming languages like C, Java, and JavaScript, we use ! (the exclamation mark, sometimes called "bang") instead. So "NOT x" becomes !x.
Both symbols mean exactly the same thing - they negate the value.
Applying NOT with Symbols
Now let's practice evaluating NOT expressions using symbolic notation.
Remember: {{symbol}} flips the value.
- {{symbol}}true = false
- {{symbol}}false = true
What is a Truth Table?
A truth table is a table that shows all possible inputs to a Boolean operation and what output each input produces.
For NOT, the truth table has two rows (one for each possible input):
| Input | NOT |
|---|---|
| T | F |
| F | T |
Using the NOT Truth Table
The truth table for NOT shows how the operation maps each input to its output.
{{backgroundExtra}}
Double Negation
What happens when you negate something twice? If NOT flips a value to "the other one", then applying NOT again should flip it back.
This is called double negation: NOT(NOT(x)).
Triple Negation
We know that double negation ($\neg$$\neg$) returns the original value.
What about triple negation ($\neg$$\neg$$\neg$)?
English to Logic
In everyday language, we express negation in many ways:
- "It is not raining"
- "The light is not on"
- "I am not hungry"
To translate to logic, we first identify the base statement, then apply $\neg$.
Logic to English
We can also go the other direction - from logical notation back to English.
If {{varName}} means "{{statement}}", then $\neg${{varName}} means "{{negatedStatement}}".
Origins of Boolean Logic
Boolean logic was developed in the mid-1800s by George Boole, an English mathematician. He created a mathematical system for reasoning about logical statements, treating them as algebraic expressions.
Boole's work was primarily theoretical until nearly a century later, when Claude Shannon recognized that Boolean algebra could describe electrical switching circuits - laying the foundation for all modern digital computing.
NOT in Programming Languages
Different programming languages use different symbols for the NOT operation:
| Language | NOT Syntax | Example |
|---|---|---|
| Math/Logic | $\neg$P | $\neg$true = false |
| C, Java, JavaScript | !p | !true == false |
| Python | not p | not True == False |
| SQL | NOT p | NOT TRUE = FALSE |
The symbol changes, but the meaning is always the same: flip the truth value.
Nested Negation Challenge
When negations are nested deeply, you must work from the inside out.
Each $\neg$ flips the truth value:
- $\neg$T = F
- $\neg$$\neg$T = $\neg$F = T
- $\neg$$\neg$$\neg$T = $\neg$$\neg$F = $\neg$T = F
- $\neg$$\neg$$\neg$$\neg$T = $\neg$$\neg$$\neg$F = $\neg$$\neg$T = $\neg$F = T
Pattern: An even number of negations returns the original value.
An odd number of negations returns the opposite.
Ready to test your understanding?
Bitwit uses spaced repetition to help you truly master concepts like this—not just read about them. Each card generates with different values, so you can't just memorize answers.
Practice Truth Values & NOT →