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

Lecture Notes 1

The document provides an overview of propositional logic, including definitions of propositions, truth values, logical operators, and their applications in various fields. It explains the structure of logical statements, including conjunctions, disjunctions, conditionals, and biconditionals, along with examples and truth tables. Additionally, it discusses logical equivalences and introduces puzzles involving knights and knaves to illustrate logical reasoning.

Uploaded by

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

Lecture Notes 1

The document provides an overview of propositional logic, including definitions of propositions, truth values, logical operators, and their applications in various fields. It explains the structure of logical statements, including conjunctions, disjunctions, conditionals, and biconditionals, along with examples and truth tables. Additionally, it discusses logical equivalences and introduces puzzles involving knights and knaves to illustrate logical reasoning.

Uploaded by

kaanaydin1441
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 57

Propositional logic

• 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

• Definition: A declarative sentence that is either true or false, but not


both.
• Examples:
– Washington, D.C., is the capital of the USA. (Proposition)
– California is adjacent to New York. (Proposition)
– 1 + 1 = 2. (Proposition)
– 2 + 2 = 5. (Proposition)
– "What time is it?" (Not a Proposition)
– "Read this carefully." (Not a 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

• Original Statement: “At least 10 inches of rain fell today in Miami”


– Negation: It is not the case that at least 10 inches of rain fell today in
Miami.
• Original Statement: “It is not the case that at least 10 inches of rain fell
today in Miami”
– Negation: At least 10 inches of rain fell today in Miami.

10
LOGICAL CONJUNCTION ()

Conjunction: p^q is true when both p and q are true.


It is false otherwise

11
LOGICAL DISJUNCTION () or INCLUSIVE OR

Disjunction: p v q is false when both p and q are


false. True otherwise

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
~pq

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

• So by the logical equivalence we have


~(~p)  p

16
Example
• Show that ~(pq) and ~p  ~q are not logically
equivalent

17
Exclusive Or

Exclusive Or is true when exactly one of p, q


is true. False otherwise
18
Conditional statement
(implication)
• p is called the premise
(or antecedent) and q is
called the conclusion (or
consequent)
• p is the condition or
statement assumed to
be true.
• q is the statement that
follows as a result of p.
• p q is false when p is
true and q is false. True
otherwise

19
Conditional statement pq
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

Conditional Statement: pq is false when p is true and q is


false. True otherwise
20
Conditional statement pq
• p only if q:
– p cannot be true when q is not true
– The statement is false if p is true but q is
false
– When p is false, q may be either true or false
– Not to use “q only if p” to express pq
• q unless ┐ p
– If ┐ p is false, then q must be true
– The statement is false when p is true but q is
false, but the statement is true otherwise

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

• Biconditional Statement: “p if and only if q”


• p ↔ q is true when p, q have the same truth
value. False otherwise
• Also known as bi-implications
26
Example
• p: “you can take the flight”, q: “you buy a
ticket”
• p ↔ q: “You can take the flight if and only if
you buy a ticket”
– This statement is true
• If you buy a ticket and take the flight
• If you do not buy a ticket and you cannot take the flight

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

• A bit string is a sequence of 0 s and 1 s. The


length of this string is the number of bits in
the string.

29
Logic Gates

30
Logic Gates

31
Logic Gates

32
Combinatorial Circuits

Combinatorial circuits are digital circuits that generate


outputs solely based on current input values,
lacking internal memory or feedback.

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!"

What are B and C?

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.

Therefore, B is a knave, and C is a knight.


It is impossible to know what A is.

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!"

What are B and C?

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.

Now, if A were a knight, there would be two knights present,


and A wouldn't have lied by stating there was only one.

On the other hand, if A were a knave, it would be true that


there was exactly one knight present. Still, as a knave,
A couldn't have made that true statement. Consequently,
A could not have asserted that there was one knight among them.
Therefore, B falsely reported A's statement,
establishing B as a knave and C as a knight.

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.

What are A, B and C?

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.

• Thus the answer is that A is a knave, B is a knight, and C is 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 (pq)  ~ (pq)

46
Example:

•It is necessary to walk 8 miles to get to the top of the Peak.


•If you get to the top of the Peak, then you must have walked 8 miles.
•Walking 8 miles is necessary to get to the top of the Peak.
•A sufficient condition for walking 8 miles is getting to the top of the Peak.
•Getting to the top of the Peak is sufficient for having walked 8 miles.

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
(pq)(~ 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:

Use “and” and connect the statements.


(A ↔(~B->~D)) (B ↔(~C ∨D)) (C ↔(B ∨~A))
And find the row of truth table containing T. 56
4 inhabitant Solution

57

You might also like