Lecture Notes 1
Lecture Notes 1
• Mathematical Arguments:
– Construct and understand precise mathematical reasoning.
• Statement Precision:
– Give exact meanings to mathematical statements.
• Valid Argument Rules:
– Apply rules to distinguish between valid and invalid arguments.
• Applications:
– Essential in circuit design, programming, verification, AI, etc.
1
Proposition
2
• Proposition as a Statement:
– A proposition is also referred to as a statement.
• Truth Values:
– If a proposition is true, its truth value is "true" (T).
– If a proposition is false, its truth value is "false"
(F).
– Alternately, denoted by the letters T and F, or 1
and 0.
3
Examples
• Grass is green:
– Statement (or proposition)
– Truth value: T
• 4 + 2 = 7:
– Proposition
– Truth value: F (because 4 + 2 is 6, not 7)
• x+z=10:
is not a proposition. The expression "x + z = 10" is not considered a proposition because it is
an equation, not a declarative statement that can be evaluated as either true or false.
4
Not Propositions
• "x + 2 is positive."
– Not a proposition.
– The truth of the statement depends on the specific value of x. It is true
when x is a negative number and false when x is non-negative. This
makes the truth value vague or dependent on the particular value of
x.
• "x + y = 12."
– Not a proposition.
– Similar to the previous example, this is an equation involving variables
x and y. Its truth or falsity depends on the values assigned to x and y.
Therefore, it is not a statement with a definite truth value.
5
Logical operators
• Simple vs. Compound Statements:
– Simple statements can be used to build compound statements.
• Negation Operator ( ¬ ):
– Denoted as ¬ P.
– Represents the negation of a given proposition.
• Conjunction (AND, ^):
– Denoted as P ^ Q.
– True only when both P and Q are true.
• Disjunction (OR, ∨):
– Denoted as P ∨ Q.
– True when at least one of P or Q is true.
6
Logical operators
• Conditional Statement (->):
– Denoted as P -> Q.
– Represents "if P, then Q."
• Biconditional Statement (↔):
– Denoted as P ↔ Q.
– True when both P and Q have the same truth value.
• Exclusive Or (⊕):
– Denoted as P ⊕ Q.
– True when either P or Q is true, but not both.
7
Logical operators
• “3 + 2 = 5” and “The grass is green”:
– Conjunction (AND)
– True only if both statements are true.
• “The grass is green” or “It is hot today”:
– Disjunction (OR)
– True if at least one of the statements is true.
• “Discrete Mathematics is not difficult to me”:
– Negation ( ¬ )
– Represents the opposite of the statement.
8
Logical operators
9
Negation
10
LOGICAL CONJUNCTION ()
11
LOGICAL DISJUNCTION () or INCLUSIVE OR
12
Example
• p: "Alex is happy"
• q: "Alex is wealthy"
• r: "Alex is successful"
• Translate the compound statements to symbolic form:
• Alex is happy and wealthy but not successful. (p∧q)∧(∼r)
• Alex is not wealthy but he is happy and successful.
– (~q) AND (p AND r)
• Alex is neither happy, wealthy nor successful.
– (~p) AND (~q) AND (~r)
13
Example
• Write the truth table for
~pq
14
LOGICAL EQUIVALENCE
• Two statements are called logically
equivalent, denoted by , if they have
identical truth values for all possible truth
values for their statement variables.
15
Example
• Double Negation ~(~p) p
16
Example
• Show that ~(pq) and ~p ~q are not logically
equivalent
17
Exclusive Or
19
Conditional statement pq
if p, then q p implies q
if p, q p only if q
p is sufficient for q a sufficient condition for q is p
q if p q whenever p
q when p q is necessary for p
a necessary condition for p is q q follows from p
q unless ┐ p
21
Example
• If Sophia learns discrete mathematics, then she
will find a good job.
• Sophia will find a good job when she learns
discrete mathematics (q when p).
• For Sophia to get a good job, it is sufficient for
her to learn discrete mathematics (sufficient
condition for q is p).
• Sophia will find a good job unless she does not
learn discrete mathematics (q unless not p).
22
Converse, contrapositive and
inverse
• For conditional statement p q
– Converse: q p
– Contrapositive: ┐q ┐ p
– Inverse: ┐p ┐ q
• Contrapositive and conditional statement are
equivalent
23
Converse, contrapositive and
inverse
• Suppose we start with the conditional statement: "If you
water the plants daily, then they will grow."
• The converse is: "If the plants are growing, then you watered
them daily."
• The contrapositive is: "If the plants are not growing, then you
did not water them daily."
• The inverse is: "If you did not water the plants daily, then the
plants are not growing."
24
Remark
• Contrapositive of Contrapositive:
– The contrapositive of the contrapositive is the original statement.
• Inverse of Inverse:
– The inverse of the inverse is the original statement.
• Converse of Converse:
– The converse of the converse is the original statement.
• Contrapositive of Inverse:
– The contrapositive of the inverse is the converse.
• Converse of Contrapositive:
– The converse of the contrapositive is the inverse.
• Inverse of Contrapositive:
– The inverse of the contrapositive is the converse.
• Inverse of Converse:
– The inverse of the converse is the contrapositive.
25
Biconditional statement
27
Precedence of logical operators
When combining multiple logical
operators in a statement,
operations with higher
precedence are evaluated first.
Parentheses can be used to
override the default precedence
and clarify the intended order of
operations.
28
Bit Strings
29
Logic Gates
30
Logic Gates
31
Logic Gates
32
Combinatorial Circuits
33
Combinatorial Circuits
• Build a digital circuit that produces the output
(p ∨ ¬ r) ∧ ( ¬ p ∨ (q ∨ ¬ r)) when given input
bits p, q, and r.
34
The island of knights and knaves
There is a wide variety of puzzles about an island in which
certain inhabitants called "knights" always tell the truth,
and others called "knaves" always lie. It is assumed that
every inhabitant of the island is either a knight or a knave.
35
Example
According to this old problem, three inhabitants—A, B, and C—
stood together in a garden. A stranger passed by and asked A,
"Are you a knight or a knave?" A responded, albeit unclearly,
leaving the stranger unable to understand the answer. The
stranger then turned to B and asked, "What did A say?. In
reply, B stated, "A declared that he is a knave." At this point,
the third man, C said
"Don't believe B; he is lying!"
36
Answer
Neither a knight nor a knave would declare, "I'm a knave,"
as a knight avoids making false statements about being a knave,
and a knave wouldn't truthfully state being a knave.
Consequently, A never stated that he was a knave.
Hence, when B asserted that A claimed to be a knave, B lied,
establishing B as a knave. Given that C correctly identified
B's lie and B indeed lied, C told the truth, establishing
C as a knight.
37
Example
Suppose the stranger, instead of asking A what he is, asked A,
"How many knights are among you?" Again A answers
indistinctly. So the stranger asks B, "What did A say? B replies,
"A said that there is one knight among us."
Then C says, "Don' t believe B; he is lying!"
38
Answer
Firstly, B and C must be of opposite types since B contradicts C.
Therefore, one is a knight, and the other is a knave.
39
Example
Again we have three people, A, B, C, each of whom
is either a knight or a knave.
A and B make the following statements:
A: All of us are knaves.
B: Exactly one of us is a knight.
40
Answer
To begin with, A must be a knave, because if he were a knight, then it would be true that
all three are knaves and hence that A too is a knave. If A were a knight he would have to
be a knave, which is impossible. So A is a knave. Hence his statement was false, so in
fact there is at least one knight among them.
Now, suppose B were a knave. Then A and B would both be knaves, so C would be a
knight (since there is at least one knight among them). This would mean that there was
exactly one knight among them, hence B's statement would be true. We would thus have
the impossibility of a knave making a true statement. Therefore B must be a knight. We
now know that A is a knave and that B is a knight. Since B is a knight, his statement is
true, so there is exactly one knight among them. This knight must be B, hence C must be
a knave.
41
Example (5 inhabitants)
42
5 inhabitant Solution
• Use symbolic form to create a huge logic
table! Connect these
Statements by using “and”.
43
Further Examples
44
Example
• Construct the truth table for ~ p (q ~
r)
45
Example
• Construct the truth table for (pq) ~ (pq)
46
Example:
47
Example
• If you pass the course, then you must have obtained at least
50.
• Getting at least 50 is necessary for passing the course.
• You will not pass the course unless you get at least 50.
• You will pass the course only if you get at least 50.
• A necessary condition for passing the course is getting at least
50.
• Getting at least 50 is a sufficient condition for passing the
course.
48
Example
• Let p and q be propositions:
p = “you get an A on the final exam”
q = “you do every exercise in this book”
r = “you get an A in this class”
p r : To get an A in this class it is necessary for you to get an A
on the final.
p q r: You do every exercise in this book and You get an A on
the final, imply, you get an A in the class.
49
Example
Let p, q, and r be the propositions:
p = “you have the flu”
q = “you miss the final exam”
r = “you pass the course”
~q r: If you don’t miss the final exam, you will
pass the course.
~p ~q r: If you neither have flu nor miss the final
exam, then you will pass the course.
50
Example
• Construct a truth table for the statement
p~q~p
51
Example
• Construct a truth table for the statement form
(pq)(~ p r)
52
Example
• Original Statement: "If the store is open, then
the lights are on."
• Inverse: "If the store is closed, then the lights
are not on."
• Contrapositive: "If the lights are not on, then
the store is closed."
• Converse: "If the lights are on, then the store
is open."
53
Truth table of compound propositions
54
Example of translating English to
logical expressions
You can borrow books from the library only if
you are a literature major or you are not a
junior.
p:"You can borrow books from the library"
q:"You are a literature major"
r:"You are a junior"
( q v ┐r ) p
55
4 inhabitant Problem
Solution:
57