Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
27 views

Lecture 3

This document provides an outline of topics covered in a lecture on discrete structures. The lecture discusses predicate logic, including predicates, quantifiers like universal and existential quantifiers, and restricted domains. It provides examples of translating English statements to logical expressions using predicates and quantifiers.

Uploaded by

Jayaraj Joshi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Lecture 3

This document provides an outline of topics covered in a lecture on discrete structures. The lecture discusses predicate logic, including predicates, quantifiers like universal and existential quantifiers, and restricted domains. It provides examples of translating English statements to logical expressions using predicates and quantifiers.

Uploaded by

Jayaraj Joshi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

Discrete Structure

Lecture 3
Class Conducted by
Bibek Ropakheti
Associate Professor : Cosmos College of Management and Technology
Visiting Faculty : NCIT
June 2020
Chapter 1
Logic, Induction and Reasoning
Chapter Outline
• Proposition and Truth function • Proofs
• Propositional Logic • Informal Proofs
• Formal Proofs
• Expressing statements in Logic
Propositional Logic • Elementary Induction
• The predicate Logic • Complete Induction
• Validity • Methods of Tableaux
• Informal Deduction in Predicate • Consistency and Completeness
Logic of the System
• Rules of Inference
Last Class
• Propositional Equivalences
• Tautology
• Contradiction
• Logical Equivalences
• Using Truth Table
• Important Equivalences (as Law)
• Arguments
• Constructing New logical Equivalences
• Propositional Satisfiability
Today’s Class
• The Predicate Logic
• Predicates
• Quantifiers
• Universal Quantifiers
• Existential Quantifiers
• Other Quantifiers
• Quantifiers with restricted domain
• Precedence of Quantifiers
• Logical Equivalences involving Quantifiers
• Negating Quantified Expressions
• Translating From English to Logical Expression
Predicate Logic
• Propositional logic can’t adequately express the meaning of all
statements in mathematics and in natural language
• Eg:
• Every Patient admitted in Teku hospital has COVID infection

• Its difficult to use propositional logic in a generalized condition


Predicate Logic
• Hence a more powerful logic is preferred
• Its Predicate Logic
• It can be used to express the meaning of a wide range of statements
in mathematics and computer science
• It also permit us to reason and explore relationships between objects
• Predicates and Quantifiers are used in predicate logic
• It enables us to reason with statements that asserts that a certain
property holds for all objects of certain type and with statements that
assert the existence of an object with a particular property
Predicates
• Predicate refers to a property that the subject of the statement
(which could be describe by any variable) can have
• Let us consider few statements
• X is less than 25
• Patient P has PCR report to be negative
• Student Y is not in this class
• These statements are neither true nor false when the values of the
variables are not specified
• If value of the variable is specified, it becomes proposition
Predicates
• Predicates help to produce propositions from such statements
• In such statement, predicate refers to the property of variable
• Eg.
• Patient x has PCR report to be negative
• Here, x is a variable and PCR report to be negative is predicate
• Now, let R be the predicate which describes the PCR report to be negative for
any variable x, which could be expressed as
• R(x): Patient x has PCR report to be negative
• Where, R(x) is the propositional function
Another example
• P(x): x is less than 25
• Where P is a predicate and x is a variable
• P(x) is said to be the value of the propositional function P at x
• If x is 6 then P(6) is True
• If x is 26 then P(26) is false
Practice
• Let A(x) denote the statement “Computer x is under the
maintenance”. Suppose computers at NCIT with number L3-101 and
Staff-3 are under maintenance. All other computers are working well.
What are the truth values of A(L3-101), A(L2-102), A(Staff-3) and
A(Lib-2)?
• A(L3-101)
• A(L2-102)
• A(Staff-3)
• A(Lib-2)
Statement with more variables
• Statement with more variables could also be considered
• Let, Q (x,y): x is less than y
• Then,
• Q(6,2) is False
• Q(2,6) is True
• Q(6,6) is False as well
Statement with n variables
• A statement involving the n variables x1, x2, x3, … , xn can be denoted
by P(x1, x2, x3, … , xn)
• A statement of the form P(x1, x2, x3, … , xn) is the value of the
propositional function P at the n-tuple(x1, x2, x3, … , xn)
• P is also called an n-place predicate or an n-ary predicate
Practice
• R(x,y,z) denotes the statement x+y=z
• Find the truth value of the propositions
• R(1,2,3)
• R(0,2,4)
• R(2,2,4)
Propositional functions in Computer Program
• Predicates are used in the verification of computer programs
• Consider the statement
• If x>0 then x:=x+1
• When this statement is encountered in a program, the value of the variable x
at that point in the execution of the program is inserted into P(x), which is
“x>0”
• If P(x) is true then x:=x+1 is executed, i.e. the value of x is incremented
• If P(x) is false then assignment statement is not executed so the value of x
remains same
Propositional functions in Computer Program
• Verification of computer programs always produce the desired output
when the given valid input
• Statements describing valid inputs are preconditions
• Conditions that the output should satisfy when the program has run
are the post conditions
Quantifiers
• When the variables in a propositional function are assigned values,
the resulting statement becomes a proposition with certain truth
value
• Quantification is another way to create a proposition from a
propositional function
• Quantification expresses the extent to which a predicate is true over a
range of elements
• In English, the words all, some, many, none, and few are used in
quantification
Quantifiers
• In logic two types of quantification are common
• Universal Quantification: which tells us that a predicate is true for
every element under consideration
• Existential Quantification: which tells us that a predicate is true for at
least one or more element under consideration

• The area of logic that deals with predicate and quantifiers is called
Predicate Calculus
The Universal Quantifier
• Many mathematical statements assert that a property is true for all
values of variable in a particular domain, called the domain of
discourse (or the universe of discourse), commonly as the domain
• Such statement is expressed using Universal quantification
• The Universal Quantification of P(x) is the statement
“P(x) for all values of x in the domain.”
• It is denoted by ∀xP(x)
where ∀ is called universal quantifier, and the notation is read as “for
all x P(x)” or “for every x P(x)”
The Universal Quantifier
• Example
• Let P(x) be the statement x+2>x
• Then we can say ∀xP(x) is True
• Domain is necessary to be understood
• It asserts the possible values of any variable
The Universal Quantifier
• Another Example
• Let Q(x): x2<10, with the domain of x being an positive integer not exceeding
three
• Then we can say ∀xQ(x) is True
• This is because, domain of x ranges from 1 to 3
• So, Q(x) = Q(1) ∧ Q(2) ∧ Q(3)
• When all the elements in the domain can be listed say, x1, x2, …, xn
then it follows that the universal quantification ∀xP(x) is the same as
the conjunction of P(x1) ∧ P(x2) ∧ … ∧ P(xn) as it is true if and only if
P(x1), P(x2), …, P(xn) are all true
The Existential Quantifier
• Many mathematical statements assert that there is an element with a
certain property
• Such statements are expressed using existential quantification
• The existential quantification of P(x) is the proposition
“There exists an element x in the domain such that P(x)”
• It is denoted by ∃xP(x)
read as “There is at least one x such that P(x)”
The Existential Quantifier
• Example 1
• Let P(x) be the statement x>12
• Then we can say ∃xP(x) is True
• Example 2
• Let Q(x):x=x+1
• Then we can say ∃xQ(x) is False
The Existential Quantifier
• Another example
• Let T(x):x2>10 with domain being a positive integer not exceeding 4
• Then there exist x=4 for which x2=16
• Hence, x2>10 exists
• So, ∃xT(x) is true with the given domain
• When all the elements in the domain can be listed say, x1, x2, …, xn
then it follows that the existential quantification ∃xP(x) is the same as
the disjunction of P(x1) ∨ P(x2) ∨ … ∨ P(xn) as it is true if and only ifat
least one of P(x1), P(x2), …, P(xn) is true
Quantifiers: What to understand?

Statement When True? When False?

∀x P(x) P(x) is true for every x There is an x for which P(x) is false

∃x P(x) There is an x for which P(x) is true P(x) is false for every x
Other Quantifiers: Uniqueness Quantifier
• There is no limitation on the number of different quantifiers we can
define
• For example: “there exist exactly two” or “ there are no more than
five”
• One common such quantifier is Uniqueness Quantifier
• Denoted by ∃!xP(x) (or, ∃|xP(x)) which depicts the meaning that “there exists
a unique x such that p(x) is true”
• We can use any type of quantifiers as per our need
• But commonly, only Universal and Existential Quantifiers are used
Quantifiers with Restricted Domain
• An abbreviated notation is often used to restrict the domain of a
quantifier
• In this notation, a condition, a variable must satisfy is included after
the quantifier
Quantifiers with Restricted Domain: Examples
• ∀x<0 (x2>0)
• It means, for all x less than zero, the square of x is greater than zero
• In other words, for all negative number x, the square of x is positive
• It can also be written as ∀((x<0)à(x2>0))
• ∀y≠0 (y3≠0)
• Describe in words
• ∃z>0(z2=2)
• It means that there exists a real number z with value greater than zero such
that z2=2
• That value exists at 1.41…
• It can also be written as ∃((z>0)∧(z2=2))
Precedence of Quantifiers
• ∀ and ∃ have higher precedence than all logical operators from
propositional calculus
Binding Variables
• When a quantifier is used on the variable x, we say that this
occurrence of the variable is bound
• An occurrence of a variable that is not bound by a quantifier or set
equal to a particular value is said to be free
• All the variables that occur in a propositional function must be bound
or set equal to a particular value to turn it into a proposition
• This can be done using a combination of universal quantifiers,
existential quantifiers and value assignment
Binding Variables: Example
• Let ∃x(x+y=0) be a statement
• Then the variable x is bound to the existential quantifier ∃x
• But the variable y is free as it is not bound to a quantifier and no
value is assigned to it
Logical Equivalences involving Quantifiers
• Statements involving predicates and quantifiers are logically
equivalent if and only if they have the same truth values no matter
which predicates are substituted into these statements and which
domain of discourse is used for the variables in these propositional
functions
Negating Quantified Expression
• ¬(∀x P(x)) ≡ ∃x ¬P(x)
• ¬(∃x P(x)) ≡ ∀x ¬P(x)
• These are the De Morgan’s Law for Quantifiers
Example
• There is an honest politician
• H(x) : x is honest
• Let politician be the domain
• Then, ∃x H(x)
• Negate this statement
• ¬∃x H(x) ≡ ∀x ¬H(x)
• It means that for every x being a politician, no one of them is honest
Practice
• What are the negations of the statement
∀x(x2>x)
• Show that ¬∀x (P(x)àQ(x)) and ∃x ((P(x) ∧ ¬Q(x)) are logically
equivalent
Practice
• What are the negations of the statement
∀x(x2>x)
• Answer: ∃x(x2≤x)
• Show that ¬∀x (P(x)àQ(x)) and ∃x ((P(x) ∧ ¬Q(x)) are logically
equivalent
• L.H.S.= ¬∀x (P(x)àQ(x))
≡ ∃x ¬ (P(x)àQ(x)) {Using De Morgan’s law for Quantifiers}
≡ ∃x ¬ (¬P(x) ∨ Q(x)) {As, PàQ ≡ ¬P∨Q}
≡ ∃x ((P(x) ∧ ¬Q(x)) {Using De Morgan’s law for proposition and double
negation}
≡ R.H.S.
Translating from English to Logical Expression
• Example: Every Student in this class has studied English
• It is equivalent to
“For every student x in this class, x has studied English”
• It can be written as
• ∀x P(x) where, P(x): x has studied English with student of this class being the
domain
• ∀x Q(x, this class) where, Q(x,y): x is the student of y class and studied the
English with domain of x is student and y being the classes in the college
• For every student x, if x is in this class then x has studied english
∀x (Q(x)àP(x)) where, P(x): x has studied English and Q(x): x is student of this
class
• ∀x F(x, English, This class) where, F(x, y, z): x is student of z class and has
studied y
Exercise
• Pg 53
• Q. 1-11, 19-29, 32-34, 37- 44
Reference Books
• Keneth Rosen, Discrete Mathematical Structures with Applications to
Computer Science, WCB/ McGraw Hill
• G. Birkhoff, T.C. Bartee, Modern Applied Algebra, CBS Publishers.
• R. Johnsonbaugh, Discrete Mathematics, Prentice Hall Inc.
• G.Chartand, B.R.Oller Mann, Applied and Algorithmic Graph Theory,
McGraw Hill
• Joe L. Mott, Abrahan Kandel, and Theodore P. Baker, Discrete
Mathematics for Computer Scientists and Mathematicians, Prentice-
Hall of India
Let us Discuss
Any Issues?
Thank You

You might also like