Week-4 Material

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

UNIT-2

Mathematical Logic

Learning Unit-2 / Module 1

Logic-Introduction Basic explanation -Statements-simple, compound-Symbolic


representation -Examples-Connectives -explanation -conjunction, disjunction, negation-
Simple problems -Problems using Truth Tables- Tautology, Contradiction-explanation-
Problems using Truth tables-logical equivalence -Simple truth table problems-
Tautological implications -Simple problems - Arguments- validity of arguments-Simple
problems-Normal forms -Minterms and Maxterms-Maxterms with examples-Problems
using Truth tables-Principal disjunctive normal form -Problems using Truth tables-
Principal conjunctive normal form-Problems using Truth tables.

WEEK- 4

Learning Objectives:

Upon completion of the unit, students will be able to

1. understand the basic principle of Mathematical logic.


2. use mathematically correct terminology and notation.
3. construct correct Direct and Indirect proofs.
4. apply logical reasoning to solve a variety of problems.
5. determine whether the given argument is valid or not.

Key topics

1. Logic

1.1 Introduction

1.2 Statements

1.3 Truth values and Truth tables

2. Simple and Compound statements

2.1 Atomic Statement-explanation

1
2.2 Compound statement-explanation

2.3 Symbolic representation

3. Connectives
3.1. Explanation

3.2 Negation, Conjunction, Disjunction

3.3 Additional connectives

3.4 Order of precedence on logical connectives

4. Compound Statements

4.1 Simple Examples

4.2 Construction of Truth table for compound statements

__________________________________________________________________________________

1.Mathematical Logic or Propositional Logic

1.1 Introduction

Logic is the science dealing with the method of reasoning. It


provides with rules and techniques for finding whether the given argument is valid or not.

2
It helps to construct correct mathematical arguments. Logic is the foundation for all
mathematical reasoning with practical applications in designing Computing Machines,
Computer Programming and many other areas of Computer Science.

1.2. Statements or Propositions

Statement or Proposition is a declarative sentence which is true or false but not both.

Examples

• The Sun rises in the east. (True)

• 2+2=3. (False)

• For any real number x, x+5 = 5+x. (True)

• Tamilnadu is a state of India.(True)

• 6 is a prime number (False)

Statements which are exclamatory, interrogative or imperative are not propositions.

Examples

• What time is it?

• What a nice flower!

• Read this carefully.

1.3 Truth Values and Truth Tables

If a statement is true, the truth value of the statement is true and is denoted by T or 1.

If a statement is false, its truth value is F or 0.

Truth Table: A Truth Table is a table that displays the relationship between truth values of
statements.

3
2. Simple and Compound statements
2.1 Simple statement

Definition:

Atomic/ Primary/Primitive statement is a statement which does not contain any


connectives.
Example: The sun sets in the west.

2.2 Compound Statement

Definition:

Compound or Molecular statement is a statement which is constructed by combining one or


more statements using connectives.
Example: John and Mary are computer science students.

Here the statement involves the logical connective and.

4
2.3 Symbolic Representation

Propositions are denoted by capital letters P, Q, R, S …. or small letters p, q, r, s…and are


called Propositional variables

Examples

1.For any positive number x, x+1>x.

Symbolic form:

P: For any positive number x, x+1>x.

Ans: P

2.Today is Saturday and it is raining today.

Symbolic form:

P: Today is Saturday

Q: it is raining today.

Ans: P and Q

3.If I go to office early then I can complete my work

P: I go to office early

Q: I can complete my work

Ans: If P then Q.

4. I will go to London if and only if I have a flight ticket

P: I will go to London

Q: I have a flight ticket

Ans: P if and only if Q

5
3.Logical Operators or Logical Connectives
3.1 Definition

A Logical Operator is a connective which is used to combine two or more propositions


(statements).

Five Basic Connectives

Logical Connectives Name Symbol

NOT Negation ˜ or ¬

AND Conjunction ˄

OR Disjunction ˅

If…Then Conditional →

If and only if Biconditional ↔

3.2. Negation, Conjunction, Disjunction

a) NOT (Negation, ˜ or ¬):

Let p be a proposition. The statement ‘not p’ ‘it is not the case that p’ or ‘it is false that p’ is
another proposition called the negation of p denoted ∼p or ¬p.

6
Example

Consider the statement denoted by p as “New Delhi is the capital of India”.

Then the negation of the above statement denoted by ¬P is “New Delhi is not the capital of
India” or “it is not the case that New Delhi is the capital of India”.

Here the truth value of p is True and hence the truth value of ¬P is False. The truth table of
Negation operator is as follows:

p ⅂p

T F

F T

b) AND (Conjunction, ˄)

Let p and q be propositions. The proposition ‘p and q’ denoted by p˄q is the proposition that
is true when both p and q are true and false otherwise.

Example

If the statement p and q is defined by “2+3=5” and “6 is not a prime number” then p ˄ q has
the truth value True as each has truth value True.

If p and q is defined by “2+3=5” and “6 is a prime number” then p ˄ q has the truth value
False as the second statement is False.

If p and q is defined by “2+3=6” and “6 is not a prime number” then p ˄ q has the truth value
False as the first statement is False.

If the statement p and q is defined by “2+3=4” and “6 is a prime number” then the statement

p ˄ q has the truth value False as each has the truth value False

The truth table of AND operator is as follows:

7
p q p˄q

T T T

T F F

F T F

F F F

c) OR (Disjunction, ˅):

Let p, q be any propositions. The proposition ‘p or q’ denoted p ˅q that is false when both p
and q are false and is true otherwise.

Example

If p or q is defined by “To ride the bus you must have a ticket or hold a pass” then any one of
the condition is sufficient though both could be true. This OR is an Inclusive OR.

Note:

Inclusive OR: A or B or both

Exclusive OR: Either A or B but not both

Example for Exclusive OR:

Students can take French or Hindi as their third language.

Here the OR is Excusive as students can take either French or Hindi as their third language
but not both.

The truth table of OR operator is as follows:

p q p ˅q

T T T

T F T

F T T

F F F

8
3.3 Additional Connectives

a) Conditional Statement (if …, then, →):

If p, q are any two statements, then the statement p →q read as ‘if p then q’ is called the
conditional statement which is false only when p is true and q is False. Otherwise, it has
truth value True.

Example
If my contract is “If I get up at 5 AM then I will go for a walk” (p →q is True)

• If I get up at 5 AM, I will not go for a walk (the contract is violated, so p →q is False)
• If I have not got up by 5 AM, I may or may not go for a walk (The contract is not
violated, so p →q is True)

p → q can also be read as ‘p implies q’; ‘p is sufficient for q’; ‘p only if q’; ‘q is necessary for p’;
‘q follows from p’; q is a consequence of p’. The truth table of Conditional operator is as
follows:

p q p→q

T T T

T F F

F T T

F F T

Note.

Some related implications from p → q:

If p →q is the conditional statement, then

q → p is called the converse of p → q

9
~q → ~p is called the contra positive of p → q

~p → ~q is called the inverse of p → q.

b) Biconditional Statement (if and only if, ↔):

If p and q are any two statements the proposition p ↔q read as ‘p if and only if q’ is called
the biconditional statement which is true whenever p and q has identical truth values.

Example

Let us consider the compound statement “I will go by train if and only if I have a ticket”.
Then the biconditional has the truth value True if both have the same truth value and False
otherwise. The truth table of Biconditional operator is as follows:

p q p⟷q

T T T

T F F

F T F

F F T

3.4 Order of precedence for logical connectives:

Negation ¬

Conjunction ˄

Disjunction ˅

Conditional →

Bi conditional ⟷

All operators are right-associative. We can use parentheses to disambiguate.

For example,

∼p ˅ q ∧ r → s means ((∼p) ˅ (q ∧ r)) → s

10
4. Compound statements

4.1 Simple examples

1. Find the truth value of p ˅ q and p ˄ q from the following.

a. p: 3 < 3 q: 4 < 6
p: 3 < 3. (F) q: 4 < 6. (T)
∴ p ˅ q is True and p ˄ q is False.

b. p: 3 x 2 = 5 q: 8 + 9 = 18
p: 3 x 2 = 5. (F) q: 8 + 9 = 18. (F)
∴ p ˅ q is False p ˄ q is False

2. Write in Symbolic form and find the truth value of the following compound
propositions:

a. If the earth is round, then the earth travels round the sun.
p: The earth is round. (T)
q: The earth travels around the sun. (T)
The given proposition in symbolic form: p → q which is True.

b. If Alexander Graham Bell invented telephone, then I am the president of


India
p: Alexander Graham Bell invented telephone. (T)

11
q: I am the President of India. (F)
The given proposition in symbolic form: p → q which is False [if p is true and
q is false]

c. If 2 + 2 = 5 then tigers have wings


p: 2 + 2 = 5 (F);
q: Tigers have wings. (F)
In symbolic form: p → q, which is True.

d. If 2 + 2 = 5 then I have two eyes


p: 2 + 2 = 5 (F);
q: I have two eyes (T)
In symbolic form: p → q, which is True.

4.2 Construction of Truth table for compound statements

Example.1

Construct the truth table for the following compound propositions.

a). (p ∧ q) → (p ˅q)

b). (p →q) → (q →p)

c). (p→q) ⟷ (¬q → ¬p)

d). (p⟷ 𝑞) ⟷ ((p ∧ q) ˅(¬p ∧ ¬q))

12
Proof.

a) (p∧q) → (p ˅q)

p q p∧q p ˅q (p∧q) → (p ˅q)

T T T T T

T F F T T

F T F T T

F F F F T

b) (p →q) → (q →p)

p q p→q q →p (p →q) → (q →p)

T T T T T

T F F T T

F T T F F

F F T T T

c) (p→q) ⟷ (¬q → ¬p)

p q ¬p ¬q p→q ¬q →¬p (p→q) ⟷ (¬𝐪 → ¬𝐩)

T T F F T T T

T F F T F F T

F T T F T T T

F F T T T T T

13
d) (p⟷ 𝑞) ⟷ ((p ∧ q) ˅ (¬p ∧ ¬q))

p q ¬p ¬q p⟷ 𝒒 ≡ 𝒂 𝐩∧𝐪 ¬p ∧ ¬q (𝐩 ∧ 𝐪) ˅(¬𝐩 ∧ ¬𝐪) ≡ 𝒃 a⟷ 𝒃

T T F F T T F T T

T F F T F F F F T

F T T F F F F F T

F F T T T F T T T

Example.2.

Construct the truth table for (p→ (q →r)) → ((p →q) → (p →r))

p q r p →q p →r (p →q) → (p →r)) ≡ 𝒃 q →r p→ (q →r) ≡ 𝒂 a →b

T T T T T T T T T

T T F T F F F F T

T F T F T T T T T

T F F F F T T T T

F T T T T T T T T

F T F T T T F T T

F F T T T T T T T

F F F T T T T T T

14
Example.3. Construct the truth table for (Ꞁ𝒑 ⟷ Ꞁ𝒒) ⟷ (𝒒 ⟷ 𝒓)

q r Ꞁ𝒑 Ꞁ𝒒 Ꞁ𝒑 ⟷ Ꞁ𝒒 ≡ 𝒂 𝒒⟷𝒓≡𝒃 𝒂⟷𝒃

T T T F F T T T

T T F F F T F F

T F T F T F F T

T F F F T F T F

F T T T F F T F

F T F T F F F T

F F T T T T F F

F F F T T T T T

Example.4. Construct the truth table for ¬(𝒑 ∨ (𝒒 ∧ 𝒓)) ↔ ((𝒑 ∨ 𝒒)˄(p →r))

p q r 𝒒 ∧𝒓 𝒑 ∨ (𝒒 ∧ 𝒓) ¬(𝒑 ∨ (𝒒 ∧ 𝒓)) 𝒑∨𝒒 p →r (𝒑 ∨ 𝒒)˄(p →r) (a)↔(b)

(a) (b)

T T T T T F T T T F

T T F F T F T F F T

T F T F T F T T T F

T F F F T F T F F T

F T T T T F T T T F

F T F F F T T T T T

F F T F F T F T F F

F F F F F T F T F F

15
Summary
This topic covers the introduction and the basis of mathematical logic, which is the
application of logic to Mathematics. This includes propositions and logical connectives. After
completing the introductory part, students will be able to distinguish between propositions
and those sentences which are not. Logical connectives play the key role in forming compound
propositions are studied using a tabular format called truth table based on all possible
combinations of the propositions with respect to the logical connective. Truth tables help the
students to construct a new proposition and analyze its truth value and validity.

Questions and Exercises


1. Negate the following statements using symbolic form.

(i) I don't eat anything that has a face.

(ii) A prime number is an integer

2.List the converse, inverse, and contrapositive of the statement

(i) “If p is prime, then √p is irrational.”

(ii) “If it is raining, then there are clouds in the sky.”

3.Write the following in symbolic form

(i) "The ice cream is not vanilla flavoured”

(ii) “The ice cream is either vanilla flavoured or chocolate Flavoured”

4. Construct the truth table for [(𝑝 ∨ 𝑞) ∧ (p → 𝑟) ∧ (𝑞 → 𝑟)] → 𝑟 .

5. Construct the truth table for ⏋𝑃 → (𝑝 → 𝑞) .

6. Construct the truth table for (p → 𝑞) ∧ (𝑞 → 𝑟).

7. Construct the truth table for (p → 𝑞) → (⏋q →⏋p).

References

1. Johnsonbaugh, Richard (2005), Discrete Mathematics, Sixth Edition (Upper Saddle River,
NJ: Pearson/Prentice Hall).
2. Goodaire, Edgar G.; & Parmenter, Michael M. (2006), Discrete Mathematics with Graph
Theory, Third Edition (Upper Saddle River, NJ: Pearson/Prentice Hall).
3. Haggard, Gary; Schlipf, John; & Whitesides, Sue (2006), Discrete Mathematics for Computer
Science (Belmont, CA: Brooks/Cole—Thomson Learning).
4. T. Veerarajan, Discrete Mathematics, with Graph Theory and Combinatorics,2017.

16
Further reading

1. Kenneth H. Rosen (2007). Discrete Mathematics: And Its Applications. McGraw-Hill College.

2. Susanna S. Epp (2010-08-04). Discrete Mathematics With Applications. Thomson Brooks/Cole.

17

You might also like