Discrete Structure Chapter 2.1- Logic Circuits-29
Transcript of Discrete Structure Chapter 2.1- Logic Circuits-29
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
1/29
Predicate Calculus
Predicate
Universal Quantifier
Existential Quantifier
De Morgans Laws
Other Rules for Quantifiers
Analogy Between Sets and Statements
SSK3003 Discrete Structures 1
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
2/29
Predicate
An open sentence p(x) is a declarative sentence
that becomes a statement whenxis given a
particular value chosen from a universe of
values. An open sentence is also known as a
predicate.
SSK3003 Discrete Structures 2
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
3/29
Example Predicate
Letp(x) = Ifx> 4, thenx+ 10 > 14 be an open sentence.
Letx U, where U= {1, 2, 3, 4, }. Find the truth value of
each statement formed when these values are substituted for
xinp(x).
p(1) is TRUE because 1 > 4 is FALSE.
p(2) is TRUE because 2 > 4 is FALSE.p(3) is TRUE because 3 > 4 is FALSE.
SSK3003 Discrete Structures 3
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
4/29
Example Predicate (2)
p(x) = Ifx> 4, thenx+ 10 > 14
p(4) is TRUEbecause 4 > 4 is FALSE.
p(5) is TRUEbecause 5 > 4 and 5 + 10 > 14
are TRUE.
p(6) is TRUEbecause 6 > 4 and 6 + 10 > 14
are TRUE.
In fact,p(x) is TRUEfor all values ofxU.
SSK3003 Discrete Structures 4
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
5/29
Universal Quantifier
The statement
For allx U,p(x)
is symbolized by
xUp(x).
The above statement is TRUE if and only ifp(x) is TRUE for every
x U.
The symbolis called the universal quantifier.
SSK3003 Discrete Structures 5
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
6/29
Example: Universal Quantifier
Let U= {1, 2, 3, 4, 5, 6}. Determine the truth value of the
statement
xU[(x4)(x8) > 0].
Letp(x) = (x4)(x8) > 0.
p(1) is TRUE because (1 4)(18) > 0 is TRUE.
p(2) is TRUE because (2 4)(28) > 0 is TRUE.
p(3) is TRUE because (3 4)(38) > 0 is TRUE.
SSK3003 Discrete Structures 6
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
7/29
Example: Universal Quantifier
(2)
p(x) = (x4)(x8) > 0.
p(4) is FALSEbecause (4 4)(48) > 0 is FALSE.
Therefore, the statement
xU[(x4)(x8) > 0]
is FALSEbecause 4 Uandp(4) is FALSE.
SSK3003 Discrete Structures 7
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
8/29
Existential Quantifier
The statement
There exists anxUsuch thatp(x)
is symbolized by
xUp(x).
The above statement is TRUE if and only there is at
least one elementxUsuch thatp(x) is TRUE.The symbol is called the existential quantifier.
SSK3003 Discrete Structures 8
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
9/29
Example: Existential Quantifier
Let U= {1, 2, 3, 4, 5, 6, 7, 8}. Determine the truth value of
xU[(x3)(x+ 2) = 0].
Letp(x) = (x3)(x+ 2) = 0.
p(1) is FALSE because (1 3)(1 + 2) = 0 is FALSE.
p(2) is FALSE because (2 3)(2 + 2) = 0 is FALSE.
p(3) is TRUE because (3 3)(3 + 2) = 0 is TRUE.
SSK3003 Discrete Structures 9
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
10/29
Example: Existential Quantifier
(2)
Therefore, the statement
xU[(x3)(x+ 2) = 0]
is TRUEbecause we found 3 Usuch thatp(3) isTRUE.
SSK3003 Discrete Structures 10
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
11/29
De Morgans Laws
The rules for the negation of quantified
statements are
~[xUp(x)][x U ~p(x)]
~[x Up(x)] [x U~p(x)].
These rules are called De Morgans laws.
SSK3003 Discrete Structures 11
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
12/29
Example De Morgans Laws
Write the negation of
a) All university students like football.
b) There exists a university student whodoes not like football.
b) There is a mathematics textbook that is both
short and clear.
c) Every mathematics textbook is either not
short or not clear.
SSK3003 Discrete Structures 12
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
13/29
Other Rules for Quantifiers
Other rules for statements containing
quantifiers are
~[xyp(x,y)]xy [~p(x,y)]~[xyp(x,y)]xy [~p(x,y)]
~[xyp(x,y)]x y[~p(x,y)]
~[xyp(x,y)]x y[~p(x,y)]
xyp(x,y)yxp(x,y)xyp(x,y)yxp(x,y)
xyp(x,y)yxp(x,y)
SSK3003 Discrete Structures 13
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
14/29
Example: Other Rules for
Quantifiers
Let Ufor both variables be the nonnegative
integers 0, 1, 2, 3, 4, . Determine the truth
value of
a) xy[2x= y]
b) yx[2x= y]
SSK3003 Discrete Structures 14
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
15/29
Example:Other Rules for
Quantifiers (a)
a)xy[2x= y]
b)The statement says that for every nonnegative
integerx, there is a nonnegative integer ysuchthat 2x= y. This is TRUEbecause, once having
chosen any nonnegative numberx, we can let y
be the double ofx.
SSK3003 Discrete Structures 15
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
16/29
Example Other Rules for
Quantifiers (b)
b)yx[2x= y]
The statement says that there exists a
nonnegative integer ysuch that, for allnonnegative integersx, 2x= y. For it to be TRUE,
we would need to find a specific value of ythat
can be fixed and for which, no matter what
nonnegative integerxwe choose, 2x= y. Since
this is not possible, the statement is FALSE.
SSK3003 Discrete Structures 16
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
17/29
Analogy Between Sets and
Statements
Letp(x) = xS, and q(x) = xT. Then
SSK3003 Discrete Structures 17
Union: x[xSTp(x) v q(x)]
Intersection: x[xSTp(x) ^ q(x)]
Complement:x[xS ~ p(x)]
Symmetric Difference:x[xSTp(x) q(x)]
Subset (ST)x[p(x) q(x)]
Equal (S= T)x[p(x) q(x)]
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
18/29
Example: Sets and Statements
Let U= {1, 2, 3, 4, 5, 6}, let S= {x U:x< 3}, and let T= {x U:xdivides 6}.
Show S T.
We need to show that wherex S is TRUE then
x Tis TRUE.
By definition of S,x Sis TRUE if and only ifxis 1, 2, or 3.
However, 1, 2, and 3 all divide 6 sox Tis also TRUE.
Therefore, ST.
SSK3003 Discrete Structures 18
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
19/29
Summary Section
Statements containing variables are called
predicatesand can be made into logical
statements with quantifiers. The quantifiers are
the symbols (for all) and (there exists).
These symbols refer to the particular universal
set for the variables in the predicate.
SSK3003 Discrete Structures 19
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
20/29
Summary Section
Important rules of predicate calculus include
the following
~[xUp(x)] [x U ~p(x)]
~[xUp(x)][xU~p(x)]
x yp(x,y)y xp(x,y)
x yp(x,y)y xp(x,y)
x yp(x,y) y xp(x,y)
SSK3003 Discrete Structures 20
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
21/29
Logic Circuits
Logic Circuits
NOT, AND and OR Gates
NAN and NOR Gates
XOR Gate
SSK3003 Discrete Structures 21
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
22/29
Logic Circuits
Logic circuits can be found in computers,
telephones, digital clocks, and television sets
plus a great many more devices. In a logic circuitcurrent flows through gates to an output line.
The input current to the gate has only two states,
ON (1) or OFF (0). The output depends upon thetype of gate in the circuit.
SSK3003 Discrete Structures 22
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
23/29
NOT, AND and OR Gates
SSK3003 Discrete Structures 23
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
24/29
Example NOT, AND and OR Gates
Draw a logic circuit for three inputs,p, q, and r
and output (~p) (q r).
We will begin with the ANDgate.
SSK3003 Discrete Structures 24
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
25/29
Example NOT, AND and OR Gates
(2)
Next we will add in the ORand NOTgates.
SSK3003 Discrete Structures 25
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
26/29
Example Logical Statement (2)
SSK3003 Discrete Structures 26
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
27/29
NAND and NOR Gates
SSK3003 Discrete Structures 27
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
28/29
XOR Gate
SSK3003 Discrete Structures 28
-
8/10/2019 Discrete Structure Chapter 2.1- Logic Circuits-29
29/29
Summary Section
Logic circuits contain NOT, AND, OR, NAND, NOR
andXORgates.
Logic circuits frequently can be simplified
using the Table of Logical Equivalences.
SSK3003 Discrete Structures 29