Logic
Logic is the branch of mathematics that explores valid reasoning. It underpins all mathematical arguments and ensures correctness through structured inference.
Propositions
A proposition is a declarative sentence that is either true or false but not both.
- "2 is even" → True
- "The moon is made of cheese" → False
Logical Connectives
- ¬P → Not P
- P ∧ Q → P and Q
- P ∨ Q → P or Q
- P → Q → If P, then Q
- P ↔ Q → P if and only if Q
Truth Tables
Example: Truth table for P ∧ Q
| P | Q | P ∧ Q |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | F |
Important Logical Laws
- De Morgan’s: ¬(P ∧ Q) ≡ ¬P ∨ ¬Q
- Double Negation: ¬(¬P) ≡ P
- Commutative: P ∧ Q ≡ Q ∧ P
- Distributive: P ∧ (Q ∨ R) ≡ (P ∧ Q) ∨ (P ∧ R)
Step-by-Step Examples
- Statement: "It is raining and cold."
- Let P = "It is raining", Q = "It is cold"
- Negation: ¬(P ∧ Q) = ¬P ∨ ¬Q
- So the negation is: "It is not raining or it is not cold."
Practice Problems
1. What is the converse of: "If today is Monday, then I have math class."
Converse: "If I have math class, then today is Monday."
2. Construct the truth table for P → Q
| P | Q | P → Q |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | T |
| F | F | T |
3. Negate: "All dogs bark."
Negation: "There exists at least one dog that does not bark."