2.
4 LANGUAGE OF LOGIC
Logic is technically defined as the science or study of how to evaluate arguments in reasoning. Logic helps us to
differentiate correct reasoning from poor reasoning. It is important in the sense that it helps us to reason correctly.
Others define logic as a discipline that deals with the methods of reasoning. And logical reasoning is used on
mathematics to prove theorems in computer science to verify the correctness of programs and to prove theorems. A
proposition (or a statement) is a declarative sentence that is either true or false, but not both. The truth value of the
propositions is the truth or falsity of the proposition.
A propositional variable is a variable that is used to represent a proposition. A formal propositional variable
written using propositional logic annotation elements p, q, and r are used to represent propositions. Logical connectives
are used to combine symbol propositions, which are referred to as compound propositions. A compound proposition
is a proposition composed of two or more simple propositions connected by logical connectives “and,” “or”, if then”,
“not,” “if and only if”, and “explosive-or.” A proposition which is not compound is said to be simple, also called
atomic.
There are three main logical connectives: conjunction, disjunction, and negation. The following are briefly
discussed in the section. Note that T refers to a true proposition, and F refers to a false proposition.
The conjunction of the propositions p and q is the compound proposition “p and q.” Symbolically, p ∧ q,
where ∧ is the symbol for “and”. If p is true or q is true, and if both p and q are true, then p ∧q is false; otherwise, p
∧q is false. Meaning, the conjunction of the two propositions is true only if each proposition is true.
The disjunction of the propositions p and q is the compound proposition “p or q.” Symbolically, p ∨ q, where
∨ is the symbol for “or”. If p is true or q is true or if both p and q are true, then p ∨q is true; otherwise, p ∨q is false.
Meaning, the conjunction of the two propositions is false only if each proposition is false.
The negation of the proposition p is denoted by ∼p, where ∼ is a symbol for “not”. If p is true, ∼p is false.
Meaning the truth table of the negation of the proposition is always the reverse of the truth value of the original
proposition.
The conditional (or implication) of the propositions p and q is the compound proposition “if p, then q”.
Symbolically p → q, where → is the symbol for “if then”. p is called the hypothesis (or antecedent or premise), and q
is called the conclusion (or consequent or consequence). The conditional proposition p →q is false only when p is true,
and q is false; otherwise, p →q is true. Meaning p → q states that a proposition cannot imply a false proposition. For
example, the proposition “If then vinegar is sweet, then sugar is sour”. The antecedent is “vinegar is sweet”, and the
consequent is sugar is sour.
The biconditional of the propositions p and q is the compound proposition “p if and only if q.” Symbolically
p ↔ q, where ↔ is a symbol for “if and only if”. If p and q are true or both false, then p ↔q is true; if p and q have
opposite truth values, then p ↔q is false.
The exclusive-or of the propositions p and q is the compound proposition “p exclusive-or q”. Symbolically,
p ⨁ q, where ⨁ is a symbol for “exclusive-or”. If p and q are true or both false, then p ⨁ q is false. If p and q have
opposite truth values, then p ⨁ q is true. It can be noted that the truth value of p ⨁ q is the negation of the truth value
of p ↔q.
1
LANGUAGE OF LOGIC (Simplified Version)
1. Definition
Logic is the study of reasoning. It helps us determine whether arguments are valid and whether statements are
true or false.
We use logic in:
• Mathematics (to prove theorems)
• Computer science (to check if programs work correctly)
• Everyday thinking (to make good decisions)
Logic deals with reasoning and arguments. It is the foundation of mathematical proofs and problem-solving.
2. Proposition (Statement)
A statement (or proposition) is a sentence that can be clearly classified as true (T) or false (F). — but not both.
Example 1:
a) 12 + 3 = 15. → True
b) 7 is an even number. → False
c) The sun rises in the east. → True
d) All squares are rectangles. → True
The truth or falsity of a proposition is called its truth value.
Not statements:
e) Close the door. (It is a command) - Not a proposition
f) What time is it?” (It is a question) - Not a proposition
These cannot be judged as true or false.
Example 2:
Statement Truth Value
2+3=5 True
10 is a prime number False
Manila is in the Philippines True
x+5=9 Not a statement (depends on x)
A sentence that depends on a variable is called an open sentence, not yet a proposition.
3. Propositional Variables
Instead of writing long sentences, we use letters like:
p, q, r - These letters stand for propositions.
4. Simple and Compound Propositions
A) Simple (Atomic) Proposition
A single statement. A propositional statement that's a single statement with no logical connectives
(like AND, OR, NOT) is called an atomic proposition.
Example:
It is raining.” is atomic.
B) Compound Proposition
Two or more statements connected using logical words (Logical connectors) like:
• and
• or
• not
• if… then
• if and only if
• exclusive-or
2
Example:
It's raining AND it's cold. is not atomic (it's compound).
MAIN LOGICAL CONNECTIVES
1. Logical Connector: Conjunction, AND (∧)
A compound statement using AND is true only if both statements are true.
Form: p ∧ q means “p and q”
It is true only when both p and q are true.
Example 1: 5 is odd and 10 is even = True
Let p = 5 is odd, q = 10 is even
Then: p ∧ q = T∧T = T
Example 2: 4 is even and 9 is even = False
Let p = 4 is even, q = 9 is even
Then:
p ∧ q = T ∧F = F
2. Disjunction, OR ( ∨ )
A compound statement using OR is true if at least one statement is true.
Form: p ∨ q means “p or q”
It is true if at least one is true.
Example 3: 6 is even or 6 is prime → True
Let: p = 6 is even, q = 6 is prime.
Then:
p∨q=T∨F=T
Example 4:
Let: p = 3 > 5 (F), q = 10 is even (T)
Then: p ∨ q = True
3. Negation, NOT ( ¬ ) or “not p”, (~p)
The NOT operator reverses the truth value of a statement.
Example 5: 8 is an odd number. → False
Negation: 8 is not an odd number. → True
Negation always gives the opposite truth value.
Let: p = 8 is odd
Then ¬p
Example 6:
If p = 5 > 2 (True)
Then ¬p = 5 ≤ 2 (False)
4. Conditional Statements: IF–THEN (→)
A conditional statement expresses logical implication.
Form: p → q means “If p, then q”
p = hypothesis (if part)
q = conclusion (then part)
It is false only when p is true and q is false.
3
Example 7:
Let p = A number is divisible by 4, q = It is even.
p → q = If a number is divisible by 4, then it is even. → True
Example 8:
Let p = A shape is a square. q = It has four sides.
p → q = If a shape is a square, then it has four sides. → True
Example 9:
Let p = x > 10, q = x > 5
p → q = If x > 10, then x > 5. → True
Let: p = It is raining. q = The ground is wet.
If it is raining, then the ground is wet. → True
This is false only if:
It is raining (true), but the ground is NOT wet →(false)
If it is raining, then the ground is not wet. → False
9. Biconditional: (If and Only If) s, (↔)
Form: p ↔ q means “p if and only if q”
It is true when both have the same truth value
(both true OR both false)
Example 10:
Let p = It's raining, q =the streets are wet
p ↔ q means “p if and only if q.”
It's raining if and only if the streets are wet.
Raining ⇔ Streets are wet (both directions)
Example 11:
Let p = You pass the exam.
q = You score 75% or higher.
You pass if and only if you score 75% or higher.
True when:
• Both are true
• Or both are false
Comparison:
Conditional (IF-THEN):
A) If x = 2, then x2 = 4
x = 2 → x2 = 4
Not necessarily true the other way (x2 = 4 doesn't mean x = 2, could be x = -2)
B) Biconditional (IF and ONLY IF):
x + 1 = 5 if and only if x = 4
x + 1 = 5 ⇔ x = 4)
True both ways: if x + 1 = 5, then x = 4, and if x = 4, then x + 1 = 5
10. Exclusive-Or (XOR) (⨁)
Form: p ⨁ q
It is true when only one is true
4
It is false when both are the same
Example 12:
Let p = I will eat pizza. (True)
q = I will eat pasta. (False)
p ⨁ q → True
If both are true → False
If both are false → False
Summary Table
Connective Symbol Meaning When True
Conjunction ∧ AND Both true
Disjunction ∨ OR At least one true
Negation ~ NOT Opposite value
Conditional → If… then False only when T → F
Biconditional ↔ If and only if Same truth values
Exclusive-Or ⨁ Either, but not both Exactly one true
Complete Combined Table (All in One)
p q ¬p p∧q p∨q p→q p↔q
T T F T T T T
T F F F T F F
F T T F T T F
F F T F F T T