100% FREE Updated: Mar 2026 Discrete Mathematics Foundations of Discrete Math

Boolean Logic

Comprehensive study notes on Boolean Logic for CMI Data Science preparation. This chapter covers key concepts, formulas, and examples needed for your exam.

Boolean Logic

Overview

Welcome to the foundational chapter on Boolean Logic, a cornerstone of Discrete Mathematics and an indispensable tool in your Masters in Data Science journey. This chapter will introduce you to the fundamental principles that govern how computers process information, how databases are queried, and how algorithms make decisions. Mastering Boolean Logic is not just about understanding theoretical concepts; it's about developing the precise computational thinking essential for manipulating data and building robust analytical models.

For your CMI examinations, a solid grasp of Boolean Logic is critical. It forms the bedrock for understanding more advanced topics such as set theory, graph theory, and even the underlying logic of programming constructs and data structures. Expect questions that test your ability to interpret, construct, and evaluate logical statements, as these skills are directly transferable to practical data science problems, from filtering datasets efficiently to designing conditional logic within machine learning pipelines.

By focusing on propositions, logical operators, and truth tables, this chapter equips you with the analytical framework to break down complex problems into manageable, logical components. This systematic approach is invaluable for debugging code, optimizing queries, and ensuring the logical integrity of your data science projects. Dive in to build a strong, exam-relevant foundation that will serve you throughout your career.

---

Chapter Contents

| # | Topic | What You'll Learn |
|---|-------|-------------------|
| 1 | Propositions and Logical Operators | Understand basic statements and how to combine them. |
| 2 | Truth Tables | Evaluate logical expressions systematically for all cases. |

---

Learning Objectives

By the End of This Chapter

After studying this chapter, you will be able to:

  • Define propositions and assign appropriate truth values.

  • Identify and correctly apply fundamental logical operators (e.g., \land, \lor, ¬\neg).

  • Construct comprehensive truth tables for compound logical expressions.

  • Analyze and interpret the truth values of complex logical statements.

---

Now let's begin with Propositions and Logical Operators...
## Part 1: Propositions and Logical Operators

Introduction

Propositions and logical operators form the bedrock of discrete mathematics, providing a formal system for reasoning and computation. In the context of a Masters in Data Science, a rigorous understanding of this topic is indispensable. It underpins database query languages, the design of digital circuits, the formal specification of software systems, and the logical foundations of artificial intelligence and machine learning algorithms. For the CMI exam, proficiency in manipulating logical expressions, evaluating their truth values, and applying them to solve reasoning problems is frequently tested. This unit establishes the fundamental tools for constructing valid arguments and analyzing complex statements, crucial for both theoretical understanding and practical application.
📖 Proposition

A proposition (or statement) is a declarative sentence that is either true or false, but not both. It must have a definite truth value.

Examples:
"The sky is blue." (True)
" 2+2=52 + 2 = 5." (False)
* "Every prime number greater than 22 is odd." (True)

Non-examples:
"What time is it?" (Question)
"Go to your room." (Command)
* " x+1=3x + 1 = 3." (Unless xx is specified, its truth value is not definite)

---

---

Key Concepts

1. Atomic and Compound Propositions

An atomic proposition is a simple proposition that cannot be broken down into simpler propositions. For instance, "It is raining" is an atomic proposition.

Compound propositions are formed by combining atomic propositions using logical connectives (also known as logical operators). These connectives specify how the truth value of the compound proposition depends on the truth values of its constituent atomic propositions.

2. Truth Values

Every proposition has exactly one of two possible truth values:
* True (T) or 1
* False (F) or 0

3. Logical Connectives

Logical connectives are symbols or words used to combine propositions and form new, more complex propositions. Their meaning is defined by truth tables, which show the truth value of the compound proposition for every possible combination of truth values of its atomic components.

Negation (¬\neg)

The negation of a proposition PP, denoted by ¬P\neg P (read as "not PP"), is true when PP is false, and false when PP is true.

📐 Negation
P¬PTFFT\begin{array}{cc} P & \neg P \\ \text{T} & \text{F} \\ \text{F} & \text{T}\end{array}

Variables:

    • PP = an atomic proposition


When to use: To reverse the truth value of a proposition.

Conjunction (\land)

The conjunction of two propositions PP and QQ, denoted by PQP \land Q (read as "PP and QQ"), is true if and only if both PP and QQ are true. Otherwise, it is false.

📐 Conjunction
PQPQTTTTFFFTFFFF\begin{array}{ccc} P & Q & P \land Q \\ \text{T} & \text{T} & \text{T} \\ \text{T} & \text{F} & \text{F} \\ \text{F} & \text{T} & \text{F} \\ \text{F} & \text{F} & \text{F}\end{array}

Variables:

    • P,QP, Q = atomic propositions


When to use: To express that two conditions must both be met.

Disjunction (\lor)

The disjunction of two propositions PP and QQ, denoted by PQP \lor Q (read as "PP or QQ"), is true if at least one of PP or QQ is true. It is false only when both PP and QQ are false. This is an inclusive or.

📐 Disjunction
PQPQTTTTFTFTTFFF\begin{array}{ccc} P & Q & P \lor Q \\ \text{T} & \text{T} & \text{T} \\ \text{T} & \text{F} & \text{T} \\ \text{F} & \text{T} & \text{T} \\ \text{F} & \text{F} & \text{F}\end{array}

Variables:

    • P,QP, Q = atomic propositions


When to use: To express that at least one of two conditions must be met.

Implication (    \implies)

The implication (or conditional statement) of PP and QQ, denoted by P    QP \implies Q (read as "PP implies QQ" or "If PP, then QQ"), is false if and only if PP is true and QQ is false. In all other cases, it is true.
Here, PP is the hypothesis (or antecedent) and QQ is the conclusion (or consequent).

📐 Implication
PQP    QTTTTFFFTTFFT\begin{array}{ccc} P & Q & P \implies Q \\ \text{T} & \text{T} & \text{T} \\ \text{T} & \text{F} & \text{F} \\ \text{F} & \text{T} & \text{T} \\ \text{F} & \text{F} & \text{T}\end{array}

Variables:

    • P,QP, Q = atomic propositions


When to use: To express cause-and-effect or conditional relationships.

Important Interpretations of P    QP \implies Q:
* "If PP, then QQ."
* "PP implies QQ."
* "PP is sufficient for QQ." (If PP happens, QQ is guaranteed.)
* "QQ is necessary for PP." (If QQ doesn't happen, PP cannot happen.)
* "PP only if QQ."
* "QQ whenever PP."

Worked Example: Translating English to Implication

Problem: Translate the following assertion into a propositional formula: "To get an A in the class, it is necessary for you to get an A on the final."

Solution:

Step 1: Define atomic propositions.
Let RR: "You get an A in the class."
Let PP: "You get an A on the final."

Step 2: Understand "necessary for".
The phrase "QQ is necessary for PP" means that PP cannot occur without QQ occurring. If PP occurs, then QQ must occur. This is equivalent to P    QP \implies Q.

Step 3: Apply the definition.
Here, "getting an A on the final" (PP) is necessary for "getting an A in the class" (RR).
So, if you get an A in the class (RR), then you must have gotten an A on the final (PP).

R    PR \implies P

Answer: R    PR \implies P

Biconditional (    \iff)

The biconditional of PP and QQ, denoted by P    QP \iff Q (read as "PP if and only if QQ"), is true when PP and QQ have the same truth value (both true or both false). Otherwise, it is false.

📐 Biconditional
PQP    QTTTTFFFTFFFT\begin{array}{ccc} P & Q & P \iff Q \\ \text{T} & \text{T} & \text{T} \\ \text{T} & \text{F} & \text{F} \\ \text{F} & \text{T} & \text{F} \\ \text{F} & \text{F} & \text{T}\end{array}

Variables:

    • P,QP, Q = atomic propositions


When to use: To express that two conditions are logically equivalent or that one holds if and only if the other holds.

Exclusive OR (\oplus)

The exclusive OR of PP and QQ, denoted by PQP \oplus Q (read as "PP XOR QQ"), is true when exactly one of PP or QQ is true, but not both. It is false when both are true or both are false.

📐 Exclusive OR
PQPQTTFTFTFTTFFF\begin{array}{ccc} P & Q & P \oplus Q \\ \text{T} & \text{T} & \text{F} \\ \text{T} & \text{F} & \text{T} \\ \text{F} & \text{T} & \text{T} \\ \text{F} & \text{F} & \text{F}\end{array}

Variables:

    • P,QP, Q = atomic propositions


When to use: To express that exactly one of two conditions must be met.

4. Constructing Truth Tables

A truth table systematically lists all possible truth value combinations for atomic propositions and shows the resulting truth value of a compound proposition.

Worked Example:

Problem: Construct the truth table for the compound proposition (P¬Q)    R(P \land \neg Q) \implies R.

Solution:

Step 1: List all atomic propositions and their possible truth value combinations.
There are 33 atomic propositions (P,Q,RP, Q, R), so there will be 23=82^3 = 8 rows.

PQRTTTTTFTFTTFFFTTFTFFFTFFF\begin{array}{ccc} P & Q & R \\ \text{T} & \text{T} & \text{T} \\ \text{T} & \text{T} & \text{F} \\ \text{T} & \text{F} & \text{T} \\ \text{T} & \text{F} & \text{F} \\ \text{F} & \text{T} & \text{T} \\ \text{F} & \text{T} & \text{F} \\ \text{F} & \text{F} & \text{T} \\ \text{F} & \text{F} & \text{F}\end{array}

Step 2: Evaluate the innermost components first.
Start with ¬Q\neg Q.

PQR¬QTTTFTTFFTFTTTFFTFTTFFTFFFFTTFFFT\begin{array}{cccc} P & Q & R & \neg Q \\ \text{T} & \text{T} & \text{T} & \text{F} \\ \text{T} & \text{T} & \text{F} & \text{F} \\ \text{T} & \text{F} & \text{T} & \text{T} \\ \text{T} & \text{F} & \text{F} & \text{T} \\ \text{F} & \text{T} & \text{T} & \text{F} \\ \text{F} & \text{T} & \text{F} & \text{F} \\ \text{F} & \text{F} & \text{T} & \text{T} \\ \text{F} & \text{F} & \text{F} & \text{T}\end{array}

Step 3: Evaluate the next complex component, P¬QP \land \neg Q.

PQR¬QP¬QTTTFFTTFFFTFTTTTFFTTFTTFFFTFFFFFTTFFFFTF\begin{array}{ccccc} P & Q & R & \neg Q & P \land \neg Q \\ \text{T} & \text{T} & \text{T} & \text{F} & \text{F} \\ \text{T} & \text{T} & \text{F} & \text{F} & \text{F} \\ \text{T} & \text{F} & \text{T} & \text{T} & \text{T} \\ \text{T} & \text{F} & \text{F} & \text{T} & \text{T} \\ \text{F} & \text{T} & \text{T} & \text{F} & \text{F} \\ \text{F} & \text{T} & \text{F} & \text{F} & \text{F} \\ \text{F} & \text{F} & \text{T} & \text{T} & \text{F} \\ \text{F} & \text{F} & \text{F} & \text{T} & \text{F}\end{array}

Step 4: Evaluate the final compound proposition, (P¬Q)    R(P \land \neg Q) \implies R.

PQR¬QP¬Q(P¬Q)    RTTTFFTTTFFFTTFTTTTTFFTTFFTTFFTFTFFFTFFTTFTFFFTFT\begin{array}{cccccc} P & Q & R & \neg Q & P \land \neg Q & (P \land \neg Q) \implies R \\ \text{T} & \text{T} & \text{T} & \text{F} & \text{F} & \text{T} \\ \text{T} & \text{T} & \text{F} & \text{F} & \text{F} & \text{T} \\ \text{T} & \text{F} & \text{T} & \text{T} & \text{T} & \text{T} \\ \text{T} & \text{F} & \text{F} & \text{T} & \text{T} & \text{F} \\ \text{F} & \text{T} & \text{T} & \text{F} & \text{F} & \text{T} \\ \text{F} & \text{T} & \text{F} & \text{F} & \text{F} & \text{T} \\ \text{F} & \text{F} & \text{T} & \text{T} & \text{F} & \text{T} \\ \text{F} & \text{F} & \text{F} & \text{T} & \text{F} & \text{T}\end{array}

Answer: The final column shows the truth values for (P¬Q)    R(P \land \neg Q) \implies R.

5. Tautologies, Contradictions, and Contingencies

* A compound proposition is a tautology if it is always true, regardless of the truth values of its atomic propositions. (e.g., P¬PP \lor \neg P)
* A compound proposition is a contradiction if it is always false, regardless of the truth values of its atomic propositions. (e.g., P¬PP \land \neg P)
* A compound proposition is a contingency if it is neither a tautology nor a contradiction; its truth value depends on the truth values of its atomic propositions. (e.g., P    QP \implies Q)

6. Logical Equivalence

Two compound propositions AA and BB are logically equivalent, denoted by ABA \equiv B, if they have the same truth values for all possible assignments of truth values to their atomic propositions. This means their truth tables are identical, or equivalently, the biconditional A    BA \iff B is a tautology.

Worked Example: Proving Logical Equivalence using Truth Tables

Problem: Prove that ¬(P    Q)\neg(P \implies Q) is logically equivalent to P¬QP \land \neg Q.

Solution:

Step 1: Construct the truth table for ¬(P    Q)\neg(P \implies Q).

PQP    Q¬(P    Q)TTTFTFFTFTTFFFTF\begin{array}{cccc} P & Q & P \implies Q & \neg(P \implies Q) \\ \text{T} & \text{T} & \text{T} & \text{F} \\ \text{T} & \text{F} & \text{F} & \text{T} \\ \text{F} & \text{T} & \text{T} & \text{F} \\ \text{F} & \text{F} & \text{T} & \text{F}\end{array}

Step 2: Construct the truth table for P¬QP \land \neg Q.

PQ¬QP¬QTTFFTFTTFTFFFFTF\begin{array}{cccc} P & Q & \neg Q & P \land \neg Q \\ \text{T} & \text{T} & \text{F} & \text{F} \\ \text{T} & \text{F} & \text{T} & \text{T} \\ \text{F} & \text{T} & \text{F} & \text{F} \\ \text{F} & \text{F} & \text{T} & \text{F}\end{array}

Step 3: Compare the final columns.
The truth values for ¬(P    Q)\neg(P \implies Q) are F, T, F, F.
The truth values for P¬QP \land \neg Q are F, T, F, F.
Since the columns are identical, the two propositions are logically equivalent.

Answer: ¬(P    Q)P¬Q\neg(P \implies Q) \equiv P \land \neg Q.

Key Logical Equivalences (Laws of Logic)

These equivalences are frequently used to simplify compound propositions or to prove other equivalences without using truth tables.

📐 Key Logical Equivalences
Identity Laws:PTPPFPDomination Laws:PTTPFFIdempotent Laws:PPPPPPDouble Negation Law:¬(¬P)PCommutative Laws:PQQPPQQPAssociative Laws:(PQ)RP(QR)(PQ)RP(QR)Distributive Laws:P(QR)(PQ)(PR)P(QR)(PQ)(PR)De Morgan’s Laws:¬(PQ)¬P¬Q¬(PQ)¬P¬QImplication Equivalence:P    Q¬PQNegation of Implication:¬(P    Q)P¬QContrapositive:P    Q¬Q    ¬PBiconditional Equivalence:P    Q(P    Q)(Q    P)P    Q(¬PQ)(¬QP)Absorption Laws:P(PQ)PP(PQ)P\begin{aligned} & \textbf{Identity Laws:} \\ & P \land \text{T} \equiv P \\ & P \lor \text{F} \equiv P \\ & \textbf{Domination Laws:} \\ & P \lor \text{T} \equiv \text{T} \\ & P \land \text{F} \equiv \text{F} \\ & \textbf{Idempotent Laws:} \\ & P \lor P \equiv P \\ & P \land P \equiv P \\ & \textbf{Double Negation Law:} \\ & \neg(\neg P) \equiv P \\ & \textbf{Commutative Laws:} \\ & P \lor Q \equiv Q \lor P \\ & P \land Q \equiv Q \land P \\ & \textbf{Associative Laws:} \\ & (P \lor Q) \lor R \equiv P \lor (Q \lor R) \\ & (P \land Q) \land R \equiv P \land (Q \land R) \\ & \textbf{Distributive Laws:} \\ & P \land (Q \lor R) \equiv (P \land Q) \lor (P \land R) \\ & P \lor (Q \land R) \equiv (P \lor Q) \land (P \lor R) \\ & \textbf{De Morgan's Laws:} \\ & \neg(P \land Q) \equiv \neg P \lor \neg Q \\ & \neg(P \lor Q) \equiv \neg P \land \neg Q \\ & \textbf{Implication Equivalence:} \\ & P \implies Q \equiv \neg P \lor Q \\ & \textbf{Negation of Implication:} \\ & \neg(P \implies Q) \equiv P \land \neg Q \\ & \textbf{Contrapositive:} \\ & P \implies Q \equiv \neg Q \implies \neg P \\ & \textbf{Biconditional Equivalence:} \\ & P \iff Q \equiv (P \implies Q) \land (Q \implies P) \\ & P \iff Q \equiv (\neg P \lor Q) \land (\neg Q \lor P) \\ & \textbf{Absorption Laws:} \\ & P \land (P \lor Q) \equiv P \\ & P \lor (P \land Q) \equiv P\end{aligned}

Variables:

    • P,Q,RP, Q, R = propositions

    • T = Tautology (always true)

    • F = Contradiction (always false)


When to use: To simplify logical expressions, prove equivalences, and convert expressions into desired forms (e.g., Conjunctive Normal Form).

Worked Example: Proving Logical Equivalence using Laws of Logic

Problem: Show that (P    Q)(P    ¬Q)(P \implies Q) \land (P \implies \neg Q) is a contradiction.

Solution:

Step 1: Apply Implication Equivalence to both implications.

(P    Q)(P    ¬Q)(¬PQ)(¬P¬Q)\begin{aligned}(P \implies Q) \land (P \implies \neg Q) & \equiv (\neg P \lor Q) \land (\neg P \lor \neg Q)\end{aligned}

Step 2: Apply the Distributive Law (factoring out ¬P\neg P).

¬P(Q¬Q)\begin{aligned} & \equiv \neg P \lor (Q \land \neg Q)\end{aligned}

Step 3: Recognize that Q¬QQ \land \neg Q is a contradiction (always false).

¬PF\begin{aligned} & \equiv \neg P \lor \text{F}\end{aligned}

Step 4: Apply the Identity Law (XFXX \lor \text{F} \equiv X).

¬P\begin{aligned} & \equiv \neg P\end{aligned}

This is incorrect. (P    Q)(P    ¬Q)(P \implies Q) \land (P \implies \neg Q) should simplify to ¬P\neg P.
If PP is true, then QQ must be true AND QQ must be false, which is a contradiction. So PP must be false. Hence ¬P\neg P.
Let's re-evaluate.

Step 1: Apply Implication Equivalence.

(P    Q)(P    ¬Q)(¬PQ)(¬P¬Q)\begin{aligned}(P \implies Q) \land (P \implies \neg Q) & \equiv (\neg P \lor Q) \land (\neg P \lor \neg Q)\end{aligned}

Step 2: Apply the Distributive Law: A(BC)(AB)(AC)A \lor (B \land C) \equiv (A \lor B) \land (A \lor C). Here, A=¬PA = \neg P, B=QB = Q, C=¬QC = \neg Q.

¬P(Q¬Q)\begin{aligned} & \equiv \neg P \lor (Q \land \neg Q)\end{aligned}

Step 3: Recognize that Q¬QQ \land \neg Q is a contradiction (always false, F).

¬PF\begin{aligned} & \equiv \neg P \lor \text{F}\end{aligned}

Step 4: Apply the Identity Law: XFXX \lor \text{F} \equiv X.

¬P\begin{aligned} & \equiv \neg P\end{aligned}

This result means that the original expression is logically equivalent to ¬P\neg P. It is not a contradiction, but rather a contingency whose truth value depends on PP. If PP is true, the expression is false. If PP is false, the expression is true. This is consistent with ¬P\neg P.

Let's use a truth table to be absolutely sure.

PQP    Q¬QP    ¬Q(P    Q)(P    ¬Q)TTTFFFTFFTTFFTTFTTFFTTTT\begin{array}{cccccc}
P & Q & P \implies Q & \neg Q & P \implies \neg Q & (P \implies Q) \land (P \implies \neg Q) \\
\text{T} & \text{T} & \text{T} & \text{F} & \text{F} & \text{F} \\
\text{T} & \text{F} & \text{F} & \text{T} & \text{T} & \text{F} \\
\text{F} & \text{T} & \text{T} & \text{F} & \text{T} & \text{T} \\
\text{F} & \text{F} & \text{T} & \text{T} & \text{T} & \text{T}\end{array}

The final column is F, F, T, T. This is exactly the truth table for ¬P\neg P.
So the original statement simplifies to ¬P\neg P, not a contradiction.

Let's correct the example to show a clear contradiction.

Worked Example: Proving a Contradiction using Laws of Logic

Problem: Show that (P¬P)(P \land \neg P) is a contradiction. (A simpler, direct example for the concept).

Solution:

Step 1: By definition, P¬PP \land \neg P is true only if both PP is true AND ¬P\neg P is true.

Step 2: If PP is true, then ¬P\neg P must be false.

Step 3: Therefore, it is impossible for both PP and ¬P\neg P to be true simultaneously.

Step 4: Thus, P¬PP \land \neg P is always false.

Answer: P¬PFP \land \neg P \equiv \text{F} (a contradiction).

---

Problem-Solving Strategies

1. Translating Natural Language to Propositional Logic

Many CMI problems require translating real-world statements into formal logical expressions.

💡 Translating Implications

Pay close attention to keywords that indicate the antecedent (PP) and the consequent (QQ) in an implication P    QP \implies Q:
"If P, then Q": P    QP \implies Q
"P is sufficient for Q": P    QP \implies Q (PP guarantees QQ)
"Q is necessary for P": P    QP \implies Q (PP cannot happen without QQ)
"P only if Q": P    QP \implies Q (If PP is true, then QQ must also be true)
"Unless Q, then P": ¬Q    P\neg Q \implies P or PQP \lor Q
"Neither P nor Q": ¬P¬Q¬(PQ)\neg P \land \neg Q \equiv \neg(P \lor Q)

2. Solving Consistency Puzzles (Knights & Knaves Type)

These problems involve individuals who always tell the truth (Knights) or always lie (Knaves), or sometimes a third type. The goal is to determine each person's type and/or the truth of their statements.

💡 Knights & Knaves Strategy

  • Assign Variables: Assign propositional variables to each person's type (e.g., KAK_A: "A is a Knight", KBK_B: "B is a Knight").

  • Translate Statements: Express each person's statement as a propositional formula.

  • Formulate Implications: For each person XX and their statement SXS_X:

  • If XX is a Knight, then SXS_X is true: KX    SXK_X \implies S_X.
    If XX is a Knave, then SXS_X is false: ¬KX    ¬SX\neg K_X \implies \neg S_X.
    These two implications can be combined into a biconditional: KX    SXK_X \iff S_X. (This is the most powerful tool)
  • Case Analysis & Contradiction:

  • Assume a type for one person (e.g., "A is a Knight").
    Use the KX    SXK_X \iff S_X rule to deduce the truth of their statement.
    Use the truth of their statement to deduce information about other people or their statements.
    Continue deducing until you find a contradiction (e.g., a person is both a Knight and a Knave, or a statement is both true and false).
    If a contradiction is found, the initial assumption was false.
    * If no contradiction, the scenario is consistent and represents a possible solution.
  • Exhaust all possibilities: Systematically check all plausible initial assumptions.

Worked Example: Knights & Knaves

Problem: On an island of Knights and Knaves, you meet two inhabitants, A and B.
A says: "B is a Knave."
B says: "We are both Knaves."
Determine if A and B are Knights or Knaves.

Solution:

Step 1: Define propositions.
Let KAK_A: "A is a Knight."
Let KBK_B: "B is a Knight."
Statements:
SAS_A: "B is a Knave" ¬KB\equiv \neg K_B.
SBS_B: "We are both Knaves" ¬KA¬KB\equiv \neg K_A \land \neg K_B.

Step 2: Formulate biconditionals.
From A's statement: KA    SA    KA    ¬KBK_A \iff S_A \implies K_A \iff \neg K_B.
From B's statement: KB    SB    KB    (¬KA¬KB)K_B \iff S_B \implies K_B \iff (\neg K_A \land \neg K_B).

Step 3: Case Analysis.

Case 1: Assume A is a Knight (KAK_A is T).
If KAK_A is T, then SAS_A must be T.
SAS_A is "B is a Knave", so ¬KB\neg K_B is T.
This means KBK_B is F (B is a Knave).

Now check B's statement:
If B is a Knave (KBK_B is F), then SBS_B must be F.
SBS_B is "We are both Knaves" (¬KA¬KB\neg K_A \land \neg K_B).
Substitute KA=K_A=T, KB=K_B=F into SBS_B: ¬T¬FFTF\neg \text{T} \land \neg \text{F} \equiv \text{F} \land \text{T} \equiv \text{F}.
So SBS_B is F. This is consistent with B being a Knave.

Therefore, Case 1 (A is a Knight, B is a Knave) is a consistent solution.

Case 2: Assume A is a Knave (KAK_A is F).
If KAK_A is F, then SAS_A must be F.
SAS_A is "B is a Knave", so ¬KB\neg K_B is F.
This means KBK_B is T (B is a Knight).

Now check B's statement:
If B is a Knight (KBK_B is T), then SBS_B must be T.
SBS_B is "We are both Knaves" (¬KA¬KB\neg K_A \land \neg K_B).
Substitute KA=K_A=F, KB=K_B=T into SBS_B: ¬F¬TTFF\neg \text{F} \land \neg \text{T} \equiv \text{T} \land \text{F} \equiv \text{F}.
So SBS_B is F.
But we deduced that B is a Knight, so SBS_B must be T.
This is a contradiction (SBS_B is F and SBS_B is T).
Therefore, Case 2 (A is a Knave) is inconsistent.

Answer: A is a Knight and B is a Knave.

---

Common Mistakes

⚠️ Avoid These Errors
    • Confusing Implication with Biconditional: P    QP \implies Q is not the same as P    QP \iff Q. Remember P    QP \implies Q is true when PP is false, regardless of QQ.
    • Incorrectly Negating Implications: ¬(P    Q)\neg(P \implies Q) is NOT ¬P    ¬Q\neg P \implies \neg Q. Instead, remember the key equivalence: ¬(P    Q)P¬Q\neg(P \implies Q) \equiv P \land \neg Q.
    • Misinterpreting "Necessary" vs. "Sufficient":
- "P is sufficient for Q" means P    QP \implies Q. (If PP, then QQ). - "P is necessary for Q" means Q    PQ \implies P. (If QQ, then PP).
    • Errors in Truth Table Construction: Mismatched rows, incorrect application of logical operator definitions, especially for implication. Always follow the order of operations (negation, conjunction/disjunction, implication/biconditional).
    • Not Checking All Cases in Consistency Puzzles: If you only find one consistent scenario, ensure you've explored all initial possibilities to confirm it's the only one or to rule out others by contradiction.
    • Confusing Inclusive vs. Exclusive OR: Standard \lor is inclusive. If "exactly one" is implied, use \oplus or express it as (PQ)¬(PQ)(P \lor Q) \land \neg(P \land Q).

---

Practice Questions

:::question type="MCQ" question="(PQ)    P(P \land Q) \implies P" options=["(PQ)    P(P \land Q) \implies P","(PQ)¬P(P \lor Q) \land \neg P","P    (PQ)P \implies (P \land Q)","P¬PP \land \neg P"] answer="(PQ)    P(P \land Q) \implies P" hint="A tautology is always true. Consider the truth table for each option or use logical equivalences." solution="Let's analyze each option:

  • (PQ)    P(P \land Q) \implies P:

  • If PQP \land Q is true, then PP must be true.
    If PQP \land Q is false, then the implication is true regardless of PP.
    So, this statement is always true. It's a tautology (Absorption Law variant).

    Truth Table:

    PQPQ(PQ)    PTTTTTFFTFTFTFFFT\begin{array}{cccc}
    P & Q & P \land Q & (P \land Q) \implies P \\
    \text{T} & \text{T} & \text{T} & \text{T} \\
    \text{T} & \text{F} & \text{F} & \text{T} \\
    \text{F} & \text{T} & \text{F} & \text{T} \\
    \text{F} & \text{F} & \text{F} & \text{T}\end{array}

  • (PQ)¬P(P \lor Q) \land \neg P: This simplifies to Q¬PQ \land \neg P using Distributive and Identity Laws. This is a contingency.

  • P    (PQ)P \implies (P \land Q): This is false if PP is true and PQP \land Q is false (i.e., PP is true, QQ is false). So, it's a contingency.

  • P¬PP \land \neg P: This is always false (a contradiction).
  • The correct option is (PQ)    P(P \land Q) \implies P.
    Answer: (PQ)    P\boxed{(P \land Q) \implies P}"
    :::

    :::question type="NAT" question="A logician makes the following three statements:

  • This statement is false.

  • 2+2=42+2=4.

  • Statements 1 and 2 are both true.
  • How many of these statements are true?" answer="1" hint="Analyze each statement for consistency. Statement 1 is a classic paradox. Statement 2 is a mathematical fact. Statement 3 connects the truth values of the first two." solution="Let's denote the truth value of statement ii as TiT_i.

  • Statement 1: 'This statement is false.'

  • If Statement 1 is true, then it must be false (by its own content). This is a contradiction.
    If Statement 1 is false, then it is true (because it claims to be false, and it is false). This is also a contradiction.
    This is a self-referential paradox. In classical logic, such statements are typically considered neither true nor false, or outside the scope of propositions. For typical CMI problems, if a statement leads to a direct paradox, it is considered to have no consistent truth value or is problematic. Let's assume it cannot be true. So, Statement 1 is not true.

  • Statement 2: '2+2=42+2=4.'

  • This is a mathematically true statement. So, Statement 2 is True.

  • Statement 3: 'Statements 1 and 2 are both true.'

  • Let's evaluate S3S_3: S1S2S_1 \land S_2.
    We determined that Statement 1 is not true (it leads to a paradox, so it cannot be consistently assigned 'true').
    We determined that Statement 2 is true.
    So, S1S2S_1 \land S_2 would be (Not True) \land True, which evaluates to False.
    Therefore, Statement 3 is False.

    Counting the true statements:
    Statement 1: Not True (paradoxical)
    Statement 2: True
    Statement 3: False

    Only Statement 2 is true.

    The number of true statements is 1.
    Answer: 1\boxed{1}"
    :::

    :::question type="MSQ" question="Which of the following propositions are logically equivalent to P    (QR)P \implies (Q \lor R)?" options=["¬PQR\neg P \lor Q \lor R","P¬Q¬RP \land \neg Q \land \neg R","(P¬Q)    R(P \land \neg Q) \implies R","(¬Q¬R)    ¬P(\neg Q \land \neg R) \implies \neg P"] answer="A,C,D" hint="Use the implication equivalence A    B¬ABA \implies B \equiv \neg A \lor B and De Morgan's laws. For MSQ, check each option individually." solution="Let's analyze each option for equivalence to P    (QR)P \implies (Q \lor R):

    The original expression: P    (QR)P \implies (Q \lor R)
    Using A    B¬ABA \implies B \equiv \neg A \lor B, we can write this as:
    ¬P(QR)¬PQR\neg P \lor (Q \lor R) \equiv \neg P \lor Q \lor R.

    So, option A is logically equivalent.

    Let's check the other options:

    Option A: ¬PQR\neg P \lor Q \lor R
    As derived above, this is equivalent. So, A is correct.

    Option B: P¬Q¬RP \land \neg Q \land \neg R
    This is the negation of P    (QR)P \implies (Q \lor R).
    ¬(P    (QR))P¬(QR)P(¬Q¬R)\neg(P \implies (Q \lor R)) \equiv P \land \neg(Q \lor R) \equiv P \land (\neg Q \land \neg R).
    So, Option B is the negation, not the equivalence. B is incorrect.

    Option C: (P¬Q)    R(P \land \neg Q) \implies R
    Using A    B¬ABA \implies B \equiv \neg A \lor B:
    (P¬Q)    R¬(P¬Q)R(P \land \neg Q) \implies R \equiv \neg(P \land \neg Q) \lor R
    Using De Morgan's Law: ¬(P¬Q)¬P¬(¬Q)¬PQ\neg(P \land \neg Q) \equiv \neg P \lor \neg(\neg Q) \equiv \neg P \lor Q.
    So, (P¬Q)    R(¬PQ)R¬PQR(P \land \neg Q) \implies R \equiv (\neg P \lor Q) \lor R \equiv \neg P \lor Q \lor R.
    This is equivalent to the original expression. So, C is correct.

    Option D: (¬Q¬R)    ¬P(\neg Q \land \neg R) \implies \neg P
    Let's re-evaluate option D directly using A    B¬ABA \implies B \equiv \neg A \lor B:
    (¬Q¬R)    ¬P¬(¬Q¬R)¬P(\neg Q \land \neg R) \implies \neg P \equiv \neg(\neg Q \land \neg R) \lor \neg P
    Using De Morgan's Law: ¬(¬Q¬R)¬(¬Q)¬(¬R)QR\neg(\neg Q \land \neg R) \equiv \neg(\neg Q) \lor \neg(\neg R) \equiv Q \lor R.
    So, (¬Q¬R)    ¬P(QR)¬P¬PQR(\neg Q \land \neg R) \implies \neg P \equiv (Q \lor R) \lor \neg P \equiv \neg P \lor Q \lor R.
    This is equivalent to the original expression. So, D is correct.

    The correct options are A, C, D.
    Answer: A, C, D\boxed{\text{A, C, D}}"
    :::

    :::question type="SUB" question="Prove the Absorption Law P(PQ)PP \lor (P \land Q) \equiv P using other logical equivalences." answer="Proof shows P(PQ)P \lor (P \land Q) simplifies to PP." hint="Start by applying the Identity Law to PP to introduce a 'True' proposition, then use the Distributive Law." solution="We want to prove P(PQ)PP \lor (P \land Q) \equiv P.

    Step 1: Start with the left-hand side (LHS) of the equivalence.

    P(PQ)P \lor (P \land Q)

    Step 2: Apply the Identity Law PPTP \equiv P \land \text{T}. This allows us to introduce a 'True' proposition for later use in the distributive law.

    (PT)(PQ)\equiv (P \land \text{T}) \lor (P \land Q)

    Step 3: Apply the Distributive Law A(BC)(AB)(AC)A \lor (B \land C) \equiv (A \lor B) \land (A \lor C) in reverse. Here, A=PA=P, B=TB=\text{T}, C=QC=Q.

    P(TQ)\equiv P \land (\text{T} \lor Q)

    Step 4: Apply the Domination Law TQT\text{T} \lor Q \equiv \text{T}. (Anything OR True is True).

    PT\equiv P \land \text{T}

    Step 5: Apply the Identity Law PTPP \land \text{T} \equiv P.

    P\equiv P

    Step 6: The LHS has been transformed into the right-hand side (RHS).

    Therefore, P(PQ)PP \lor (P \land Q) \equiv P is proven.
    Answer: Proof shows P(PQ) simplifies to P.\boxed{\text{Proof shows } P \lor (P \land Q) \text{ simplifies to } P.}"
    :::

    :::question type="MCQ" question="In a specific CMI entrance exam, the following rules apply:

  • If a candidate scores above 90% in Mathematics (MM), they are eligible for the Data Science program (DD).

  • A candidate is eligible for the Data Science program only if they have prior programming experience (PP).

  • It is not true that a candidate has prior programming experience and does not score above 90% in Mathematics.
  • Let MM: 'Candidate scores above 90% in Mathematics.'
    Let PP: 'Candidate has prior programming experience.'
    Let DD: 'Candidate is eligible for the Data Science program.'

    Which of the following statements is a valid conclusion from the given rules?" options=["A candidate with prior programming experience is always eligible for the Data Science program.","A candidate scoring above 90% in Mathematics must have prior programming experience.","If a candidate is not eligible for the Data Science program, then they did not score above 90% in Mathematics.","Scoring above 90% in Mathematics is a necessary condition for eligibility in the Data Science program."] answer="A candidate scoring above 90% in Mathematics must have prior programming experience." hint="First, translate all given rules into propositional logic. Then, analyze each option to see if it logically follows from the combined rules." solution="Step 1: Translate the given rules into propositional logic.
    Rule 1: If M, then D.

    M    DM \implies D

    Rule 2: D only if P. (This means if D is true, then P must be true. So D    PD \implies P).
    D    PD \implies P

    Rule 3: It is not true that (P and not M).
    ¬(P¬M)\neg (P \land \neg M)

    Using De Morgan's Law and Double Negation: ¬(P¬M)¬P¬(¬M)¬PM\neg (P \land \neg M) \equiv \neg P \lor \neg (\neg M) \equiv \neg P \lor M.
    Using Implication Equivalence: ¬PMP    M\neg P \lor M \equiv P \implies M.
    So Rule 3 is equivalent to:
    P    MP \implies M

    Step 2: Combine the rules.
    We have:

  • M    DM \implies D

  • D    PD \implies P

  • P    MP \implies M
  • Combining these using transitivity of implication:
    From (1) and (2): M    DM \implies D and D    PD \implies P, therefore M    PM \implies P.
    From (2) and (3): D    PD \implies P and P    MP \implies M, therefore D    MD \implies M.
    From (3) and (1): P    MP \implies M and M    DM \implies D, therefore P    DP \implies D.

    This forms a cycle of implications: M    D    PM \iff D \iff P. All three propositions are logically equivalent.

    Step 3: Evaluate each option.

    * 'A candidate with prior programming experience is always eligible for the Data Science program.'
    This translates to P    DP \implies D. From our combined rules, P    DP \iff D is true, so P    DP \implies D is a valid conclusion. This statement is correct.

    * 'A candidate scoring above 90% in Mathematics must have prior programming experience.'
    This translates to M    PM \implies P. From our combined rules, M    PM \iff P is true, so M    PM \implies P is a valid conclusion. This statement is correct.

    * 'If a candidate is not eligible for the Data Science program, then they did not score above 90% in Mathematics.'
    This translates to ¬D    ¬M\neg D \implies \neg M. This is the contrapositive of M    DM \implies D, which is a valid rule. So, this statement is correct.

    * 'Scoring above 90% in Mathematics is a necessary condition for eligibility in the Data Science program.'
    This translates to D    MD \implies M. From our combined rules, D    MD \iff M is true, so D    MD \implies M is a valid conclusion. This statement is correct.

    All options are logically valid conclusions. In a single-choice MCQ where multiple options are logically valid, the intended answer is often the most direct or foundational deduction. Option B (M    PM \implies P) is a direct transitive consequence of the first two rules (M    DM \implies D and D    PD \implies P).

    The final answer is \text{A candidate scoring above 90% in Mathematics must have prior programming experience.}
    Answer: \boxed{\text{A candidate scoring above 90% in Mathematics must have prior programming experience.}}"
    :::

    :::question type="NAT" question="A group of three friends, X, Y, and Z, are in a room. You know that exactly one of them is telling the truth, and the other two are lying. They make the following statements:
    X: 'Y is a liar.'
    Y: 'Z is a liar.'
    Z: 'X is telling the truth.'

    Determine the number of liars among X, Y, and Z. (Provide only the number)." answer="2" hint="Assume each person is the truth-teller in turn and check for consistency with the rule 'exactly one truth-teller, two liars'." solution="Let TX,TY,TZT_X, T_Y, T_Z be propositions that X, Y, Z are telling the truth, respectively.
    We are given that exactly one of TX,TY,TZT_X, T_Y, T_Z is true. This means:

    (TX¬TY¬TZ)(¬TXTY¬TZ)(¬TX¬TYTZ)(T_X \land \neg T_Y \land \neg T_Z) \lor (\neg T_X \land T_Y \land \neg T_Z) \lor (\neg T_X \land \neg T_Y \land T_Z)

    is true.

    Statements:
    SXS_X: 'Y is a liar' ¬TY\equiv \neg T_Y.
    SYS_Y: 'Z is a liar' ¬TZ\equiv \neg T_Z.
    SZS_Z: 'X is telling the truth' TX\equiv T_X.

    Conditions for each person:
    If X is a truth-teller (TXT_X), then X's statement SXS_X must be true. So TX    SXT_X \iff S_X.
    If X is a liar (¬TX\neg T_X), then X's statement SXS_X must be false. So ¬TX    ¬SX\neg T_X \iff \neg S_X, which is also TX    SXT_X \iff S_X.
    Thus, for each person, their truth-telling status is equivalent to the truth value of their statement:
    TX    ¬TYT_X \iff \neg T_Y
    TY    ¬TZT_Y \iff \neg T_Z
    TZ    TXT_Z \iff T_X

    Now, let's test the three possible scenarios for exactly one truth-teller:

    Scenario 1: X is the truth-teller (TXT_X is True, ¬TY\neg T_Y is True, ¬TZ\neg T_Z is True).
    * Since TXT_X is True, X's statement SXS_X must be True. SX¬TYS_X \equiv \neg T_Y. So ¬TY\neg T_Y is True. This is consistent with our assumption that Y is a liar.
    * Since Y is a liar (¬TY\neg T_Y is True), Y's statement SYS_Y must be False. SY¬TZS_Y \equiv \neg T_Z. So ¬TZ\neg T_Z must be False, which means TZT_Z is True.
    * But our initial assumption for this scenario was that Z is a liar (¬TZ\neg T_Z is True).
    * We have a contradiction: TZT_Z is True and ¬TZ\neg T_Z is True.
    * Therefore, Scenario 1 is impossible.

    Scenario 2: Y is the truth-teller (¬TX\neg T_X is True, TYT_Y is True, ¬TZ\neg T_Z is True).
    * Since Y is a truth-teller (TYT_Y is True), Y's statement SYS_Y must be True. SY¬TZS_Y \equiv \neg T_Z. So ¬TZ\neg T_Z is True. This is consistent with our assumption that Z is a liar.
    * Since X is a liar (¬TX\neg T_X is True), X's statement SXS_X must be False. SX¬TYS_X \equiv \neg T_Y. So ¬TY\neg T_Y must be False, which means TYT_Y is True. This is consistent with our assumption that Y is a truth-teller.
    * Since Z is a liar (¬TZ\neg T_Z is True), Z's statement SZS_Z must be False. SZTXS_Z \equiv T_X. So TXT_X must be False. This is consistent with our assumption that X is a liar.
    * All conditions are consistent.
    * Therefore, Scenario 2 is the consistent solution: X is a liar, Y is a truth-teller, Z is a liar.

    Scenario 3: Z is the truth-teller (¬TX\neg T_X is True, ¬TY\neg T_Y is True, TZT_Z is True).
    * Since Z is a truth-teller (TZT_Z is True), Z's statement SZS_Z must be True. SZTXS_Z \equiv T_X. So TXT_X is True.
    * But our initial assumption for this scenario was that X is a liar (¬TX\neg T_X is True).
    * We have a contradiction: TXT_X is True and ¬TX\neg T_X is True.
    * Therefore, Scenario 3 is impossible.

    The only consistent scenario is that Y is the truth-teller, and X and Z are liars.
    The question asks for the number of liars.
    In this consistent scenario, X is a liar and Z is a liar.

    Number of liars = 2.
    Answer: 2\boxed{2}"
    :::

    :::question type="MSQ" question="Let PP be 'The sun is shining' and QQ be 'It is warm'. Which of the following statements correctly translates to ¬PQ\neg P \lor Q?" options=["If the sun is not shining, then it is warm.","It is not the case that the sun is shining and it is not warm.","The sun is shining only if it is warm.","It is warm unless the sun is shining."] answer="B,C,D" hint="Recall that ¬PQ\neg P \lor Q is equivalent to P    QP \implies Q. Analyze each option's logical meaning." solution="The propositional formula is ¬PQ\neg P \lor Q.
    We know that ¬PQP    Q\neg P \lor Q \equiv P \implies Q.
    So we are looking for statements equivalent to 'If the sun is shining, then it is warm.'

    Let's analyze each option:

    A. 'If the sun is not shining, then it is warm.'
    This translates to ¬P    Q\neg P \implies Q.
    Using implication equivalence: ¬P    Q¬(¬P)QPQ\neg P \implies Q \equiv \neg(\neg P) \lor Q \equiv P \lor Q.
    This is not equivalent to ¬PQ\neg P \lor Q. So, A is incorrect.

    B. 'It is not the case that the sun is shining and it is not warm.'
    This translates to ¬(P¬Q)\neg (P \land \neg Q).
    Using De Morgan's Law: ¬(P¬Q)¬P¬(¬Q)¬PQ\neg (P \land \neg Q) \equiv \neg P \lor \neg(\neg Q) \equiv \neg P \lor Q.
    This is equivalent to the original expression. So, B is correct.

    C. 'The sun is shining only if it is warm.'
    The phrase "P only if Q" translates to P    QP \implies Q.
    So, 'The sun is shining only if it is warm' translates to P    QP \implies Q.
    As established, P    Q¬PQP \implies Q \equiv \neg P \lor Q.
    This is equivalent to the original expression. So, C is correct.

    D. 'It is warm unless the sun is shining.'
    The phrase "A unless B" can be interpreted as "A is true, provided B is not true", or more formally, that the statement is false only if "not A and B".
    Let A = 'It is warm' (QQ) and B = 'the sun is shining' (PP).
    So, 'It is warm unless the sun is shining' is false if 'It is not warm AND the sun is shining'.
    This means the negation of the statement is ¬QP\neg Q \land P.
    Therefore, the statement itself is ¬(¬QP)\neg (\neg Q \land P).
    Using De Morgan's Law: ¬(¬QP)¬(¬Q)¬PQ¬P\neg (\neg Q \land P) \equiv \neg(\neg Q) \lor \neg P \equiv Q \lor \neg P.
    This is exactly ¬PQ\neg P \lor Q.
    This interpretation makes option D equivalent to the original expression. So, D is correct.

    Therefore, B, C, D are all correct.
    Answer: B, C, D\boxed{\text{B, C, D}}"
    :::

    ---

    Summary

    Key Takeaways for CMI

    • Master Truth Tables: Be able to construct truth tables for any compound proposition and use them to define connectives, determine tautologies/contradictions, and prove logical equivalence.

    • Understand and Apply Key Logical Equivalences: Memorize and skillfully apply laws like De Morgan's, Distributive, and especially the Implication Equivalence (P    Q¬PQP \implies Q \equiv \neg P \lor Q) and Negation of Implication (¬(P    Q)P¬Q\neg(P \implies Q) \equiv P \land \neg Q). These are critical for simplification and proofs.

    • Proficiently Translate Natural Language into Propositional Logic: Pay meticulous attention to keywords like "if...then", "only if", "necessary", "sufficient", "unless", and "not...and...". Ambiguities must be handled by systematic logical conversion.

    • Develop Systematic Approach for Consistency Puzzles: For Knights & Knaves or similar problems, consistently use the biconditional rule (TX    SXT_X \iff S_X), and systematically test scenarios, looking for contradictions.

    ---

    What's Next?

    💡 Continue Learning

    This topic connects to:

      • Predicate Logic: Extends propositional logic by introducing variables, predicates, and quantifiers (universal and existential), allowing for more detailed statements about objects and their properties.

      • Proof Techniques: Direct proof, proof by contradiction, mathematical induction, and other formal proof methods heavily rely on the principles of propositional logic to construct valid arguments.

      • Set Theory: Logical operators are fundamental for defining set operations (union, intersection, complement), set relationships (subset, equality), and for proving theorems in set theory.

      • Boolean Algebra: A mathematical system that formalizes the rules of logical operations, directly applicable in digital circuit design and computer science.


    Master these connections for comprehensive CMI preparation!

    ---

    ---

    💡 Moving Forward

    Now that you understand Propositions and Logical Operators, let's explore Truth Tables which builds on these concepts.

    ---

    Part 2: Truth Tables

    Introduction

    Truth tables are fundamental tools in discrete mathematics, serving as a systematic way to determine the truth value of a compound proposition for all possible truth values of its constituent simple propositions. In the context of a Masters in Data Science, a solid understanding of truth tables is crucial for comprehending the underlying logic of algorithms, database queries, artificial intelligence systems, and formal verification methods. They provide a precise and unambiguous method for analyzing logical statements, proving equivalences, and understanding the behavior of boolean functions, which are ubiquitous in computer science. This section will cover the core concepts of boolean values, logical connectives, and the construction and interpretation of truth tables.
    📖 Boolean Value

    A Boolean value is a value that can only be one of two states: True\texttt{True} (often denoted by TT or 11) or False\texttt{False} (often denoted by FF or 00). These values form the basis of all logical operations.

    ---

    Key Concepts

    1. Propositions and Boolean Variables

    A proposition is a declarative sentence that is either true or false, but not both. Simple propositions can be combined using logical connectives to form compound propositions. In formal logic, we assign Boolean variables to represent these simple propositions.

    📖 Proposition

    A proposition is a declarative statement that is either definitively true or definitively false. It cannot be both true and false simultaneously.

    For example, "The sky is blue" is a proposition, and its truth value can be assigned as True\texttt{True}. "Is it raining?" is not a proposition, as it is a question and does not have a truth value.

    2. Logical Connectives and Their Truth Tables

    Logical connectives are symbols or words used to combine simple propositions into more complex compound propositions. Each connective has a specific truth table that defines the truth value of the compound proposition based on the truth values of its constituent simple propositions.

    #### a. Negation (¬\neg)
    The negation of a proposition PP, denoted ¬P\neg P (read as "not PP"), reverses the truth value of PP.

    📐 Truth Table for Negation
    P¬PTFFT\begin{array}{|c|c|} \hline P & \neg P \\ \hline T & F \\ F & T \\ \hline\end{array}

    Variables:

      • PP = A simple proposition


    When to use: To express the opposite truth value of a statement.

    #### b. Conjunction (\land)
    The conjunction of two propositions PP and QQ, denoted PQP \land Q (read as "PP and QQ"), is true only when both PP and QQ are true.

    📐 Truth Table for Conjunction
    PQPQTTTTFFFTFFFF\begin{array}{|c|c|c|} \hline P & Q & P \land Q \\ \hline T & T & T \\ T & F & F \\ F & T & F \\ F & F & F \\ \hline\end{array}

    Variables:

      • PP = First proposition

      • QQ = Second proposition


    When to use: To express that two conditions must both be met.

    #### c. Disjunction (\lor)
    The disjunction of two propositions PP and QQ, denoted PQP \lor Q (read as "PP or QQ"), is true if at least one of PP or QQ is true (inclusive OR).

    📐 Truth Table for Disjunction
    PQPQTTTTFTFTTFFF\begin{array}{|c|c|c|} \hline P & Q & P \lor Q \\ \hline T & T & T \\ T & F & T \\ F & T & T \\ F & F & F \\ \hline\end{array}

    Variables:

      • PP = First proposition

      • QQ = Second proposition


    When to use: To express that at least one of two conditions must be met.

    #### d. Implication (\rightarrow)
    The implication (or conditional statement) of two propositions PP and QQ, denoted PQP \rightarrow Q (read as "if PP then QQ"), is false only when PP is true and QQ is false. PP is the hypothesis (antecedent) and QQ is the conclusion (consequent).

    📐 Truth Table for Implication
    PQPQTTTTFFFTTFFT\begin{array}{|c|c|c|} \hline P & Q & P \rightarrow Q \\ \hline T & T & T \\ T & F & F \\ F & T & T \\ F & F & T \\ \hline\end{array}

    Variables:

      • PP = Hypothesis

      • QQ = Conclusion


    When to use: To express a cause-and-effect or conditional relationship. It's often counter-intuitive that FTF \rightarrow T and FFF \rightarrow F are true; this is because a false hypothesis implies anything.

    #### e. Biconditional (\leftrightarrow)
    The biconditional of two propositions PP and QQ, denoted PQP \leftrightarrow Q (read as "PP if and only if QQ"), is true when PP and QQ have the same truth value. It is logically equivalent to (PQ)(QP)(P \rightarrow Q) \land (Q \rightarrow P).

    📐 Truth Table for Biconditional
    PQPQTTTTFFFTFFFT\begin{array}{|c|c|c|} \hline P & Q & P \leftrightarrow Q \\ \hline T & T & T \\ T & F & F \\ F & T & F \\ F & F & T \\ \hline\end{array}

    Variables:

      • PP = First proposition

      • QQ = Second proposition


    When to use: To express that two conditions are logically equivalent or imply each other.

    #### f. Exclusive OR (\oplus)
    The exclusive OR of two propositions PP and QQ, denoted PQP \oplus Q (read as "PP XOR QQ"), is true when exactly one of PP or QQ is true, but not both.

    📐 Truth Table for Exclusive OR
    PQPQTTFTFTFTTFFF\begin{array}{|c|c|c|} \hline P & Q & P \oplus Q \\ \hline T & T & F \\ T & F & T \\ F & T & T \\ F & F & F \\ \hline\end{array}

    Variables:

      • PP = First proposition

      • QQ = Second proposition


    When to use: To express that exactly one of two conditions must be met.

    Worked Example: Constructing a Truth Table for a Simple Compound Proposition

    Problem: Construct the truth table for the compound proposition ¬PQ\neg P \lor Q.

    Solution:

    Step 1: List all possible truth value combinations for the simple propositions.
    Since there are two propositions (PP and QQ), there will be 22=42^2 = 4 rows in the truth table.

    PQTTTFFTFF\begin{array}{|c|c|} \hline P & Q \\ \hline T & T \\ T & F \\ F & T \\ F & F \\ \hline\end{array}

    Step 2: Evaluate the negation of PP, ¬P\neg P.

    PQ¬PTTFTFFFTTFF\begin{array}{|c|c|c|} \hline P & Q & \neg P \\ \hline T & T & F \\ T & F & F \\ F & T & T \\ F & F \\ \hline\end{array}

    Step 3: Evaluate the disjunction of ¬P\neg P and QQ, which is ¬PQ\neg P \lor Q.

    PQ¬P¬PQTTFTTFFFFTTTFFTT\begin{array}{|c|c|c|c|} \hline P & Q & \neg P & \neg P \lor Q \\ \hline T & T & F & T \\ T & F & F & F \\ F & T & T & T \\ F & F & T & T \\ \hline\end{array}

    Answer: The final column of the table above represents the truth table for ¬PQ\neg P \lor Q.

    ---

    ---

    #
    ## 3. Constructing Truth Tables for Compound Propositions

    To construct a truth table for any compound proposition:

  • Determine the number of rows: If there are nn distinct simple propositions, there will be 2n2^n rows in the truth table, representing all possible combinations of truth values for these propositions.

  • List all simple propositions: Create columns for each distinct simple proposition (e.g., P,Q,RP, Q, R).

  • Create columns for sub-expressions: Add columns for intermediate expressions, following the order of operations (negation first, then conjunction/disjunction, then implication/biconditional).

  • Evaluate truth values: Fill in the truth values for each column based on the definitions of the logical connectives.

  • Final column: The last column will represent the truth values of the entire compound proposition.
  • Worked Example: Constructing a Truth Table for a Complex Expression

    Problem: Construct the truth table for the compound proposition (P¬Q)(RQ)(P \land \neg Q) \rightarrow (R \lor Q).

    Solution:

    Step 1: Identify simple propositions and number of rows.
    Simple propositions are P,Q,RP, Q, R. Number of rows = 23=82^3 = 8.

    PQRTTTTTFTFTTFFFTTFTFFFTFFF\begin{array}{|c|c|c|} \hline P & Q & R \\ \hline T & T & T \\ T & T & F \\ T & F & T \\ T & F & F \\ F & T & T \\ F & T & F \\ F & F & T \\ F & F & F \\ \hline\end{array}

    Step 2: Evaluate ¬Q\neg Q.

    PQR¬QTTTFTTFFTFTTTFFTFTTFFTFFFFTTFFFT\begin{array}{|c|c|c|c|} \hline P & Q & R & \neg Q \\ \hline T & T & T & F \\ T & T & F & F \\ T & F & T & T \\ T & F & F & T \\ F & T & T & F \\ F & T & F & F \\ F & F & T & T \\ F & F & F & T \\ \hline\end{array}

    Step 3: Evaluate P¬QP \land \neg Q.

    PQR¬QP¬QTTTFFTTFFFTFTTTTFFTTFTTFFFTFFFFFTTFFFFTF\begin{array}{|c|c|c|c|c|} \hline P & Q & R & \neg Q & P \land \neg Q \\ \hline T & T & T & F & F \\ T & T & F & F & F \\ T & F & T & T & T \\ T & F & F & T & T \\ F & T & T & F & F \\ F & T & F & F & F \\ F & F & T & T & F \\ F & F & F & T & F \\ \hline\end{array}

    Step 4: Evaluate RQR \lor Q.

    PQR¬QP¬QRQTTTFFTTTFFFTTFTTTTTFFTTFFTTFFTFTFFFTFFTTFTFFFTFF\begin{array}{|c|c|c|c|c|c|} \hline P & Q & R & \neg Q & P \land \neg Q & R \lor Q \\ \hline T & T & T & F & F & T \\ T & T & F & F & F & T \\ T & F & T & T & T & T \\ T & F & F & T & T & F \\ F & T & T & F & F & T \\ F & T & F & F & F & T \\ F & F & T & T & F & T \\ F & F & F & T & F & F \\ \hline\end{array}

    Step 5: Evaluate the final implication (P¬Q)(RQ)(P \land \neg Q) \rightarrow (R \lor Q).

    PQR¬QP¬QRQ(P¬Q)(RQ)TTTFFTTTTFFFTTTFTTTTTTFFTTFFFTTFFTTFTFFFTTFFTTFTTFFFTFFT\begin{array}{|c|c|c|c|c|c|c|} \hline P & Q & R & \neg Q & P \land \neg Q & R \lor Q & (P \land \neg Q) \rightarrow (R \lor Q) \\ \hline T & T & T & F & F & T & T \\ T & T & F & F & F & T & T \\ T & F & T & T & T & T & T \\ T & F & F & T & T & F & F \\ F & T & T & F & F & T & T \\ F & T & F & F & F & T & T \\ F & F & T & T & F & T & T \\ F & F & F & T & F & F & T \\ \hline\end{array}

    Answer: The final column of the table above represents the truth table for (P¬Q)(RQ)(P \land \neg Q) \rightarrow (R \lor Q).

    ---

    #
    ## 4. Tautologies, Contradictions, and Contingencies

    Based on the final column of a truth table, a compound proposition can be classified into one of three types:

    📖 Tautology

    A tautology is a compound proposition that is always true, regardless of the truth values of its simple propositions. All entries in its truth table's final column are True\texttt{True}.

    📖 Contradiction

    A contradiction is a compound proposition that is always false, regardless of the truth values of its simple propositions. All entries in its truth table's final column are False\texttt{False}.

    📖 Contingency

    A contingency is a compound proposition that is neither a tautology nor a contradiction. Its truth value depends on the truth values of its simple propositions, meaning its truth table's final column contains both True\texttt{True} and False\texttt{False} entries.

    Example:

    • P¬PP \lor \neg P is a tautology.

    • P¬PP \land \neg P is a contradiction.

    • PQP \rightarrow Q is a contingency.


    ---

    #
    ## 5. Logical Equivalence

    Two propositions are logically equivalent if they always have the same truth value for all possible truth assignments of their simple propositions. This means their truth tables are identical.

    📖 Logical Equivalence

    Two compound propositions AA and BB are logically equivalent, denoted ABA \equiv B, if and only if their biconditional ABA \leftrightarrow B is a tautology. Alternatively, they are equivalent if their truth tables are identical.

    Worked Example: Proving De Morgan's Law using a Truth Table

    Problem: Prove De Morgan's Law: ¬(PQ)¬P¬Q\neg (P \land Q) \equiv \neg P \lor \neg Q.

    Solution:

    Step 1: Construct truth tables for both sides of the equivalence.
    We need columns for P,Q,PQ,¬(PQ)P, Q, P \land Q, \neg (P \land Q) and ¬P,¬Q,¬P¬Q\neg P, \neg Q, \neg P \lor \neg Q.

    PQPQ¬(PQ)¬P¬Q¬P¬QTTTFFFFTFFTFTTFTFTTFTFFFTTTT\begin{array}{|c|c|c|c|c|c|c|} \hline P & Q & P \land Q & \neg (P \land Q) & \neg P & \neg Q & \neg P \lor \neg Q \\ \hline T & T & T & F & F & F & F \\ T & F & F & T & F & T & T \\ F & T & F & T & T & F & T \\ F & F & F & T & T & T & T \\ \hline\end{array}

    Step 2: Compare the final columns.
    The column for ¬(PQ)\neg (P \land Q) is: F,T,T,TF, T, T, T.
    The column for ¬P¬Q\neg P \lor \neg Q is: F,T,T,TF, T, T, T.

    Since both columns are identical for all possible truth assignments of PP and QQ, the two propositions are logically equivalent.

    Answer: The truth tables confirm that ¬(PQ)¬P¬Q\neg (P \land Q) \equiv \neg P \lor \neg Q.

    ---

    ---

    6. Boolean Functions

    A boolean function is a function that maps inputs from a set of boolean values to a single boolean output value. Truth tables are the primary way to represent and define boolean functions.

    📖 Boolean Function

    An nn-ary Boolean function is a function f:{T,F}n{T,F}f: \{T, F\}^n \rightarrow \{T, F\} that takes nn Boolean input values and produces a single Boolean output value.

    For an nn-ary boolean function, there are 2n2^n possible input combinations (rows in the truth table). For each input combination, the function can output either TT or FF. Therefore, there are 22n2^{2^n} distinct nn-ary boolean functions.

    Example:

    • For n=1n=1 (unary function), there are 221=22=42^{2^1} = 2^2 = 4 possible functions:

    1. f(P)=Tf(P) = T (always true)
    2. f(P)=Ff(P) = F (always false)
    3. f(P)=Pf(P) = P (identity)
    4. f(P)=¬Pf(P) = \neg P (negation)
    • For n=2n=2 (binary function), there are 222=24=162^{2^2} = 2^4 = 16 possible functions (e.g., AND, OR, XOR, NOR, NAND, etc.).

    • For n=3n=3 (3-ary function), there are 223=28=2562^{2^3} = 2^8 = 256 possible functions.


    When comparing two boolean functions, ff and gg, they "agree" on an input combination (x1,,xn)(x_1, \dots, x_n) if f(x1,,xn)=g(x1,,xn)f(x_1, \dots, x_n) = g(x_1, \dots, x_n). They "disagree" if f(x1,,xn)g(x1,,xn)f(x_1, \dots, x_n) \ne g(x_1, \dots, x_n). This comparison is done row by row in their respective truth tables.

    ---

    Problem-Solving Strategies

    💡 Translating Natural Language to Logic

    For problems involving verbal statements, the first crucial step is to translate them into formal logical propositions and connectives.

    • Identify simple propositions: Assign a unique Boolean variable (e.g., P,Q,RP, Q, R) to each distinct simple statement that can be true or false.

    • Identify logical connectives: Recognize keywords like "and" (\land), "or" (\lor), "not" (¬\neg), "if...then..." (\rightarrow), "if and only if" (\leftrightarrow), "either...or..." (\oplus).

    • Formulate compound propositions: Combine the variables using the identified connectives, paying close attention to parentheses for correct grouping and order of operations.

    💡 Systematic Case Analysis with Truth Tables

    When faced with a complex logical puzzle or a set of conditions that must be simultaneously satisfied, a truth table provides a systematic way to explore all possibilities:

    • Define all relevant simple propositions: List every independent statement that can be true or false.

    • Construct a full truth table: Include columns for all simple propositions and intermediate compound conditions.

    • Evaluate each condition: For each row (each possible scenario), determine if the given conditions are true or false.

    • Identify valid scenarios: Filter the rows to find those where all specified conditions are met. This often involves identifying rows where a final compound proposition (representing the conjunction of all conditions) is true.

    • Analyze valid scenarios: Once the valid scenarios are identified, examine the truth values of the simple propositions within those rows to answer the problem's specific question.

    ---

    Common Mistakes

    ⚠️ Implication Direction and Meaning

    Mistake: Assuming PQP \rightarrow Q means PP causes QQ in a temporal or causal sense, or that QPQ \rightarrow P is equivalent. Also, misinterpreting cases where PP is false.
    Correct: PQP \rightarrow Q is a logical implication, not necessarily causal. It is false only when PP is true and QQ is false. If PP is false, the implication PQP \rightarrow Q is always true, regardless of QQ's truth value. Remember, PQP \rightarrow Q is NOT equivalent to QPQ \rightarrow P (the converse), nor to ¬P¬Q\neg P \rightarrow \neg Q (the inverse). It is equivalent to ¬Q¬P\neg Q \rightarrow \neg P (the contrapositive) and ¬PQ\neg P \lor Q.

    ⚠️ Exclusive vs. Inclusive OR

    Mistake: Confusing "or" in natural language with the logical inclusive OR (\lor). Natural language "or" can sometimes imply exclusivity.
    Correct: In formal logic, \lor (disjunction) is always the inclusive OR, meaning "PP or QQ or both." If the problem specifically requires "one or the other, but not both," you must use the exclusive OR (\oplus). Always clarify the intended meaning of "or" in context.

    ⚠️ Order of Operations

    Mistake: Incorrectly evaluating compound propositions by ignoring the standard order of operations for logical connectives.
    Correct: The standard order of precedence is:

    • Negation (¬\neg)

    • Conjunction (\land)

    • Disjunction (\lor)

    • Implication (\rightarrow)

    • Biconditional (\leftrightarrow)

    Use parentheses to explicitly define the order when ambiguity exists or a different order is intended.

    ---

    ---

    Practice Questions

    :::question type="MCQ" question="How many distinct 4-ary boolean functions exist that output True\texttt{True} for exactly two input combinations?" options=["242^4","424^2","(162)\binom{16}{2}","2162^{16}"] answer="(162)\binom{16}{2}" hint="Consider the total number of input combinations and how many of them must result in a True output. Then think about the total number of distinct boolean functions." solution="A 4-ary boolean function has 24=162^4 = 16 possible input combinations (rows in its truth table). For each of these 16 combinations, the function can output either True\texttt{True} or False\texttt{False}.
    The problem states that the function must output True\texttt{True} for exactly two input combinations. This means we need to choose 2 of the 16 possible output positions to be True\texttt{True}, and the remaining 162=1416-2=14 positions will be False\texttt{False}.
    The number of ways to choose 2 positions out of 16 is given by the binomial coefficient (162)\binom{16}{2}.

    (162)=16!2!(162)!=16!2!14!=16×152×1=8×15=120\binom{16}{2} = \frac{16!}{2!(16-2)!} = \frac{16!}{2!14!} = \frac{16 \times 15}{2 \times 1} = 8 \times 15 = 120

    Therefore, there are (162)\binom{16}{2} such functions.
    Answer: (162)\boxed{\binom{16}{2}}"
    :::

    :::question type="NAT" question="Consider the following logical statement: (P¬Q)(¬PQ)(P \land \neg Q) \lor (\neg P \rightarrow Q). How many rows in its truth table will result in a True\texttt{True} value?" answer="3" hint="Construct the full truth table step-by-step and count the True outcomes in the final column." solution="Let's construct the truth table for (P¬Q)(¬PQ)(P \land \neg Q) \lor (\neg P \rightarrow Q).
    First, identify the simple propositions: P,QP, Q. Number of rows: 22=42^2 = 4.

    Step 1: Write down all combinations for PP and QQ.
    Step 2: Evaluate ¬P\neg P and ¬Q\neg Q.
    Step 3: Evaluate P¬QP \land \neg Q.
    Step 4: Evaluate ¬PQ\neg P \rightarrow Q.
    Step 5: Evaluate the final disjunction (P¬Q)(¬PQ)(P \land \neg Q) \lor (\neg P \rightarrow Q).

    PQ¬P¬QP¬Q¬PQ(P¬Q)(¬PQ)TTFFFTTTFFTTTTFTTFFTTFFTTFFF\begin{array}{|c|c|c|c|c|c|c|} \hline P & Q & \neg P & \neg Q & P \land \neg Q & \neg P \rightarrow Q & (P \land \neg Q) \lor (\neg P \rightarrow Q) \\ \hline T & T & F & F & F & T & T \\ T & F & F & T & T & T & T \\ F & T & T & F & F & T & T \\ F & F & T & T & F & F & F \\ \hline\end{array}

    The final column shows True\texttt{True} for the first three rows.

    Therefore, there are 3 rows that result in a True\texttt{True} value.
    Answer: 3\boxed{3}"
    :::

    :::question type="MSQ" question="Which of the following propositions are logically equivalent to PQP \rightarrow Q? Select ALL correct options." options=["¬PQ\neg P \lor Q","¬Q¬P\neg Q \rightarrow \neg P","QPQ \rightarrow P","¬P¬Q\neg P \land \neg Q"] answer="¬PQ\neg P \lor Q, ¬Q¬P\neg Q \rightarrow \neg P" hint="Construct truth tables for PQP \rightarrow Q and each option, then compare the final columns. Remember the definition of contrapositive." solution="Let's first establish the truth table for PQP \rightarrow Q:

    PQPQTTTTFFFTTFFT\begin{array}{|c|c|c|} \hline P & Q & P \rightarrow Q \\ \hline T & T & T \\ T & F & F \\ F & T & T \\ F & F & T \\ \hline\end{array}

    Now, let's evaluate each option:

    Option 1: ¬PQ\neg P \lor Q

    PQ¬P¬PQTTFTTFFFFTTTFFTT\begin{array}{|c|c|c|c|}
    \hline
    P & Q & \neg P & \neg P \lor Q \\
    \hline
    T & T & F & T \\
    T & F & F & F \\
    F & T & T & T \\
    F & F & T & T \\
    \hline\end{array}

    Comparing the last column with PQP \rightarrow Q's column, they are identical. So, ¬PQ\neg P \lor Q is equivalent to PQP \rightarrow Q.

    Option 2: ¬Q¬P\neg Q \rightarrow \neg P (Contrapositive)

    PQ¬Q¬P¬Q¬PTTFFTTFTFFFTFTTFFTTT\begin{array}{|c|c|c|c|c|}
    \hline
    P & Q & \neg Q & \neg P & \neg Q \rightarrow \neg P \\
    \hline
    T & T & F & F & T \\
    T & F & T & F & F \\
    F & T & F & T & T \\
    F & F & T & T & T \\
    \hline\end{array}

    Comparing the last column with PQP \rightarrow Q's column, they are identical. So, ¬Q¬P\neg Q \rightarrow \neg P is equivalent to PQP \rightarrow Q.

    Option 3: QPQ \rightarrow P (Converse)

    PQQPTTTTFTFTFFFT\begin{array}{|c|c|c|}
    \hline
    P & Q & Q \rightarrow P \\
    \hline
    T & T & T \\
    T & F & T \\
    F & T & F \\
    F & F & T \\
    \hline\end{array}

    The column for QPQ \rightarrow P is T,T,F,TT, T, F, T, which is different from PQP \rightarrow Q's column (T,F,T,TT, F, T, T). So, QPQ \rightarrow P is not equivalent to PQP \rightarrow Q.

    Option 4: ¬P¬Q\neg P \land \neg Q

    PQ¬P¬Q¬P¬QTTFFFTFFTFFTTFFFFTTT\begin{array}{|c|c|c|c|c|}
    \hline
    P & Q & \neg P & \neg Q & \neg P \land \neg Q \\
    \hline
    T & T & F & F & F \\
    T & F & F & T & F \\
    F & T & T & F & F \\
    F & F & T & T & T \\
    \hline\end{array}

    The column for ¬P¬Q\neg P \land \neg Q is F,F,F,TF, F, F, T, which is different from PQP \rightarrow Q's column (T,F,T,TT, F, T, T). So, ¬P¬Q\neg P \land \neg Q is not equivalent to PQP \rightarrow Q.

    The correct options are ¬PQ\neg P \lor Q and ¬Q¬P\neg Q \rightarrow \neg P.
    Answer: ¬PQ,¬Q¬P\boxed{\neg P \lor Q, \neg Q \rightarrow \neg P}"
    :::

    :::question type="SUB" question="Prove using a truth table that the proposition (PQ)(PQ)(P \land Q) \rightarrow (P \lor Q) is a tautology." answer="The final column of the truth table for (PQ)(PQ)(P \land Q) \rightarrow (P \lor Q) consists entirely of True\texttt{True} values, thus proving it is a tautology." hint="Construct the truth table for the given compound proposition step-by-step. If all entries in the final column are 'True', it is a tautology." solution="To prove that (PQ)(PQ)(P \land Q) \rightarrow (P \lor Q) is a tautology, we must show that its truth value is always True\texttt{True}, regardless of the truth values of PP and QQ. We do this by constructing a truth table.

    Step 1: List all possible truth value combinations for PP and QQ.

    PQTTTFFTFF\begin{array}{|c|c|} \hline P & Q \\ \hline T & T \\ T & F \\ F & T \\ F & F \\ \hline\end{array}

    Step 2: Evaluate the conjunction PQP \land Q.

    PQPQTTTTFFFTFFFF\begin{array}{|c|c|c|} \hline P & Q & P \land Q \\ \hline T & T & T \\ T & F & F \\ F & T & F \\ F & F & F \\ \hline\end{array}

    Step 3: Evaluate the disjunction PQP \lor Q.

    PQPQPQTTTTTFFTFTFTFFFF\begin{array}{|c|c|c|c|} \hline P & Q & P \land Q & P \lor Q \\ \hline T & T & T & T \\ T & F & F & T \\ F & T & F & T \\ F & F & F & F \\ \hline\end{array}

    Step 4: Evaluate the implication (PQ)(PQ)(P \land Q) \rightarrow (P \lor Q). An implication ABA \rightarrow B is false only if AA is true and BB is false.

    PQPQPQ(PQ)(PQ)TTTTTTFFTTFTFTTFFFFT\begin{array}{|c|c|c|c|c|} \hline P & Q & P \land Q & P \lor Q & (P \land Q) \rightarrow (P \lor Q) \\ \hline T & T & T & T & T \\ T & F & F & T & T \\ F & T & F & T & T \\ F & F & F & F & T \\ \hline\end{array}

    The final column of the truth table shows that the proposition (PQ)(PQ)(P \land Q) \rightarrow (P \lor Q) is True\texttt{True} for all possible truth assignments of PP and QQ. By definition, a proposition that is always true is a tautology. Therefore, (PQ)(PQ)(P \land Q) \rightarrow (P \lor Q) is a tautology.
    Answer: (PQ)(PQ) is a tautology.\boxed{(P \land Q) \rightarrow (P \lor Q) \text{ is a tautology.}}"
    :::

    :::question type="MCQ" question="A 22-ary boolean function f(P,Q)f(P, Q) is defined such that f(P,Q)=Truef(P, Q) = \texttt{True} if and only if PP is True\texttt{True} and QQ is False\texttt{False}. Which of the following logical expressions represents this function?" options=["P¬QP \lor \neg Q","P¬QP \land \neg Q","¬PQ\neg P \lor Q","¬(PQ)\neg (P \land Q)"] answer="P¬QP \land \neg Q" hint="Construct the truth table based on the given definition and compare it to the truth tables of the options." solution="The function f(P,Q)f(P, Q) outputs True\texttt{True} if and only if PP is True\texttt{True} and QQ is False\texttt{False}. Let's construct its truth table:

    PQf(P,Q)TTFTFTFTFFFF\begin{array}{|c|c|c|} \hline P & Q & f(P, Q) \\ \hline T & T & F \\ T & F & T \\ F & T & F \\ F & F & F \\ \hline\end{array}

    Now, let's evaluate each option:

  • P¬QP \lor \neg Q

  • PQ¬QP¬QTTFTTFTTFTFFFFTT\begin{array}{|c|c|c|c|}
    \hline
    P & Q & \neg Q & P \lor \neg Q \\
    \hline
    T & T & F & T \\
    T & F & T & T \\
    F & T & F & F \\
    F & F & T & T \\
    \hline\end{array}

    This does not match f(P,Q)f(P, Q).

  • P¬QP \land \neg Q

  • PQ¬QP¬QTTFFTFTTFTFFFFTF\begin{array}{|c|c|c|c|}
    \hline
    P & Q & \neg Q & P \land \neg Q \\
    \hline
    T & T & F & F \\
    T & F & T & T \\
    F & T & F & F \\
    F & F & T & F \\
    \hline\end{array}

    This matches f(P,Q)f(P, Q) exactly.

  • ¬PQ\neg P \lor Q

  • PQ¬P¬PQTTFTTFFFFTTTFFTT\begin{array}{|c|c|c|c|}
    \hline
    P & Q & \neg P & \neg P \lor Q \\
    \hline
    T & T & F & T \\
    T & F & F & F \\
    F & T & T & T \\
    F & F & T & T \\
    \hline\end{array}

    This does not match f(P,Q)f(P, Q).

  • ¬(PQ)\neg (P \land Q) (This is NAND)

  • PQPQ¬(PQ)TTTFTFFTFTFTFFFT\begin{array}{|c|c|c|c|}
    \hline
    P & Q & P \land Q & \neg (P \land Q) \\
    \hline
    T & T & T & F \\
    T & F & F & T \\
    F & T & F & T \\
    F & F & F & T \\
    \hline\end{array}

    This does not match f(P,Q)f(P, Q).

    The only expression that matches the defined function is P¬QP \land \neg Q.
    Answer: P¬Q\boxed{P \land \neg Q}"
    :::

    ---

    Summary

    Key Takeaways for CMI

    • Core Concepts: Understand Boolean values (True/False), propositions, and the definitions of all standard logical connectives (¬,,,,,\neg, \land, \lor, \rightarrow, \leftrightarrow, \oplus).

    • Truth Table Construction: Be proficient in systematically building truth tables for any compound proposition, correctly accounting for 2n2^n rows and the order of operations for connectives.

    • Classification: Distinguish between tautologies (always true), contradictions (always false), and contingencies (mixed truth values) based on the final column of a truth table.

    • Logical Equivalence: Use truth tables to prove or disprove logical equivalence between two propositions by comparing their final columns or by checking if their biconditional is a tautology.

    • Boolean Functions: Recognize that truth tables define boolean functions. Understand that for nn variables, there are 2n2^n input combinations and 22n2^{2^n} distinct boolean functions.

    • Problem-Solving: Apply truth tables for systematic case analysis in logical puzzles and for translating natural language statements into formal logic.

    ---

    What's Next?

    💡 Continue Learning

    This topic connects to:

      • Propositional Logic: Truth tables are the foundational tool for analyzing and simplifying propositional logic expressions. Mastery here is crucial for understanding logical inference and proofs.

      • Boolean Algebra: The concepts introduced in truth tables form the basis of Boolean algebra, which provides algebraic rules and identities for manipulating logical expressions, essential for circuit design and optimization.

      • Predicate Logic: While truth tables deal with propositions, predicate logic extends this by introducing predicates, quantifiers, and variables, allowing for more complex statements about objects and their properties.

      • Set Theory: There's a strong analogy between logical connectives and set operations (e.g., \land with intersection, \lor with union, ¬\neg with complement), which helps in understanding both domains.


    Master these connections for comprehensive CMI preparation!

    ---

    ---

    Chapter Summary

    📖 Boolean Logic - Key Takeaways

    • Propositions: A proposition is a declarative sentence that is definitively either true or false, but not both. It serves as the fundamental unit of logical reasoning.

    • Logical Operators: Master the definitions and truth conditions for the five primary logical operators: negation (¬\neg), conjunction (\land), disjunction (\lor), implication (\to), and biconditional (\leftrightarrow). Each operator combines propositions to form more complex compound propositions.

    • Truth Tables: This is an indispensable tool for systematically determining the truth value of any compound proposition for all possible truth assignments of its constituent simple propositions. Truth tables rigorously define the behavior of logical operators.

    • Logical Equivalence: Two propositions are logically equivalent, denoted PQP \equiv Q, if they possess identical truth values in every possible scenario. This can be rigorously established by comparing their truth tables. Crucial equivalences include De Morgan's Laws and the fundamental equivalence PQ¬PQP \to Q \equiv \neg P \lor Q.

    • Tautology, Contradiction, Contingency: A proposition is classified as a tautology if it is always true, a contradiction if it is always false, and a contingency if its truth value varies depending on the truth values of its simple propositions. Identifying these categories is vital for logical analysis.

    • Understanding Implication: The implication PQP \to Q ("If PP, then QQ") is only false in one specific case: when the premise PP is true and the conclusion QQ is false. In all other scenarios, including when PP is false, the implication is considered true.

    ---

    Chapter Review Questions

    :::question type="MCQ" question="Which of the following propositions is logically equivalent to ¬(P(¬QR))\neg(P \to (\neg Q \land R))?" options=["P(Q¬R)P \land (Q \lor \neg R)","P(¬QR)P \land (\neg Q \land R)","¬P(Q¬R)\neg P \lor (Q \land \neg R)","¬P(¬QR)\neg P \lor (\neg Q \land R)"] answer="A" hint="Recall the equivalence ¬(AB)A¬B\neg(A \to B) \equiv A \land \neg B and De Morgan's Laws for negating conjunctions." solution="We want to find a proposition logically equivalent to ¬(P(¬QR))\neg(P \to (\neg Q \land R)).

    First, recall the logical equivalence for the negation of an implication:

    ¬(AB)A¬B\neg(A \to B) \equiv A \land \neg B

    Let A=PA = P and B=(¬QR)B = (\neg Q \land R). Applying this equivalence, we get:
    ¬(P(¬QR))P¬(¬QR)\neg(P \to (\neg Q \land R)) \equiv P \land \neg(\neg Q \land R)

    Next, apply De Morgan's Law to negate the conjunction ¬(¬QR)\neg(\neg Q \land R):
    ¬(¬QR)¬(¬Q)¬R\neg(\neg Q \land R) \equiv \neg(\neg Q) \lor \neg R

    Q¬R\equiv Q \lor \neg R

    Substitute this result back into our expression:
    P(Q¬R)P \land (Q \lor \neg R)

    Therefore, the correct option is A.

    The final answer is A\boxed{A}"
    :::

    :::question type="NAT" question="Consider the compound proposition (P¬Q)(¬PR)(P \lor \neg Q) \land (\neg P \lor R). How many rows in its truth table result in a 'True' value?" answer="5" hint="Construct a full truth table for the proposition involving P,Q,RP, Q, R. There are 23=82^3 = 8 possible truth assignments. Evaluate the compound proposition for each row and count the number of 'True' outcomes." solution="To determine the number of 'True' rows, we construct a truth table for (P¬Q)(¬PR)(P \lor \neg Q) \land (\neg P \lor R). Since there are 3 distinct propositional variables (P,Q,RP, Q, R), the truth table will have 23=82^3 = 8 rows.

    | PP | QQ | RR | ¬Q\neg Q | P¬QP \lor \neg Q | ¬P\neg P | ¬PR\neg P \lor R | (P¬Q)(¬PR)(P \lor \neg Q) \land (\neg P \lor R) |
    |:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
    | T | T | T | F | T | F | T | T |
    | T | T | F | F | T | F | F | F |
    | T | F | T | T | T | F | T | T |
    | T | F | F | T | T | F | F | F |
    | F | T | T | F | F | T | T | F |
    | F | T | F | F | F | T | T | F |
    | F | F | T | T | T | T | T | T |
    | F | F | F | T | T | T | T | T |

    By counting the rows where the final expression (P¬Q)(¬PR)(P \lor \neg Q) \land (\neg P \lor R) evaluates to 'True' (highlighted in the last column), we find there are 5 such rows.

    The final answer is 5\boxed{5}"
    :::

    :::question type="MCQ" question="Which of the following propositions is a tautology?" options=["(PQ)¬P(P \land Q) \land \neg P","(PQ)(¬P¬Q)(P \lor Q) \leftrightarrow (\neg P \land \neg Q)","(P(PQ))Q(P \land (P \to Q)) \to Q","(PQ)(¬P¬Q)(P \lor Q) \land (\neg P \lor \neg Q)"] answer="C" hint="A tautology is a proposition that is always true, regardless of the truth values of its constituent simple propositions. You can use truth tables or apply logical equivalences to simplify and test each option." solution="Let's analyze each option using logical equivalences:

    A. (PQ)¬P(P \land Q) \land \neg P
    Using the commutative and associative laws for conjunction, and the contradiction law (P¬PFP \land \neg P \equiv F):

    (PQ)¬P(P¬P)QFQF(P \land Q) \land \neg P \equiv (P \land \neg P) \land Q \equiv F \land Q \equiv F

    This proposition is a contradiction, as it is always false.

    B. (PQ)(¬P¬Q)(P \lor Q) \leftrightarrow (\neg P \land \neg Q)
    Recall De Morgan's Law: ¬P¬Q¬(PQ)\neg P \land \neg Q \equiv \neg(P \lor Q).
    Substituting this into the proposition:

    (PQ)¬(PQ)(P \lor Q) \leftrightarrow \neg(P \lor Q)

    Let X=PQX = P \lor Q. Then the proposition becomes X¬XX \leftrightarrow \neg X.
    A biconditional ABA \leftrightarrow B is true if and only if AA and BB have the same truth value. Since XX and ¬X\neg X always have opposite truth values, X¬XX \leftrightarrow \neg X is always false.
    This proposition is a contradiction.

    C. (P(PQ))Q(P \land (P \to Q)) \to Q
    This is a classic logical argument form known as Modus Ponens, which is a tautology. Let's prove it using logical equivalences:
    Recall the equivalence for implication: PQ¬PQP \to Q \equiv \neg P \lor Q.
    Substitute this into the proposition:

    (P(¬PQ))Q(P \land (\neg P \lor Q)) \to Q

    Apply the distributive law A(BC)(AB)(AC)A \land (B \lor C) \equiv (A \land B) \lor (A \land C):
    ((P¬P)(PQ))Q((P \land \neg P) \lor (P \land Q)) \to Q

    Since P¬PFP \land \neg P \equiv F:
    (F(PQ))Q(F \lor (P \land Q)) \to Q

    The identity law for disjunction states FXXF \lor X \equiv X:
    (PQ)Q(P \land Q) \to Q

    Now, apply the implication equivalence again:
    ¬(PQ)Q\neg(P \land Q) \lor Q

    By De Morgan's Law:
    (¬P¬Q)Q(\neg P \lor \neg Q) \lor Q

    By associativity and commutativity of disjunction:
    ¬P(¬QQ)\neg P \lor (\neg Q \lor Q)

    Since ¬QQT\neg Q \lor Q \equiv T:
    ¬PT\neg P \lor T

    The domination law for disjunction states XTTX \lor T \equiv T:
    TT

    This proposition is a tautology, as it is always true.

    D. (PQ)(¬P¬Q)(P \lor Q) \land (\neg P \lor \neg Q)
    This proposition is equivalent to the exclusive OR operation, PQP \oplus Q.
    Let's test with a truth assignment:
    If P=T,Q=TP=T, Q=T: (TT)(¬T¬T)=T(FF)=TF=F(T \lor T) \land (\neg T \lor \neg T) = T \land (F \lor F) = T \land F = F.
    Since it's false for at least one assignment, it is not a tautology.
    This proposition is a contingency.

    Therefore, option C is the only tautology.

    The final answer is C\boxed{C}"
    :::

    :::question type="Proof" question="Prove the logical equivalence (PQ)RP(QR)(P \land Q) \to R \equiv P \to (Q \to R) using a truth table." solution="To prove the logical equivalence (PQ)RP(QR)(P \land Q) \to R \equiv P \to (Q \to R) using a truth table, we must demonstrate that the columns representing the truth values of both compound propositions are identical for all possible truth assignments of P,Q,RP, Q, R. With 3 distinct propositional variables, the truth table will have 23=82^3 = 8 rows.

    We will construct the truth table step-by-step:

    | PP | QQ | RR | PQP \land Q | (PQ)R(P \land Q) \to R | QRQ \to R | P(QR)P \to (Q \to R) |
    |:---:|:---:|:---:|:---:|:---:|:---:|:---:|
    | T | T | T | T | T | T | T |
    | T | T | F | T | F | F | F |
    | T | F | T | F | T | T | T |
    | T | F | F | F | T | T | T |
    | F | T | T | F | T | T | T |
    | F | T | F | F | T | F | T |
    | F | F | T | F | T | T | T |
    | F | F | F | F | T | T | T |

    Upon comparing the column for (PQ)R(P \land Q) \to R (column 5) with the column for P(QR)P \to (Q \to R) (column 7), we observe that their truth values are identical for every single row.

    Therefore, the propositions (PQ)R(P \land Q) \to R and P(QR)P \to (Q \to R) are logically equivalent. This specific equivalence is often referred to as the Exportation Law."
    :::

    ---

    What's Next?

    💡 Continue Your CMI Journey

    You've mastered the fundamentals of Boolean Logic! This chapter is a cornerstone in Discrete Mathematics, providing the essential language and tools for rigorous logical reasoning crucial for various advanced topics in CMI preparation and Computer Science.

    Key connections and next steps:
    Foundation for Formal Reasoning: The concepts of propositions, logical operators, and logical equivalence are fundamental to constructing, analyzing, and validating mathematical arguments and proofs. This chapter lays the groundwork for any formal reasoning you'll encounter.
    Predicate Logic: Boolean Logic forms the direct basis for Predicate Logic, which extends these ideas to statements involving variables, predicates, and quantifiers (\forall - "for all", \exists - "there exists"). Predicate Logic allows for much more expressive and complex logical statements.
    Set Theory: There's a profound analogy between Boolean operators and set operations (e.g., conjunction \land corresponds to set intersection \cap, disjunction \lor to set union \cup, and negation ¬\neg to set complement \complement). Understanding one concept deeply aids in grasping the other.
    Proof Techniques: The principles of logical equivalence, tautologies, and contradictions are directly applied in various formal proof methods, such as direct proof, proof by contradiction, and proof by contrapositive, which are central to CMI.
    * Digital Logic and Computer Architecture: Boolean Algebra is the mathematical foundation for digital circuits. A solid understanding of logical operators is directly applicable to designing and analyzing logic gates (AND, OR, NOT, XOR, etc.), which are the fundamental building blocks of all modern computers.

    🎯 Key Points to Remember

    • Master the core concepts in Boolean Logic before moving to advanced topics
    • Practice with previous year questions to understand exam patterns
    • Review short notes regularly for quick revision before exams

    Related Topics in Discrete Mathematics

    More Resources

    Why Choose MastersUp?

    🎯

    AI-Powered Plans

    Personalized study schedules based on your exam date and learning pace

    📚

    15,000+ Questions

    Verified questions with detailed solutions from past papers

    📊

    Smart Analytics

    Track your progress with subject-wise performance insights

    🔖

    Bookmark & Revise

    Save important questions for quick revision before exams

    Start Your Free Preparation →

    No credit card required • Free forever for basic features