Tabla de contenido
In this guide, you’ll learn everything about logical connectives, also known as logical operators. These operators are widely used in mathematics, programming, and everyday reasoning, and we’ll study each one in detail.
What is a Logical Connective?
A logical connective is a symbol or operator that allows you to combine propositions to form new compound propositions. The truth value of the resulting proposition depends on:
- The truth values of the original propositions
- The type of connective used
Logical connectives are essential in:
- Propositional logic – For constructing valid arguments
- Programming – In conditional structures (if, while, etc.)
- Mathematics – For proving theorems and developing theories
- Digital circuits – For designing logic gates
The 6 Main Logical Connectives
| Connective | Name | Symbol | Example |
|---|---|---|---|
| Negation | NOT | ¬, ~, ′ | ¬p |
| Conjunction | AND | ∧, · | p ∧ q |
| Disjunction | OR | ∨ | p ∨ q |
| Conditional | IF-THEN | →, ⊃ | p → q |
| Biconditional | IF AND ONLY IF | ↔, ≡ | p ↔ q |
| Exclusive Disjunction | XOR | ⊻, ⊕ | p ⊻ q |
1. Negation (¬)
Negation is the simplest connective. It’s a unary operator, meaning it acts on a single proposition.
Definition
Negation reverses the truth value of a proposition:
- If p is true, then ¬p is false
- If p is false, then ¬p is true
Negation Symbols
| Symbol | Common Use |
|---|---|
| ¬p | Mathematical logic |
| ~p | Logic and some programming languages |
| p′ | Boolean algebra |
| !p | Programming (C, Java, JavaScript) |
| NOT p | Natural language, SQL |
Ways to Express Negation
- “Not p”
- “It is not the case that p”
- “It is false that p”
- “p is not true”
Truth Table for Negation
| p | ¬p |
|---|---|
| T | F |
| F | T |
Examples
| Proposition p | Negation ¬p |
|---|---|
| “Today is Monday” | “Today is NOT Monday” |
| “Water boils at 100°C” | “Water does NOT boil at 100°C” |
| “5 is greater than 3” | “5 is NOT greater than 3” |
Property: Double Negation
The negation of a negation returns the original value:
\(\neg(\neg p) \equiv p\)
Example: “It is not false that 2+2=4” is equivalent to “2+2=4”
2. Conjunction (∧)
Conjunction connects two propositions and is true only when both are true.
Definition
The compound proposition p ∧ q is true only if:
- p is true AND
- q is true
In any other case, the conjunction is false.
Conjunction Symbols
| Symbol | Common Use |
|---|---|
| p ∧ q | Mathematical logic |
| p · q | Boolean algebra |
| p & q | Some texts |
| p && q | Programming (C, Java, JavaScript) |
| p AND q | SQL, natural language |
Ways to Express Conjunction in English
Conjunction isn’t only expressed with “and.” It also includes:
| Word/Phrase | Example |
|---|---|
| and | “It’s raining and it’s cold” |
| but | “It’s expensive but it’s good” |
| moreover | “She studies, moreover she works” |
| however | “He’s young, however he’s responsible” |
| although | “Although he’s tired, he keeps working” |
| while | “She studies while listening to music” |
| despite | “Despite the difficulty, he tries” |
Note: In logic, all these expressions are formalized the same way: p ∧ q
Truth Table for Conjunction
| p | q | p ∧ q |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | F |
Conjunction is true only in the first row.
Examples
Example 1: “The number 4 is even and is greater than 2″
- p: “4 is even” → T
- q: “4 is greater than 2” → T
- p ∧ q → T
Example 2: “Today is Monday and it’s raining”
- If today is Monday but it’s not raining: p ∧ q → F
- If today isn’t Monday even though it’s raining: p ∧ q → F
- Only true if both conditions are met
3. Inclusive Disjunction (∨)
Disjunction (also called “logical OR”) connects two propositions and is true when at least one is true.
Definition
The compound proposition p ∨ q is true if:
- p is true, OR
- q is true, OR
- both are true
It’s only false when both are false.
Disjunction Symbols
| Symbol | Common Use |
|---|---|
| p ∨ q | Mathematical logic |
| p + q | Boolean algebra |
| p || q | Programming (C, Java, JavaScript) |
| p OR q | SQL, natural language |
Why Is It Called “Inclusive”?
It’s called inclusive because it includes the case where both propositions are true. In formal logic, “p or q” means “p, q, or both.”
This differs from everyday use of “or” in English. For example:
| Everyday Phrase | Common Interpretation | Logical Interpretation |
|---|---|---|
| “Do you want coffee or tea?” | Only one | One, the other, or both |
| “You can pay with cash or card” | Only one | One, the other, or both |
Note: It’s understood that you could pay part with cash and the rest with card if that’s the case, so logically it can be interpreted as “both.”
Truth Table for Disjunction
| p | q | p ∨ q |
|---|---|---|
| T | T | T |
| T | F | T |
| F | T | T |
| F | F | F |
Disjunction is false only in the last row.
Examples
Example 1: “To get the job, you must know English or French”
- If you know only English → T
- If you know only French → T
- If you know both → T
- If you know neither → F
Example 2: “The number x is less than 5 or greater than 10″
- If x = 3 → T (satisfies the first)
- If x = 15 → T (satisfies the second)
- If x = 7 → F (satisfies neither)
4. The Conditional (→)
The conditional (also called material implication) expresses an “if… then…” relationship between two propositions.
Definition
In the proposition p → q:
- p is the antecedent (hypothesis, condition)
- q is the consequent (conclusion, result)
The proposition p → q is false only when:
- The antecedent (p) is true AND
- The consequent (q) is false
In all other cases, it is true.
Conditional Symbols
| Symbol | Common Use |
|---|---|
| p → q | Mathematical logic |
| p ⊃ q | Classical logic |
| p ⇒ q | Some texts |
| if p then q | Programming, natural language |
Ways to Express the Conditional in English
| Word/Phrase | Example |
|---|---|
| If… then | “If it rains, then I get wet” |
| Whenever | “Whenever you study, you pass” |
| When | “When it’s cold, I wear a coat” |
| Only if | “I’ll go out only if I finish work” |
| Implies | “Being a mammal implies being a vertebrate” |
| Sufficient for | “Studying is sufficient for passing” |
| Necessary for | “Passing is necessary for graduating” |
Truth Table for the Conditional
| p | q | p → q |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | T |
| F | F | T |
The conditional is false only in the second row.
Examples
Example 1: “If you study, then you will pass”
- p: “You study”
- q: “You will pass”
- Only false if you study and don’t pass
Example 2: “If 12 is divisible by 4, then 12 is divisible by 2”
- p: “12 is divisible by 4” → T
- q: “12 is divisible by 2” → T
- p → q → T (the implication is true)
Propositions Derived from the Conditional
From a conditional p → q, four related propositions can be formed:
| Name | Form | Description |
|---|---|---|
| Direct (Original) | p → q | The original proposition |
| Converse | q → p | Antecedent and consequent are swapped |
| Inverse | ¬p → ¬q | Both parts are negated |
| Contrapositive | ¬q → ¬p | Both are negated and swapped |
Example
Given the proposition: “If it rains, then the street gets wet” (p → q)
| Type | Proposition |
|---|---|
| Direct | If it rains, then the street gets wet |
| Converse | If the street gets wet, then it rains |
| Inverse | If it doesn’t rain, then the street doesn’t get wet |
| Contrapositive | If the street isn’t wet, then it didn’t rain |
Important Relationships
- The direct and contrapositive always have the same truth value
- The converse and inverse always have the same truth value
Note: The converse of a true proposition is NOT always true. For example, “If it rains, the street gets wet” is true, but “If the street is wet, it rained” may be false (the street could be wet for another reason).
For further reading: The equivalences between these propositions will be studied in detail in the chapter on Laws of Equivalence and Implication.
The Paradoxes of Material Implication
The truth table of the conditional produces results that seem counterintuitive. These are known as the paradoxes of material implication.
Paradox 1: “From falsehood, anything follows”
When the antecedent is false, the implication is true regardless of the consequent. This phenomenon is called vacuous truth.
| Example | Is it true? |
|---|---|
| “If 2+2=5, then the Moon is made of cheese” | True |
| “If the Earth is flat, then I’m a millionaire” | True |
| “If pigs fly, then 1=0” | True |
Why? Because the antecedent is false, the condition is never “triggered,” so there’s no way for the implication to fail.
Paradox 2: “Truth is implied by anything”
When the consequent is true, the implication is true regardless of the antecedent.
| Example | Is it true? |
|---|---|
| “If the Moon is made of cheese, then 2+2=4” | True |
| “If I’m the president, then water is H₂O” | True |
Why Do These Paradoxes Occur?
Material conditional in classical logic:
- Does not require a causal connection between p and q
- Does not require thematic relevance between p and q
- Only defines when it’s impossible for p→q to be false
Historical note: Philosopher C.I. Lewis systematically identified these paradoxes in 1918. As an alternative, he proposed relevant logic, which does require a connection between antecedent and consequent.
5. The Biconditional (↔)
The biconditional (also called double implication or equivalence) expresses that two propositions have the same truth value.
Definition
The proposition p ↔ q is true when:
- Both are true, OR
- Both are false
It’s false when they have different truth values.
Biconditional Symbols
| Symbol | Common Use |
|---|---|
| p ↔ q | Mathematical logic |
| p ⇔ q | Some texts |
| p ≡ q | Logical equivalence |
| p iff q | “if and only if” |
Ways to Express the Biconditional in English
| Word/Phrase | Example |
|---|---|
| If and only if | “You pass if and only if you get 60% or more” |
| When and only when | “It’s an equilateral triangle when and only when it has 3 equal sides” |
| Is equivalent to | “Being even is equivalent to being divisible by 2″ |
| Is necessary and sufficient | “Being 18 years old is necessary and sufficient to vote” |
Truth Table for the Biconditional
| p | q | p ↔ q |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | T |
The biconditional is true when p and q have the same value.
Fundamental Equivalence
The biconditional is equivalent to the conjunction of two conditionals (specifically the direct and the converse):
\(p \leftrightarrow q \equiv (p \rightarrow q) \land (q \rightarrow p)\)
This means: “if p then q” AND “if q then p”
Examples
Example 1: “A triangle is equilateral if and only if its three sides are equal”
- If it’s equilateral → it has 3 equal sides ✓
- If it has 3 equal sides → it’s equilateral ✓
- Biconditional is true
Example 2: “You pass the course if and only if you get 60% or more”
- If you pass → you have 60%+ ✓
- If you have 60%+ → you pass ✓
- Biconditional is true
Example 3: “A number is even if and only if it is divisible by 2″
- The definition of an even number is always divisible by 2, so this is always true.
6. Exclusive Disjunction (⊻)
Exclusive disjunction (also called XOR) is true when exactly one of the propositions is true, but not both.
Definition
The proposition p ⊻ q is true if:
- p is true and q is false, OR
- p is false and q is true
It’s false when both have the same truth value.
Exclusive Disjunction Symbols
| Symbol | Common Use |
|---|---|
| p ⊻ q | Mathematical logic |
| p ⊕ q | Boolean algebra, circuits |
| p XOR q | Programming, technical language |
| p ^ q | Some languages (C, Python for bitwise) |
Ways to Express Exclusive Disjunction in English
| Word/Phrase | Example |
|---|---|
| Either… or (but not both) | “Either you’re a man or you’re a woman” |
| One or the other, not both | “The number is even or odd, not both“ |
| Exclusively | “You can choose exclusively soup or salad” |
Relationship with the Biconditional
Exclusive disjunction is the negation of the biconditional:
\(p \veebar q \equiv \neg(p \leftrightarrow q)\)
Compare the truth tables:
| p | q | p ↔ q | p ⊻ q |
|---|---|---|---|
| T | T | T | F |
| T | F | F | T |
| F | T | F | T |
| F | F | T | F |
The values are exactly opposite!
Examples in Everyday Language
In everyday language, many uses of “or” are actually exclusive:
| Phrase | Interpretation |
|---|---|
| “Are you a man or a woman?” | Only one |
| “You either pass the exam or fail” | Only one |
| “The number is even or odd” | Only one |
| “You can choose soup or salad” (on a menu) | Only one |
Applications in Digital Circuits
The XOR gate has multiple applications in digital electronics:
| Application | Description |
|---|---|
| Binary adders | XOR simulates adding 2 bits without carry |
| Comparators | If XOR = 0, the bits are equal |
| Parity detection | Verifies errors in data transmission |
| Encryption | Fundamental operation in cryptography |
| Pseudorandom numbers | Generates sequences that simulate randomness |
Historical fact: The Apollo 11 guidance computer (1969) was built entirely with NOR gates, demonstrating that a single type of gate can implement any logical function.
Operator Hierarchy (Order of Precedence)
When a logical expression has multiple connectives, which one is evaluated first? The operator hierarchy establishes the order of evaluation.
Precedence Table
| Priority | Operator | Symbol | Evaluated |
|---|---|---|---|
| 1 (highest) | Parentheses | ( ) | First |
| 2 | Negation | ¬ | Second |
| 3 | Conjunction | ∧ | Third |
| 4 | Disjunction | ∨ | Fourth |
| 5 | Conditional | → | Fifth |
| 6 (lowest) | Biconditional | ↔ | Last |
Application Examples
Example 1: ¬p ∧ q
- First, evaluate ¬p
- Then, evaluate (result) ∧ q
Example 2: p ∨ q ∧ r
- First, evaluate q ∧ r (∧ has higher precedence than ∨)
- Then, evaluate p ∨ (result)
- Equivalent to: p ∨ (q ∧ r)
Example 3: p → q ∨ r
- First, evaluate q ∨ r
- Then, evaluate p → (result)
- Equivalent to: p → (q ∨ r)
Using Parentheses
Parentheses always have the highest priority and can change the order of evaluation:
| Expression | Evaluation |
|---|---|
| p ∨ q ∧ r | p ∨ (q ∧ r) |
| (p ∨ q) ∧ r | Different result |
Tip: When in doubt, use parentheses to make the order of evaluation explicit.
Tautology, Contradiction, and Contingency
When evaluating compound propositions with truth tables, we can classify them into three types based on their results.
Tautology
A tautology is a compound proposition that is always true, regardless of the truth values of its components.
Classic example: p ∨ ¬p (Law of Excluded Middle)
| p | ¬p | p ∨ ¬p |
|---|---|---|
| T | F | T |
| F | T | T |
Always true → Tautology
Other examples of tautologies:
- p → p (Identity)
- p ∨ ¬p (Excluded Middle)
- ¬(p ∧ ¬p) (Non-contradiction)
- (p ∧ q) → p (Simplification)
Contradiction
A contradiction is a compound proposition that is always false, regardless of the truth values of its components.
Classic example: p ∧ ¬p
| p | ¬p | p ∧ ¬p |
|---|---|---|
| T | F | F |
| F | T | F |
Always false → Contradiction
Other examples of contradictions:
- p ∧ ¬p
- ¬(p ∨ ¬p)
- (p ↔ ¬p)
Contingency
A contingency is a compound proposition that can be true or false depending on the values of its components.
Example: p → q
| p | q | p → q |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | T |
| F | F | T |
Has mixed values → Contingency
Most compound propositions are contingencies.
Summary
| Type | Definition | Example |
|---|---|---|
| Tautology | Always T | p ∨ ¬p |
| Contradiction | Always F | p ∧ ¬p |
| Contingency | Sometimes T, sometimes F | p → q |
Practice Exercises
Exercise 1: Formalization
Translate the following sentences into symbolic language using:
- p: “It’s raining”
- q: “It’s cold”
- r: “I’m carrying an umbrella”
- It’s raining and it’s cold
- If it rains, then I carry an umbrella
- It’s raining or it’s cold, but not both
- I carry an umbrella if and only if it’s raining
- It’s not raining and it’s not cold
Exercise 2: Truth Tables
Construct the truth table for the following propositions and indicate whether each is a tautology, contradiction, or contingency:
- (p ∧ q) → p
- p → (p ∨ q)
- (p → q) ∧ (q → p) ↔ (p ↔ q)
- ¬(p ∨ q) ↔ (¬p ∧ ¬q)
Exercise 3: Identifying Connectives
Identify the main connective in each sentence:
- “If you study and practice, then you will pass”
- “The number is prime or composite, but not both”
- “It is not true that all cats are black”
- “You will pass if and only if you submit the project”
Answers
Answers to Exercise 1
- p ∧ q
- p → r
- p ⊻ q (or also: (p ∨ q) ∧ ¬(p ∧ q))
- r ↔ p
- ¬p ∧ ¬q
Answers to Exercise 2
1. (p ∧ q) → p
| p | q | p∧q | (p∧q)→p |
|---|---|---|---|
| T | T | T | T |
| T | F | F | T |
| F | T | F | T |
| F | F | F | T |
→ Tautology (always true)
2. p → (p ∨ q)
| p | q | p∨q | p→(p∨q) |
|---|---|---|---|
| T | T | T | T |
| T | F | T | T |
| F | T | T | T |
| F | F | F | T |
→ Tautology
3. (p → q) ∧ (q → p) ↔ (p ↔ q)
I’ll leave this as an exercise, but I’ll clarify that it’s a tautology that demonstrates the definition of the biconditional.
4. ¬(p ∨ q) ↔ (¬p ∧ ¬q)
This is one of De Morgan’s Laws that we’ll see later, and it’s a tautology. I’ll also leave this one as homework.
Answers to Exercise 3
- Conditional (→) – “If… then…”
- Exclusive disjunction (⊻) – “or… but not both”
- Negation (¬) – “It is not true that…”
- Biconditional (↔) – “if and only if”
Additional Content
How Many Rows Does a Truth Table Have?
The number of rows in a truth table is calculated with the formula:
\[ \# \text{Rows} = 2^n\]
Where n is the number of different propositions (variables).
| Propositions | Rows |
|---|---|
| 1 (p) | 2¹ = 2 |
| 2 (p, q) | 2² = 4 |
| 3 (p, q, r) | 2³ = 8 |
| 4 (p, q, r, s) | 2⁴ = 16 |
| 5 (p, q, r, s, t) | 2⁵ = 32 |
In upcoming chapters, we’ll explore:
- Truth Tables: How to build them step by step
- Laws of Equivalence and Implication: Contraposition, De Morgan, and more
- Valid Arguments: How to use logic to prove arguments.
Did you find this post useful? Leave me a comment with your questions or suggestions! And don’t forget to check out the next installment of this series on mathematical logic.

