Basic operations: AND, OR, NOT

LVL: FREE

MODULE: Logic, Dimensions, and Modeling

[EXEC: MICRO_CORE]

✖️ 1. Definition of logical propositions and statements

📝 What Are Logical Propositions

  • A proposition is a statement that is either true or false, never both.
  • Questions, commands, and opinions are NOT propositions.
  • We use letters like PP, QQ, RR to represent propositions.
  • Every proposition has exactly one truth value: T (true) or F (false).
  • Propositions can be combined using logical operations.

Example: "5 is greater than 3" is a proposition (true). "Is it raining?" is NOT a proposition.

💡 Think: A proposition is like a light switch—it's either ON (true) or OFF (false), nothing in between.

[EXEC: DEEP_COMPUTE]

1. Definition of logical propositions and statements

Logical Propositions and Statements

A proposition is a declarative sentence that is either true or false, but not both. Propositions form the foundation of logical reasoning and can be assigned a truth value: true (T) or false (F).

Intuition: Think of propositions as claims about reality that can be verified. "The sky is blue" is a proposition; "Is it raining?" is not, because questions have no truth value.

Core Rules:

  • A proposition must be declarative (not a question, command, or exclamation)
  • Every proposition has exactly one truth value at any given time
  • Propositions can be simple (atomic) or compound (built from simpler propositions)
  • Variables like pp, qq, rr represent propositions in symbolic logic

Consequence: Propositions allow us to formalize reasoning and build complex logical structures from simple true/false statements.

Example: "7 is an odd number" is a proposition (true). "x>5x > 5" becomes a proposition only when xx is specified (e.g., if x=8x = 8, it is true).

TASK_1[0 / 3]
LVL_2
STRC: CLASSIFY

Based on the definition of a proposition, which of the following sentences is a proposition?

DEEP_COMPUTE
ULTRA
[EXEC: MICRO_CORE]

✖️ 2. The NOT operation (negation) and its effect on truth value

🔄 The NOT Operation

  • NOT flips the truth value of a proposition.
  • Symbol: ¬P\neg P or P\sim P (read as "not P").
  • If PP is true, then ¬P\neg P is false.
  • If PP is false, then ¬P\neg P is true.
  • NOT always produces the opposite truth value.

Example: If PP = "It is raining" (true), then ¬P\neg P = "It is NOT raining" (false).

💡 Memory hook: NOT is the truth value mirror—it reflects everything to the opposite side.

[EXEC: DEEP_COMPUTE]

2. The NOT operation (negation) and its effect on truth value

The NOT Operation (Negation)

The negation of a proposition pp, denoted ¬p\neg p or NOT pp, reverses its truth value. If pp is true, then ¬p\neg p is false; if pp is false, then ¬p\neg p is true.

Intuition: Negation creates the logical opposite. If "It is raining" is true, then "It is not raining" is false.

Core Rules:

  • ¬p\neg p has the opposite truth value of pp
  • Negation is a unary operation (operates on a single proposition)
  • Double negation returns the original: ¬(¬p)=p\neg(\neg p) = p
  • In natural language, negation often uses "not," "no," or "it is false that"

Consequence: Negation is the simplest logical operation and essential for expressing contradictions and denials.

Example: Let pp = "5 is even" (false). Then ¬p\neg p = "5 is not even" (true). Similarly, ¬(¬p)=p\neg(\neg p) = p confirms double negation.

TASK_1[0 / 3]
LVL_2
STRC: CLASSIFY

Let pp be the proposition "The number 7 is even."

Which of the following represents the truth value of ¬p\neg p?

DEEP_COMPUTE
ULTRA
[EXEC: MICRO_CORE]

✖️ 3. The AND operation (conjunction) and the concept of logical intersection

🤝 The AND Operation

  • AND is true only when both propositions are true.
  • Symbol: PQP \land Q (read as "P and Q").
  • If either proposition is false, the whole AND is false.
  • Think of AND as a strict requirement—all conditions must be met.
  • AND represents logical intersection (overlap of truth).

Example: PP = "I have 10 dollars" (true), QQ = "I have a ticket" (false). Then PQP \land Q = false (I cannot enter without both).

💡 Visual cue: AND is like a chain—if one link breaks, the whole chain fails.

[EXEC: DEEP_COMPUTE]

3. The AND operation (conjunction) and the concept of logical intersection

The AND Operation (Conjunction)

The conjunction of propositions pp and qq, denoted pqp \land q or pp AND qq, is true only when both pp and qq are true. It represents logical intersection.

Intuition: Think of AND as requiring all conditions to be met simultaneously. "I have an umbrella AND it is raining" is true only if both facts hold.

Core Rules:

  • pqp \land q is true if and only if both pp is true and qq is true
  • If either pp or qq (or both) is false, then pqp \land q is false
  • Conjunction is commutative: pq=qpp \land q = q \land p
  • Conjunction is associative: (pq)r=p(qr)(p \land q) \land r = p \land (q \land r)

Consequence: AND creates stricter conditions, narrowing the set of cases where the compound statement is true.

Example: Let pp = "x>3x > 3" and qq = "x<10x < 10". Then pqp \land q is true when x=5x = 5 (both conditions hold), but false when x=2x = 2 or x=12x = 12.

TASK_1[0 / 3]
LVL_2
STRC: CLASSIFY

Let pp be the statement "x>4x > 4" and qq be the statement "x<9x < 9".

If x=10x = 10, what is the truth value of the conjunction pqp \land q?

DEEP_COMPUTE
ULTRA
[EXEC: MICRO_CORE]

✖️ 4. The OR operation (disjunction), distinguishing between inclusive and exclusive OR

🔀 The OR Operation

  • OR is true when at least one proposition is true.
  • Symbol: PQP \lor Q (read as "P or Q").
  • Inclusive OR (standard): true if one or both are true.
  • Exclusive OR (XOR): true only if exactly one is true, not both.
  • In math and logic, OR usually means inclusive unless stated otherwise.

Example: PP = "I study math" (true), QQ = "I study science" (true). Then PQP \lor Q = true (inclusive OR allows both).

💡 Think: Inclusive OR is like a safety net—you only need ONE to catch you, but having both is fine too.

[EXEC: DEEP_COMPUTE]

4. The OR operation (disjunction), distinguishing between inclusive and exclusive OR

The OR Operation (Disjunction)

The disjunction of propositions pp and qq, denoted pqp \lor q or pp OR qq, is true when at least one of pp or qq is true. By convention, OR is inclusive unless stated otherwise.

Intuition: Inclusive OR means "one or the other or both." Exclusive OR (XOR, denoted pqp \oplus q) means "one or the other but not both."

Core Rules:

  • Inclusive OR (pqp \lor q): true if pp is true, qq is true, or both are true
  • Exclusive OR (pqp \oplus q): true only if exactly one of pp or qq is true
  • Disjunction is commutative and associative
  • pqp \lor q is false only when both pp and qq are false

Consequence: Inclusive OR broadens conditions; XOR enforces mutual exclusivity.

Example: Let pp = "I study math" and qq = "I study physics." Then pqp \lor q (inclusive) is true if I study either or both. But pqp \oplus q (exclusive) is false if I study both subjects.

TASK_1[0 / 3]
LVL_2
STRC: CLASSIFY

Let proposition pp be "The sky is green" (False) and proposition qq be "Pigs can fly" (False). What is the truth value of the inclusive disjunction pqp \lor q?

DEEP_COMPUTE
ULTRA
[EXEC: MICRO_CORE]

✖️ 5. Basic logical equivalences (De Morgan's laws, double negation)

⚖️ Basic Logical Equivalences

  • Double negation: ¬(¬P)=P\neg(\neg P) = P (two NOTs cancel out).
  • De Morgan's Law 1: ¬(PQ)=(¬P)(¬Q)\neg(P \land Q) = (\neg P) \lor (\neg Q) (NOT of AND becomes OR of NOTs).
  • De Morgan's Law 2: ¬(PQ)=(¬P)(¬Q)\neg(P \lor Q) = (\neg P) \land (\neg Q) (NOT of OR becomes AND of NOTs).
  • These laws help simplify complex logical expressions.
  • De Morgan flips the operation (AND to OR or vice versa) and negates each part.

Example: NOT("I am tall AND smart") = "I am NOT tall OR I am NOT smart".

💡 Memory hook: De Morgan says: break the gate, flip the sign—AND becomes OR, and everything gets a NOT.

[EXEC: DEEP_COMPUTE]

5. Basic logical equivalences (De Morgan's laws, double negation)

Basic Logical Equivalences

Logical equivalences are identities showing when two compound propositions always have the same truth value. Key equivalences include De Morgan's laws and double negation.

Intuition: These laws allow us to transform logical expressions systematically, much like algebraic identities simplify equations.

Core Rules:

  • Double Negation: ¬(¬p)p\neg(\neg p) \equiv p
  • De Morgan's First Law: ¬(pq)(¬p)(¬q)\neg(p \land q) \equiv (\neg p) \lor (\neg q) (negation distributes over AND, changing it to OR)
  • De Morgan's Second Law: ¬(pq)(¬p)(¬q)\neg(p \lor q) \equiv (\neg p) \land (\neg q) (negation distributes over OR, changing it to AND)
  • These equivalences hold for all truth value assignments

Consequence: De Morgan's laws are essential for simplifying logical circuits, proofs, and database queries by converting between conjunctions and disjunctions.

Example: ¬(pq)\neg(p \land q) means "not both pp and qq," equivalent to "either not pp or not qq" (i.e., (¬p)(¬q)(\neg p) \lor (\neg q)). If pp = "it is sunny" and qq = "it is warm," then "it is not both sunny and warm" equals "it is not sunny or not warm."

TASK_1[0 / 3]
LVL_2
STRC: TRANSFORM

Which logical expression is logically equivalent to ¬(AB)\neg(A \land B)?

DEEP_COMPUTE
ULTRA
[EXEC: MICRO_CORE]

✖️ 6. Applications: Simple logic gates in computer science and boolean search queries

💻 Applications in Computing

  • Logic gates in computers use AND, OR, NOT to process binary signals (0 and 1).
  • NOT gate inverts the input, AND gate outputs 1 only if all inputs are 1.
  • OR gate outputs 1 if any input is 1.
  • Boolean search uses AND (narrow results), OR (broaden results), NOT (exclude terms).
  • Example search: "cats AND dogs" finds pages with both words.

Example: Search "python NOT snake" finds programming content, excludes reptile pages.

💡 Real-world: Every digital device uses millions of these tiny logic gates to make decisions at lightning speed.

[EXEC: DEEP_COMPUTE]

6. Applications: Simple logic gates in computer science and boolean search queries

Applications: Logic Gates and Boolean Search

Logical operations directly implement logic gates in digital circuits and structure boolean search queries in databases and search engines.

Intuition: Computer hardware uses AND, OR, and NOT gates to process binary signals (0 = false, 1 = true). Search engines use boolean operators to filter results.

Core Rules:

  • AND gate: outputs 1 only if all inputs are 1 (used for filtering conditions)
  • OR gate: outputs 1 if any input is 1 (used for broadening searches)
  • NOT gate: inverts the input (0 becomes 1, 1 becomes 0)
  • Boolean search: combining keywords with AND (narrow results), OR (expand results), NOT (exclude terms)

Consequence: Understanding logical operations is fundamental to computer architecture, programming, and effective information retrieval.

Example: Searching "python AND programming NOT snake" returns pages about Python programming language while excluding pages about the reptile. In circuits, an AND gate with inputs 1 and 0 outputs 0, blocking the signal.

TASK_1[0 / 3]
LVL_2
STRC: CLASSIFY

In a digital circuit, an AND gate receives two binary inputs. The first input is 11 and the second input is 00. What is the numerical output of this gate?

DEEP_COMPUTE
ULTRA

AWAITING_CONFIRMATION

CONFIRM KNOWLEDGE ACQUISITION TO UPDATE SYSTEM ANALYTICS.