DM Lecture 5
DM Lecture 5
Lecture 5
Applications of Logic
2
Todays Lecture Outline
• Basics of Boolean Algebra
• Decimal and Binary numbers
• Predicates & Set Notation
• Implicit Qualification
• Negations of Universal and Existential statements
Equivalent Circuits
Following is the circuit representations of the statement
[(P∧ ∼Q) ∨ (P ∧ Q)] ∧ Q
Equivalent Circuits
a. ∼P ≡ P ↓ P
b. P ∨ Q ≡ (P ↓ Q) ↓ (P ↓ Q)
c. P ∧ Q ≡ (P ↓ P) ↓ (Q ↓ Q)
b. (P ↓ Q) ↓ (P ↓ Q)
Decimal representations
More generally, decimal notation is based on the fact that any positive
integer can be written uniquely as a sum of products of the form
d ·10n
where each n is a nonnegative integer and each d is one of the decimal
digits 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9. The word decimal comes from the Latin
root deci, meaning “ten.”
Boolean Algebra
27 = 16 + 8 + 2 + 1
= 1·24 + 1·23 + 0·22 + 1·21 + 1·20.
Boolean Algebra
Any integer can be represented uniquely as a sum of products of the form
d ·2n
where each n is an integer and each d is one of the binary digits (or bits) 0
or 1.
Converting binary to decimal
Represent 110101 in decimal notation.
Addition in Binary Notation
Add 11012 and 1112 using binary notation.
Solution: Because 210 = 102 and 110 = 12, the translation of 110 +
110 = 210 to binary notation is
Truth Set
If P(x) is a predicate and x has domain D, the truth set of
P(x) is the set of all elements of D that make P(x) true
when substituted for x. The truth set of P(x) is denoted by
Example
Let P(x) = x is a factor of 8, Q(x)= x is a factor of 4
and R(x)= x < 5 and . The domain of x is
assumed to be . Use symbols , to indicate
true relationships among P(x), Q(x) and R(x).
Hence is false.
Existential Quantifier
Let Q(x) be a predicate and D the domain of
x. An existential statement is of the form.
such that
It is true if and only if Q(x) is true for at least
one x in D. It is false if and only if Q(x) is
false for all x in D.
The symbol denotes “there exist” and is
called the existential quantifier.
Truth and falsity of Existential statements
Suppose P(x) is the predicate “x < |x|.” Determine the
truth value of ∃ x s.t. P(x) where the domain for x is:
(a) the three numbers 1, 2, 3.
(b) the six numbers −2,−1, 0, 1, 2, 3.
Solution
(a) P(1), P(2), and P(3) are all false because in each
case x = |x|. Therefore, ∃ x such that P(x) is false for
this domain.
(b) If we begin checking the six values of x, we find
P(−2) is true. It states that −2 < |−2|. We need to check
no further; having one case that makes the predicate
true is enough to guarantee that ∃ x s.t. P(x) is true.
Truth and falsity of Existential statements
Solution
The statement ∃ x (F(x)∧T (x, Discrete)) says that there
is a student x with two properties: x is a freshman and x
is taking Discrete. In English, “Some Freshman is taking
Discrete Math.”
Translating from informal Language to Formal language
“Every freshman at the College is taking MATH3901.”
Solution: There are various ways to answer this question,
depending on the domain.
• If we take as our domain all freshmen at the College
and use the predicate T (x) : “x is taking MATH3901”,
MATH3901;”
∀x, (F(x) → T (x)).
Note that we cannot say ∀ x (F(x) ∧ T (x)), because this
says that every student is a freshman, which is not
Cont…..
“Every freshman at the College is taking some Computer
Science course.”
∀x ∃y T(x, y).
Universal Conditional Statements
A reasonable argument can be made that the most
important form of statement in mathematics is the
universal conditional statement:
∀ x, if P(x) then Q(x)
Example: “Everyone who visited France stayed in
Paris.”
Sol: However, if we take all people as the universe ,
then we need to introduce the predicate F(x) for “x
visited France.” and P(x) is the predicate “x stayed in
Paris.” In this case, the proposition can be written as
∀ x, (F(x) → P(x)).
• We can write the following statements in a
variety of informal ways.
if then
Sol:
• if a real number is greater then 2, then the
square is greater than 4.
• Whenever a real number is greater then 2,
its square is greater than 4.
• The squares of real number, greater than 2,
are greater than 4.
Exercise
Rewrite the following statements in the form
∀ ,if then .
Sol: a).
Can be rewritten as
∀x, if x is in D then Q(x).
Contd.
The following statements are equivalent
∀ polygons P, if P is square, then P is a rectangle.
And
∀ squares P, P is a rectangle
• Implicit Qualification
• Negations of Universal and Existential statements