Truth tables

LVL: FREE

MODULE: Logic, Dimensions, and Modeling

[EXEC: MICRO_CORE]

✖️ 1. Constructing basic truth tables for single logical operations

🔲 Building Your First Truth Table

  • A truth table lists all possible truth values (T or F) for a logical statement.
  • For one variable pp, you need 2 rows (T and F).
  • For two variables pp and qq, you need 4 rows (all combinations).
  • Basic operations: AND (pqp \land q), OR (pqp \lor q), NOT (¬p\neg p).
  • AND is true only when both are true; OR is true when at least one is true.

Example: Truth table for pqp \land q:

| pp | qq | pqp \land q | |-----|-----|-------------| | T | T | T | | T | F | F | | F | T | F | | F | F | F |

💡 Memory hook: AND needs ALL true; OR needs ONE true.

[EXEC: DEEP_COMPUTE]

1. Constructing basic truth tables for single logical operations

Constructing Basic Truth Tables for Single Logical Operations

A truth table is a systematic tabulation showing all possible truth values (True/False or 1/0) for a logical statement based on its input variables. For a single logical operation with nn variables, the table contains 2n2^n rows representing all possible combinations of input truth values.

Intuition: A truth table exhaustively lists every scenario, making the behavior of a logical operation completely transparent.

Core Rules:

  • List all possible combinations of input values (typically in binary counting order: 00, 01, 10, 11 for two variables)
  • Apply the logical operation to each combination
  • Record the resulting truth value in the output column
  • Common operations: NOT (¬p\neg p), AND (pqp \land q), OR (pqp \vee q), XOR (pqp \oplus q), IMPLIES (pqp \rightarrow q)

Consequence: Truth tables provide a complete definition of any logical operation, independent of algebraic manipulation.

Example: For pqp \land q with inputs p=T,q=Fp = T, q = F: the output is FF (AND requires both inputs true).

TASK_1[0 / 3]
LVL_2
EXEC: ALGORITHM

A logical statement contains 3 distinct input variables. According to the core rules of truth tables, how many rows will the truth table have to represent all possible combinations?

DEEP_COMPUTE
ULTRA
[EXEC: MICRO_CORE]

✖️ 2. Evaluating compound statements using multi-column truth tables

🧩 Breaking Down Complex Statements

  • A compound statement combines multiple operations (like (pq)r(p \land q) \lor r).
  • Build columns step-by-step from innermost operations outward.
  • First evaluate parts inside parentheses, then combine results.
  • For three variables, you need 8 rows (double for each new variable).
  • Each intermediate step gets its own column before the final answer.

Example: Evaluate (pq)¬p(p \lor q) \land \neg p when p=Fp = F and q=Tq = T:

  • Step 1: pq=FT=Tp \lor q = F \lor T = T
  • Step 2: ¬p=¬F=T\neg p = \neg F = T
  • Step 3: TT=TT \land T = T

💡 Memory hook: Work inside-out like peeling an onion—innermost operations first.

[EXEC: DEEP_COMPUTE]

2. Evaluating compound statements using multi-column truth tables

Evaluating Compound Statements Using Multi-Column Truth Tables

A compound statement combines multiple logical operations (e.g., (pq)(¬r)(p \land q) \vee (\neg r)). A multi-column truth table evaluates such statements by computing intermediate sub-expressions in separate columns before determining the final output.

Intuition: Break complex logic into manageable steps, evaluating inner operations first, then combining results progressively.

Core Rules:

  • Create columns for each variable and each sub-expression in order of evaluation (parentheses first)
  • Evaluate operations following precedence: NOT, then AND, then OR (unless parentheses override)
  • Each intermediate column uses results from previous columns
  • The rightmost column contains the final truth value for the entire statement

Consequence: Multi-column tables transform complex logical reasoning into mechanical computation, eliminating ambiguity.

Example: For (p¬q)r(p \land \neg q) \vee r with p=T,q=T,r=Fp = T, q = T, r = F: compute ¬q=F\neg q = F, then pF=Fp \land F = F, finally FF=FF \vee F = F.

TASK_1[0 / 3]
LVL_2
EXEC: ALGORITHM

Evaluate the compound statement (pq)¬r(p \vee q) \land \neg r given the truth values p=Fp = F, q=Tq = T, and r=Tr = T.

DEEP_COMPUTE
ULTRA
[EXEC: MICRO_CORE]

✖️ 3. Determining logical equivalence of two statements using identical truth columns

⚖️ Testing If Two Statements Are Twins

  • Two statements are logically equivalent if their final columns match perfectly.
  • Build separate truth tables for each statement with the same variables.
  • Compare the final result columns row by row.
  • If every row matches, write \equiv between the statements.
  • Common equivalence: ¬(pq)¬p¬q\neg(p \land q) \equiv \neg p \lor \neg q (De Morgan's Law).

Example: Show pqqpp \land q \equiv q \land p:

| pp | qq | pqp \land q | qpq \land p | |-----|-----|-------------|-------------| | T | T | T | T | | T | F | F | F | | F | T | F | F | | F | F | F | F |

Final columns match → They are equivalent!

💡 Memory hook: Identical twins have identical DNA—identical columns mean identical logic.

[EXEC: DEEP_COMPUTE]

3. Determining logical equivalence of two statements using identical truth columns

Determining Logical Equivalence Using Identical Truth Columns

Two statements are logically equivalent if and only if their truth tables produce identical output columns for all possible input combinations. This is denoted PQP \equiv Q or PQP \Leftrightarrow Q.

Intuition: If two statements always yield the same truth value regardless of inputs, they express the same logical relationship and are interchangeable.

Core Rules:

  • Construct complete truth tables for both statements with the same variable ordering
  • Compare the final output columns row-by-row
  • Equivalence holds if and only if every corresponding row matches
  • A single mismatch proves non-equivalence

Consequence: Truth table comparison provides a definitive test for equivalence, verifying algebraic simplifications or identifying tautologies (always true) and contradictions (always false).

Example: ¬(pq)\neg(p \land q) and ¬p¬q\neg p \vee \neg q (De Morgan's Law) produce identical columns [T, T, T, F] for inputs [(F,F), (F,T), (T,F), (T,T)], confirming equivalence.

TASK_1[0 / 3]
LVL_2
STRC: TRANSFORM

Suppose Statement PP and Statement QQ are evaluated using truth tables with the same variable ordering. The final output column for PP is [T, F, T, T] and the final output column for QQ is [T, F, T, T]. Based on the text, what can be concluded about these two statements?

DEEP_COMPUTE
ULTRA
[EXEC: MICRO_CORE]

✖️ 4. Applications: Evaluating digital circuit outputs and software condition testing

💻 Real-World Logic Gates and Code

  • Digital circuits use AND, OR, NOT gates that follow truth table rules exactly.
  • Each gate's output depends on input signals (1 for true, 0 for false).
  • Software conditions (if-statements) evaluate using truth tables behind the scenes.
  • Testing all input combinations ensures your circuit or code works correctly.
  • Truth tables help debug why a condition fails for specific inputs.

Example: Circuit with inputs A and B, output is (AB)¬A(A \land B) \lor \neg A:

  • When A=0A = 0 and B=1B = 1: (01)1=01=1(0 \land 1) \lor 1 = 0 \lor 1 = 1 (output is HIGH)
  • When A=1A = 1 and B=0B = 0: (10)0=00=0(1 \land 0) \lor 0 = 0 \lor 0 = 0 (output is LOW)

💡 Memory hook: Truth tables are the blueprint—circuits and code are the buildings.

[EXEC: DEEP_COMPUTE]

4. Applications: Evaluating digital circuit outputs and software condition testing

Applications: Digital Circuits and Software Condition Testing

Truth tables directly model digital circuit behavior (where 1 = high voltage, 0 = low voltage) and software conditional logic (where True/False determine program flow).

Intuition: Hardware gates (AND, OR, NOT) and software conditionals (if-statements, boolean expressions) implement the same logical operations that truth tables describe.

Core Rules:

  • Digital circuits: Each logic gate corresponds to a truth table; circuit output is determined by tracing inputs through gate sequences
  • Software testing: Truth tables enumerate all test cases for conditional branches, ensuring complete code coverage
  • Identify critical input combinations where outputs change (edge cases)
  • Use truth tables to verify circuit designs match specifications or debug faulty logic

Consequence: Truth tables bridge abstract logic and practical implementation, enabling systematic verification of both hardware and software correctness.

Example: A circuit with inputs A=1,B=0A = 1, B = 0 through an AND gate followed by NOT yields: 10=01 \land 0 = 0, then ¬0=1\neg 0 = 1 (output high).

TASK_1[0 / 3]
LVL_2
EXEC: ALGORITHM

A digital circuit has two inputs, A = 1 and B = 1. These inputs first pass through an OR gate. The result of that OR gate then passes through a NOT gate. What is the final output of this circuit?

DEEP_COMPUTE
ULTRA

AWAITING_CONFIRMATION

CONFIRM KNOWLEDGE ACQUISITION TO UPDATE SYSTEM ANALYTICS.