0% found this document useful (0 votes)
18 views

Chapter_2_Logic

Chapter 2 discusses the fundamentals of logic, focusing on propositions, logical operations, and truth tables. It defines propositions as statements that can be true or false and introduces logical operators such as negation, conjunction, and disjunction. The chapter also covers tautology, contradiction, and contingency, providing examples and exercises to reinforce understanding.

Uploaded by

Chen Dishan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Chapter_2_Logic

Chapter 2 discusses the fundamentals of logic, focusing on propositions, logical operations, and truth tables. It defines propositions as statements that can be true or false and introduces logical operators such as negation, conjunction, and disjunction. The chapter also covers tautology, contradiction, and contingency, providing examples and exercises to reinforce understanding.

Uploaded by

Chen Dishan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Chapter 2 – Logic

2.1 Propositions

2.1.1 What is logic?

Logic is the concern of analyzing the pattern of reasoning by which the conclusion is
drawn from a set of statements, without reference to meaning or context.

The logic is very important because it is really crucial for mathematical reasoning and
used for designing electronic circuits.

2.1.2 What is proposition?

Logic is a system based on propositions.

A proposition is a statement that is either true (T) or false (F) but NOT both.

Correspond to 1 (true) or 0 (false) in digital circuits.

A statement is a declarative sentence that describes something.

Examples of statements:
a. Taylor Swift is a Singapore singer. (False)
b. A triangle has three sided. (True)
c. 6 x 3 = 45 (False)
d. Harimau Malaya is a team from Malaysia. (True)
e. Prime numbers can only be divided by itself and one. (True)
f. Venice is located near to Istanbul. (False)

Examples of non-statements:
a. Please have a seat.
b. Run for your life!
c. What is your favorite team?
d. 3x + 6
e. Hey you, please come here.

Faculty of Information Sciences and Engineering (FISE) Page 1


Exercise 1

Determine either the following is a statement or not. If they are statements, state either
the statement is true or false.

i. Elephants are bigger than mice.


ii. 520 < 111
iii. Don’t copy it from me!
iv. 23 is multiple of 3.
v. y > 65.
vi. Mammals are warm blooded.
vii. The sun orbits the earth.
viii. Please be careful, dear.

2.2 Logical Operations

Propositions can be divided into a simple proposition or a compound proposition.

A simple proposition is a proposition that only contains one statement while a


compound proposition can be combined to form more than one statement.

Usually we denote such propositions as p, q, r and s and introducing several logical


operators.

The logical operators (connective) as follow:

Logical Operators Read as Symbol


Negation ‘not’ ~
Conjunction ‘and’ ∧
Disjunction ‘or’ ∨
Implication ‘If…, then…’
Biconditional ‘…if and only if…’

Below is the interpretation of connectives.

Connectives Interpretation
~ Negation of ~p is true if and only if p is false.
∧ A conjunction p∧q is true if and only if both p and q are true.
∨ A disjunction p∨q is true if and only if p is true or q is true.
An implication of p q is false if and only if p is true and q is false.
A biconditional p q is true if and only if p and q is true and false.

Faculty of Information Sciences and Engineering (FISE) Page 2


Example 1:

Given the following statement.

In 1938, Hitler seized Austria and in 1939 he seized former Czechoslovia and in 1941 he
attacked the former USSR while still having a non-aggression pact with it.

Form the atomic proposition and formalize in propositional logic.

Atomic Proposition.
Let p – In 1938, Hitler seized Austria.
q – In 1939, Hitler seized Czechoslovia.
r – In 1941, Hitler attacked the former USSR.
s – In 1941, Hitler has a non-aggression pact with the former USSR.

Propositional Logic.

p∧q∧r∧s

Exercise 2:

i. Write the symbolic form which represents the following statements:

p: A puppy is green-eyed.
q: A puppy can be taught.
r: A puppy loves toys.

a) If a puppy is green-eyed, then it can be taught.


b) If a puppy cannot be taught, then it does not love toys.
c) If a puppy loves toys, then either the puppy can be taught or the
puppy is green-eyed.
d) If the puppy is not green-eyed, then the puppy loves toys and the
puppy can be taught.

Faculty of Information Sciences and Engineering (FISE) Page 3


ii. Translate the following statements into symbolic form.

a) If Jane bought a piano today, she either sold her old one or took
out the bank loan.
b) James is either a policeman or a footballer. If he is policeman, then
he has big feet. James has not big feet so he is a footballer.
c) Neither the fox nor the lynx can catch the hare if the hare is alert
and quick.
d) You can either stay at the hostel and watch movie or you can go to
museum and spend some time there.

2.3 Truth Tables

A truth table is a tabular listing of all possible input value combinations for a logical
function and their corresponding output values depends on operators.

2.3.1 Negation (NOT)

Unary Operator, P
Symbol, ~

P ~P
T F
F T

Example 2:

i. P – Today is Monday.
~P – Today is not Monday.

ii. P – 10 is an even number.


~P – 10 is not an even number.

Faculty of Information Sciences and Engineering (FISE) Page 4


2.3.2 Conjunction (AND)

Binary Operators, P, Q
Symbol, ∧

P Q P∧Q
T T T
T F F
F T F
F F F

Example 3:
i. P – Ahmad goes to school by bicycle.
Q – Ali goes to school by bicycle.
P ∧ Q – Ahmad and Ali go to school by bicycles.

ii. R – Siti loves to watch movies at Sunway Pyramid.


S – Liza loves to watch movies at Sunway Pyramid.
R ∧ S – Siti and Liza loves to watch movies at Sunway Pyramid.

2.3.3 Disjunction (OR)

Binary Operators, P, Q
Symbol, ∨

P Q P∨Q
T T T
T F T
F T T
F F F

Example 4:

i. P – You may go to the right.


Q – You may go to the left.
P ∨ Q – You may go to the right or left.

ii. R – Mei Lin is studying.


S – Mei Lin is listening music.
R ∨ S – Mei Lin is studying or listening music.

Faculty of Information Sciences and Engineering (FISE) Page 5


2.3.4 Implication (If – then)

Binary Operators, P, Q
Symbol,

P Q P Q
T T T
T F F
F T T
F F T

Example 5:

i. P – You are absent.


Q – You have a make-up assignment to complete.
P Q – If you are absent, then you have a make-up assignment to
complete.

ii. R – You are late.


S – You are on time.
R S – If you are late, then you are on time.

2.3.5 Biconditional (if and only if)

Binary Operators, P, Q
Symbol,

P Q P Q
T T T
T F F
F T F
F F T

Example 6:

i. P – We work on Memorial Day.


Q – We go to school on Memorial Day.
P Q – We work on Memorial Day if and only if we go to school on
Memorial Day.

Faculty of Information Sciences and Engineering (FISE) Page 6


ii. R–1+1=3
S – Mars is a black hole.
R S – 1 + 1 = 3 if and only if Mars is a black hole.
Exercise 3

i. Given the following

a: We are on vacation
b: We go fishing

Translate the following symbolic form into proper English

a) a Λ ~b
b) b→a
c) ~a → ~b
d) ~b → ~a

ii. p: Roses are red


q: The sky is blue.
r: The grass is green

Translate the following symbolic form into proper English

a) p∧q
b) p ∧ (q ∨ r)
c) q → (p ∧ r)
d) ( ∼ r ∧ ∼ q) → ∼ p

2.4 Logical Rules and Equivalences

2.4.1 Tautology

Tautology is a compound statement that always TRUE.

Example 7:

i. R ∨ ~R
R ~R R ∨ ~R
T F T
F T T

Faculty of Information Sciences and Engineering (FISE) Page 7


ii. ~(P∧Q) [(~P)∨(~Q)]

P Q ~P ~Q P∧Q ~(P∧Q) (~P)∨(~Q) ~(P∧Q) [(~P)∨(~Q)]


T T F F T F F T
T F F T F T T T
F T T F F T T T
F F T T F T T T

iii. [(P∧Q)∧R] [P∧(Q∧R)]

P Q R P∧Q (P∧Q)∧R (Q∧R) P∧(Q∧R) (P∧Q)∧R P∧(Q∧R)


T T T T T T T T
T T F T F F F T
T F T F F F F T
T F F F F F F T
F T T F F T F T
F T F F F F F T
F F T F F F F T
F F F F F F F T

2.4.2 Contradiction

Contradiction is the opposite of tautology which is always FALSE.

Example 8:

i. ~(R ∨ ~R)
R ~R R ∨ ~R ~( R ∨ ~R)
T F T F
F T T F

ii. ~[~(P∧Q) [(~P)∨(~Q)]]

P Q ~P ~Q P∧Q ~(P∧Q) (~P)∨(~Q) ~(P∧Q) [(~P) ~[~(P∧Q) [(~


∨(~Q)] P)∨(~Q)]]
T T F F T F F T F
T F F T F T T T F
F T T F F T T T F
F F T T F T T T F

Faculty of Information Sciences and Engineering (FISE) Page 8


iii. ~[[(P∧Q)∧R] [P∧(Q∧R)]]

P Q R P∧Q (P∧Q)∧R (Q∧R) P∧(Q∧R) (P∧Q)∧R ~[(P∧Q)∧R


P∧(Q∧R) P∧(Q∧R)]
T T T T T T T T F
T T F T F F F T F
T F T F F F F T F
T F F F F F F T F
F T T F F T F T F
F T F F F F F T F
F F T F F F F T F
F F F F F F F T F

2.4.3 Contingency

Contingency is a compound statement that contains both TRUE and FALSE.

Example 9:

i. R ~R
R ~R R (~R)
T F F
F T T

ii. ~P∧(P∨Q)

P Q ~P P∨Q ~P∧(P∨Q)
T T F T F
T F F T F
F T T T T
F F T F F
iii. ~(P∧Q)∧(~R)

P Q R ~R P∧Q ~(P∧Q) P∧(Q∧R)


T T T F T F F
T T F T T F F
T F T F F T F
T F F T F T T
F T T F F T F
F T F T F T T
F F T F F T F
F F F T F T T

Faculty of Information Sciences and Engineering (FISE) Page 9


Exercise 4:

Determine the following is Tautology, Contradiction and Contingency.

i. ~(P∧Q) [(~P)∧(~Q)]
ii. [~P∧(P∨Q)] Q
iii. (~P∧R) [(P∨Q)∧(~Q)]
iv. [(Q R)∨(~P)] [~(P∧(~R))∧Q]
v. ~(R ~Q) (~P∨~R)

Faculty of Information Sciences and Engineering (FISE) Page 10

You might also like