1. SUBTOPIC 1 : PROPOSITIONS AND LOGICAL OPERATIONS.
1.1 Propositional Logic.
Definition
A proposition is a declarative sentence that is either TRUE or FALSE, but NOT BOTH.
For the example of declarative sentence that are not propositions:
Zulhelmy will not win the Thomas cup this year.
X+1=3
For the example of declarative sentence that are not propositions:
Kuala Lumpur is a capital of Malaysia.
2+2=4
Notation
We use letters to denote propositional variables (or statement variables) that is , variables
that represent propositions , just as a letters are use to denote numerical variables. The
conventional letters used to denote numerical variable. The conventional letters used for
propositional variables are p , q , r , s ,….. The area of logic that deals with propositions is
called propositional calculus or propositional logic.
Logic is more precise than natural language. The study of the principles of reasoning,
especially of the structure of propositions as distinguished from their content and of method and
validity in deductive reasoning.
1
2. Examples :
- You may have a chiken rice or spagethi ( vague )
Can I have a both?
- If you buy this karipap in advance, its cheaper.
Are there not cheap last minute karipap?
For the reason, logic is used for hardware and software specification such as given a set
logic statement and one can decide whether or not they are satisfiable, although this is a costly
process.
By George Boole, born on November 2 , 1815 in Lincoln , England. Died on December 8,
1864 in Ballintemple, Ireland at 49 years old.
In 1854, George Boole established the rules of symbolic logic in his book , The Laws Of
Though.
USE OF LOGIC GATES
Logic gates are the building block of digital electronics. They are formed by the
combination of transistors to make digital operations possible.
Every digital product like a computer, mobile phones, calculator even digital watch contains
logic gates. That’s mean, the logic gates are very important in the electric and electronics to
know the solution of every components.
2
3. Propositional Logic – Negation is another propositions. Let p be a proposition. The
compound proposition is “it is not the case that p”. It called the negation of p and the denoted of
⌐p. The truth value of the negation of p is the opposite of the truth value of p. The proposition ⌐p
is also can say as “not p”.
Example:
Discrete mathematics is Hasrul’s favorite subject. ( p )
Discrete mathematics is NOT Hasrul’s favorite subject. ( ⌐p )
Truth the table for negation :
p ⌐p p ⌐p
True False or T F
False True F T
Table A Table B
The truth table presents the relations between the truth values of many propositions
involved in a compound proposition. This table has a row for each possible truth value of
propositions.
Logical operators are more interesting statements can be created through the combination
of two propositions using logical operators. Operators use to combine propositions and the result
of connecting two propositions is another proposition. The common logical are AND (˄),OR
(˄ and NOT OR (⊕).
)
3
4. Propositional Logic – Conjunction is a compound proposition that has components
joined by the word and or its symbol and is true only if both or all the components are true. Let p
and q be propositions. The compound proposition “p and q“ or we can say that “p ˄ q”, is true
when both p and q are true and false otherwise. For the example in a sentence are:
Faiz is a singer (p) and dancer (q).
Truth the table for conjunction:
p q p˄q
T T T
T F F
F T F
F F F
Propositional Logic – Disjunction is a proposition that presents two or more alternative
terms, with the assertion that only one is true. Let p and q be propositions. The compound
proposition “p or q“ or “p ˄ q“, is false when both p and q are false and true otherwise. The
compound proposition “p ˄ q“ is called disjunction of p and q.
For the example in a sentence are:
Faiz is a singer (p) or dancer (q).
Truth the table for disjunction:
p Q p˄q
T T T
T F T
F T T
F F F
4
5. Propositional Logic – Exclusive Disjunction is a Logic the connective that gives the
value true to a disjunction if one or other, but not both, of the disjunction are true. Let p and q be
proposition. The compound proposition “p exclusive or q“, denoted “p ⊕ q“, is true when
exactly one of p and q is true and is false otherwise. This compound proposition “p ⊕ q“ is
called exclusive disjunction of p and q.
For the example in a sentence are:
You can have a PS2 (p) or PSP (q).
Truth the table for the exclusive disjunction:
p q p⊕q
T T F
T F T
F T T
F F F
5
6. EXERCISE:
1. Write the truth table of each proposition
a) p ˄ ⌐q
b) (p ˄ q) ˄ ⌐p
2. Formulate the symbolic expression in words using.
p: you play football
q: you miss the midterm exam
r: you pass the course
a) p ˄ q
b) ⌐ (p ˄ q) ˄ r
6
7. SUBTOPIC 2 : CONDITIONAL STATEMENT
2.1 CONDITIONAL
Propositional Logic – Implication mean that the operator that forms a sentence from two
given sentences and corresponds to the English if … then … Let p and q be propositions. The
compound proposition “if p then q“, denoted “p → q“, is false when p is true and q is false, and
is true otherwise. This compound proposition p → q is called the implication (or the conditional
statement) of p and q.
In this implication, p is called hypothesis ( or antecedent or premise ) and q is called the
conclusion ( or consequence ).
Example:
If muzzamer is the agent of Herbalife (p), then he used the product (q).
If p, then 2 + 2 = 4.
Truth the table for the implication:
p q p→q
T T T
T F F
F T T
F F T
REMARKS:
- The implication p → q is false only when p is true then q is false.
- The implication p → q is true when p is false whatever the truth value of q.
7
8. THE IMPLICATION:
Variety of terminology is used to express the implication p → q
If p then q
p implies q
q is p
p only if q
q when p
p is sufficient for q
a sufficient condition for q is p
q follows from p
q whenever p
In natural language, there is a relationship between the hypothesis and the conclusion of
an implication. In mathematical reasoning, we consider conditional statements of a more general
sort that we use in English. The implication
“if today is Friday , then I pray in the mosque “
Is true every day except Friday, even though I pray in the mosque is false.
The mathematical concept of a conditional statement is independent of a cause and effect
relationship between hypothesis and conclusion. We only parallel English usage to make it easy
to use and remember.
8
9. 2.2 BICONDITIONAL
Definition: let P and Q be two propositions. Then, P ↔ Q is true whenever P and Q
have the same truth values. The proposition P ↔ Q is called biconditional or equivalence,
and it is pronounced “P if and only if Q”. When writing, one of frequently uses “iff” as an
abbreviation for “if and only if”.
The truth table is given above. The following is an example of a biconditional. Let P be the
proposition that “x is even” and Q be the proposition that “x is divisible by 2.” In this case, P ↔
Q expresses the statement “x is even if and only if x is divisible by 2.”
Let
p : Jamal receives a scholarship
q : Jamal goes to college.
The proposition can be written symbolically as p ↔ q. Since the hypothesis q is false,
the conditional proposition is true.
The converse of the propositions is
“If Jamal goes to college, then he receives the scholarship”.
This is considered to be true precisely when p and q have the same truth values.
If p and q are propositions, the proposition
p if and only if q
Is called a biconditional proposition and is denoted
p↔q
9
10. Truth table for the biconditional:
p q p↔q
T T T
T F F
F T F
F F T
Logical equivalences
Similarly to standard algebra, there are laws to manipulate logical expressions, given as logical
equivalences.
1. Commutative laws PVQ≡QVP
PΛQ≡QΛP
2. Associative laws (P V Q) V R ≡ P V (Q V R)
(P Λ Q) Λ R ≡ P Λ (Q Λ R)
3. Distributive laws: (P V Q) Λ (P V R) ≡ P V (Q Λ R)
(P Λ Q) V (P Λ R) ≡ P Λ (Q V R)
4. Identity PVF≡P
PΛT≡P
5. Complement properties P V ¬P ≡ T (excluded middle)
P Λ ¬P ≡ F (contradiction)
6. Double negation ¬ (¬P) ≡ P
7. Idem potency (consumption) PVP≡P
PΛP≡P
8. De Morgan's Laws ¬ (P V Q) ≡ ¬P Λ ¬Q
¬ (P Λ Q) ≡ ¬P V ¬Q
9. Universal bound laws (Domination) PVT≡T
PΛF≡F
10. Absorption Laws P V (P Λ Q) ≡ P
P Λ (P V Q) ≡ P
10
11. 11. Negation of T and F: ¬T ≡ F
¬F ≡ T
For practical purposes, instead of ≡, or ↔, we can use = .Also, sometimes instead of ¬, we will
use the symbol ~.
Example:
Show that [p˄ (p → q)] →q is atautology.
We use ≡ to show that [p˄ (p → q)] →q ≡ T
[p˄ (p → q)] →q
≡ [p˄ (⌐p ˄ q)] →q Substitution for →
≡ [(p˄ ⌐p) ˄ (p ˄ q)] →q Distributive
≡ [F ˄ (p ˄ q)] →q Uniqueness
≡ (p ˄ q) →q Identity
≡ ⌐ (p ˄ q) ˄ q Substitution for →
≡ (⌐p ˄ ⌐q) ˄ q DeMorgan’s
≡ ⌐p ˄ (⌐q ˄ q) Associative
≡ ⌐p ˄ T Excluded middle
≡T Domination
So, Show that [p˄ (p → q)] →q is a tautology (true).
11
12. 2.3 DE MORGAN’S LAW FOR LOGIC
We will verify the first of De Morgan’s Law
⌐ (p ˄ q ≡ ⌐p ˄ ⌐q,
) ⌐ (p ˄ q) ≡ ⌐p ˄ ⌐q
By writing the truth table for P = ⌐ (p ˄ q) and Q = ⌐p ˄ ⌐q, we can verify that, given
any truth values of p and q, either P or Q are both true or P and true are the both false:
p q ⌐ (p ˄ q) ⌐p ˄ ⌐q
T T F F
T F F F
F T F F
F F T T
Example:
~ (B Å C) = ~ ((B Λ ~C) V (~B Λ C)) =
Apply De Morgan's Laws
= ~ (B Λ ~C) Λ ~ (~B Λ C) =
Apply De Morgan's laws to each side
= (~B V ~ (~C)) Λ (~ (~B) V ~C) =
Apply double negation
= (~B V C) Λ (B V ~C) =
Apply distributive law
= (~B Λ B) V (~B Λ~C) V (C Λ B) V (C Λ ~C) =
Apply complement properties
= F V (~B Λ~C) V (C Λ B) V F =
Apply identity laws
= (~B Λ~C) V (C Λ B) =
Apply commutative laws
= (C Λ B) V (~B Λ~C) =
Apply commutative laws
= (B Λ C) V (~B Λ~C) = B C
12
13. EXERCISE:
1. Assuming that p and r are false and q are true, find the truth value of each proposition:
a) p → q
b) (p → q) ˄ (q → p).
2. Formulate the symbolic expression in words using:
P: today is Monday
q: it is raining
r: it is hot
a) ⌐ (p v q) r
3. Show that (p ˄ q) → q is a tautology.
4. Show that ⌐ (p q) ≡ (p ⌐q)
13