You are on page 1of 18

2.

1 PROPOSITONS AND LOGICAL OPERATIONS

2.1.1 Proposition

 A declarative sentence (contains facts that can be stated as TRUE or False)


 Denoted as T (if true), F (if false)

Example of preposition:

Syed Saddiq is the Minister of Youth and Sport. (T)


Kota Bharu is located in Kelantan. (T)
3+4=10. (F)
Bitter gourd taste sweet (F)
Discrete Mathematics is difficult. (Not a preposition, cannot be stated whether it is
TRUE or FALSE)
Follow the instruction precisely. (Not a preposition, cannot be stated whether it is
TRUE or FALSE)
X+8=23 (Not a preposition, however it can be turned in a preposition if we assign
values to the variables)
2.1.2 Negation

 Statement that against the actual proposition

Let p be a proposition. The negation of p is denoted by ¬p is read “not p”

The truth table for the Negation of proposition

p ¬p
T F
F T

Example of negation:

Siti Norliza is a famous singer


Negation: Siti Norliza is not a famous singer
Camelia does not like to eat cheeseburger
Negation: Camelia like to eat cheeseburger
An original Chanel handbag will cost more than Rm1000
Negation: An original Chanel handbag will cost less than Rm1000
Siti’s mp4 player has at least 2000 songs
Negation: Sarah mp4 player has less than 2000 songs
2.1.3 Conjunction

 Let p and q be propositions. The conjunction of p and q, denoted by p Ʌ q, is the


proposition of “p and q”,
 The conjunction p Ʌ q is T when both p and q are T and is F otherwise

The truth table for the Conjunction of two prepositions

p q pɅq
T T T
T F F
F T F
F F F
*Note that in logic the word “but” sometimes is used instead of “and” in a conjunction. For
example, the statement: “The sun is shining but it is raining” is another way instead of saying
“the sun is shining and it is raining”

Example of Conjunction:

The dress is so beautiful.


The dress is expensive.
Conjunction: The dress is beautiful and expensive
Sarah’s phone can store up to 158Gb data
Sarah’s phone is so thin and lightweight
Conjunction: Sarah’s phone can store up to 158Gb data and her phone is so thin and
lightweight
2.1.4 Disjunction

 Let p and q be propositions. The disjunction of p and q, denoted by p v q, is the


proposition of “p and q”,
 The disjunction p v q is F when both p and q are F and is T otherwise

The truth table for Disjunction of two propositions

p q pvq
T T T
T F T
F T T
F F F

Example of Disjunction:

Nadia’s phone has 5Gb free space


The IOS system of Nadia’s phone is working efficiently
Disjunction: Nadia’s phone has 5Gb free space and the IOS system of the phone is
working efficiently

*This proposition is true either when Nadia’s phone has 5Gb free space or when Nadia’s
phone IOS system is working efficiently and when both conditions are true.

Students who have taken introductory statistic can join this class
Students who have taken fundamental mathematics can join this class
Disjunction: Students who have taken Introductory statistics or fundamental
mathematics can join this class

*This proposition is true (can join the class) either if the students have taken introductory
statistics or fundamental mathematics and when the students have taken both.
2.1.5 Exclusive Or

Let p and q be propositions. The exclusive or of p and q, denoted by p Ꚛ q, is the proposition


that is true when exactly one of p and q is true and is false otherwise.

The truth table for the Exclusive Or of two propositions

p q pꚚq
T T F
T F T
F T T
F F F

Example of Exclusive Or:

Nadia’s phone has more than 5Gb free space


The IOS system of Nadia’s phone is working efficiently
Exclusive Or: Nadia’s phone has 5Gb free space, or the IOS system of the phone is
working efficiently

*Note that the proposition only true when only one of the statements is true
2.1.6 Conditional Statement (Implication)

Let p and q be propositions. The conditional statement p → q is the proposition “if p, the q.”
The conditional statement p → q is F when p is T and q is F, and true otherwise. In the
conditional statement p → q, p is called the hypothesis (or antecedent or premise) and q is
called the conclusion (or consequence).

The truth table for the Conditional Statement of two propositions

p q p→q
T T T
T F F
F T T
F F T

*Note that the statement p → q is true when both p and q are true and when p is false (no
matter what truth value q has)

Example of Conditional Statement:

Salina study hard


Salina will get a god job
Conditional Statement: If Salina study hard, then she will get a good job.
If book the hotel trough Booking.com, the price will be cheaper
If you struggle harder, the result will come out better
If you love somebody, then confess it

Which of the following implication is T?

a) If 10 is negative number (F), then 4+5=10 (F)


b) If 5 is negative number(F), then 5+6 is 11 (T)

Solution

a) T
b) T
How can this sentence be translated into logical expression?

If you can break into the computer database then you are a professional hacker or you are a
science computer graduate.

Solution

Let

p = you can break into the computer database

q =you are a professional hacker

r =you are a science computer graduate

p → (q v ¬ r)
2.1.6 Converse, Contrapositive and Inverse

Converse of p → q is q → p
Inverse of p → q is ¬p → ¬q
Contrapositive of p → q is the proposition ¬q → ¬p

Example of converse, contrapositive and inverse

What are the converse, inverse and contrapositive for conditional statement “If it is afternoon
then the students are sleepy”

Solution

Let p = it is afternoon

q = students are sleepy

The converse of p → q is the proposition q → p


If the students are sleepy then it is afternoon
The inverse of p → q is the proposition ¬p → ¬q
If it is not afternoon the students are not sleepy
The contrapositive of p → q is the proposition ¬q → ¬p
If the students are not sleepy then it is not afternoon

What are the converse, inverse and contrapositive, of the conditional statement “if you work
hard, you will succeed”

Let p = if you work hard

q = you will succeed

Converse: if I am successful, I work hard


Inverse: If you do not work hard the you will not success
Contrapositive: If I don’t succeed then I don’t word hard
2.1.17 Biconditional Statement

Let p and q be propositions. The biconditional statement p ↔ q is the proposition “p if and


only if q.” The biconditional statement p ↔ q is true when p and q have the same truth
values, and is false otherwise. Biconditional statements are also called bi-implications.

The truth table for the Biconditional Statement of two propositions

p q p↔q
T T T
T F F
F T F
F F T

Example of biconditional statement

Let p be the statement “You will be cured,” and let q be the statement “You take the
medicine.” Then p ↔ q is the statement: You will be cured if and only if you take the
medicine.
2.1.7 Precedence of Logical Operators

Operator Precedence
¬ 1
Ʌ 2
V 3
→ 4
↔ 5
2.1.8 Bit Operator

Computers represent information in bits. A bit has two possible values, namely 0 and 1. 0 bit
represents F and 1 bit represents T.

Table for the Bit Operators Ʌ, V and Ꚛ

x y xɅy xVy xꚚy


0 0 0 0 0
0 1 0 1 1
1 0 0 1 1
1 1 1 1 0

Example

Find the bitwise Ʌ, V and Ꚛ of the bit strings 101010101010 and 111010100110

Solution

101010101010

111010100110

Bitwise Ʌ 101010100010

Bitwise V 111010101110

Bitwise Ꚛ 010000001100
2.1.8 Truth Table

Example

Construct the truth table for


a) p Ʌ q
b) q Ʌ p

What can be concluded?

p q pɅq qɅp
T T T T
T F F F
F T F F
F F F F
Hence, it is a commutative law

Construct the truth table of (p V ¬q) → (p Ʌ q)


p q ¬q p V ¬q pɅq (p V ¬q) → (p Ʌ q)
T T F T T T
T F T T F F
F T F F F T
F F T T F F
2.2 PREDICATES AND QUANTIFIERS

2.2.1 Predicates

Predicates are statements involving variables, such as x > 10.

The statement “x is greater than 10” has two parts. The first part, the variable x, is the subject
of the statement. The second part, the predicate,”is greater than 10” refers to a property that
the subject of the statement can have.

We can denote the statement “x is greater than 10” by P(x) where P denotes the predicate “is
greater than 10” and x is the variable.

The statement P(x) is also said to be the value of the propositional function P at x. once a
value has been assigned to the variable x, the statement P(x) becomes a proposition and has a
truth value.

Example of predicates

The tutor of this class is Miss y


Predicate: tutor of this class
Variable: Miss y
Proposition: The tutor of this class is Miss Sherina (T)
x = y + 6, x + y = z
We can also have statements that involve mora than one variable. For instance,
consider the statement x = y + 6. We can denote this statement by Q (x, y) where x
and y are variables and Q is the predicate. When the values are assigned to the
variables x and y, the statement Q (x, y) has a truth value.

Example

Let P (x) denote the statement x>4. What are the truth values of P(5) and P(3)?

Solution

P(5) : 5>4, T P(3) : 3>4, F


2.2.2 Quantifiers

Quantification express the extent to which a predicate is true over a range of elements. In
English, the word all, some, many, none, and few are used in quantifications.

We will focus on two types of quantification here: universal quantification, which tell use
that the predicate is true for every element under consideration, and existential quantification,
which tells us that there is one or more element under consideration for which the predicate is
true.

2.2.2.1 Universal Quantification

The universal quantification of P (x) is the statement “P(x) for all value of x in the domain.”
The notation ∀ xP (x) denotes the universal quantification of P(x). Here ∀ is called the
universal quantifier. We read ∀xP (x) as “for all xP(x)” or “for every xP(x).” An element for
which P (x) is false is called a counterexample of ∀ xP(x).

Besides “for all” and “for every”, universal quantification can be expressed in many other
ways, including “all of,” ”for each,” “given any,” ”for arbitrary,” “for each,” and “for any.”

A statement ∀xP(x) is false, where P(x) is a propositional function, if and only if P(x) is not
always true when x is in the domain. One way to show that P(x) is not always true when x is
in the domain is to find a counterexample to the statement ∀xP(x). Note that a single
counterexample is all we need to establish that ∀ x P(x) is false.

Example

Let P(x) be the statement x+5>x. what is the truth value of the quantification ∀xP(x) where
the domain consists of all real numbers?

Solution

Because P(x) is true for all real numbers x, the quantification ∀xP(x) ia T.

Example

Let P(x) be the statement x< 4. What is the truth value of the quantification ∀xP(x) where the
domain consists of all real numbers?

Solution
By counterexample, when x=5. P(5) is F. Thus ∀xP(x) is F.
2.2.2.2 Existential Quantification

The existential quantification of P(x) is the proposition. There exist an element x in the
domain such that P(x). We use the notation ∃xP(x) for the existential quantification of P(x).
Here ∃ is called the existential quantifier.

A domain must always be specified when a statement ∃xP(x) is used. Furthermore the
meaning of ∃xP(x) changes when the domain changes. Without specifying the domain, the
statement ∃xP(x) has no meaning.

Besides the phrase “there exist,” we can also express existential quantification in many other
ways, such as by using the words “for some,” “for at least one,” or “there is.” The existential
quantification ∃xP(x) is read as

There is an x such that P(x)

There is at least one x such that P(x)

Or

For some xP(x)

Observe that the statement ∃xP(x) is false if and only if there is no element x in the domain
for which P(x) is true. That is, ∃xP(x) is false if and only if P(x) is false for every element of
the domain.

TABLE 1 Quantifiers
Statement When True? When False?
∀xP (x) P(x) is true for every x There is an x for which P (x) is false
∃xP (x) There is an x for which P (x) is P (x) is false for every x
true

Example

Let Q(x) denote the statement x=x+2. What is the truth value of the quantification ∃xQ(x)
where the domain consist of all real numbers?

Solution
Because Q(x) is F for every real number x, ∃xQ(x) is F.Type equation here.

What is the truth value of ∀xP(x) and ∃xP(x) where P(x) is the statement x3 < 10 and the
domain consists of positive integers not exceeding 3?

Solution

Because the domain is {1,2,3}, the proposition:

P (1), T P(2), T P(3), F

∀xP(x) is F ∃xP(x) is T

Precedence of Quantifiers

The quantifiers ∀ and ∃ have higher precedence than all logical operators from propositional
calculus. For example, ∀xP(x) V Q(x) is the disjunction of ∀xP(x) and Q(x). In other words,
it means (∀xP(x))VQ(x) rather than ∀x(P(x)VQ(x)).

Negating Quantified Expressions

TABLE 2 De Morgan’s Laws for Quantifiers.


Negation Equivalent When Is Negation True? When False?
Statement
¬(∃xP(x)) ∀x¬P(x) For every x, P(x) is false There is an x for which P(x) is true
¬(∀xP(x)) ∃x¬P(x) There is an x for which P(x) is true for every x
P(x) false

Example

What are the negations of the statements “There is a good dug addicter” and “All Malaysians
eat Nasi Lemak”?

Solution

Let P denote “x is good” then the statement “There is a good druf addicter” is represented by
∃xP(x) where the domain consist of all drug addicters.

The negation of this statement is ¬∃xP(x) which is equivalent to ∀xP(x). This negation can be
expressed as “Every drug addicters are bad.”
Let P(x) denote “x eats Nasi Lemak.” Then the statement “All Malaysians eat Nasi Lemak” is
represented by ∀ xP(x) where the domain consist of all Malaysians. The negation of this
statement is ¬∀xP(x) which is equivalent to ∃x¬P(x) this negation can be expressed in “there
is a Malaysians that does not eat Nasi Lemak”

You might also like