SlideShare a Scribd company logo
A R Usmani
Skardu Gilgit-Baltistan
abdurrehmanusmani65@gmail.com
1Discret Structure for BSCS…… Prepared by Abdur-Rehman
Why is it
o “Discrete” (≠ “discreet”!) - Composed of distinct, separable parts.
o “Structures” - objects built up from simpler objects according to a definite pattern.
Why it is important
o Provides mathematical foundation for computer science courses such as
o data structures, algorithms, relational database theory, automata theory and
o formal languages, compiler design, and cryptography,
o Mathematics courses such as linear and abstract algebra, probability, logic and set
theory, and number theory.
What it does
o Describes processes that consist of a sequence of individual steps.
o Helps students to develop the ability to think abstractly.
ESSENTIAL TOPICS TO BE COVERED:
o Functions, relations and sets
o Basic logic
o Proof techniques
o Basics of counting
o Graphs and trees
o Recursion
Logic
o Crucial for mathematical reasoning
o Important for program design
o Used for designing electronic circuitry
o (Propositional )Logic is a system based on propositions.
o A proposition is a (declarative) statement that is either true or false (not both).
o We say that the truth value of a proposition is either true (T) or false (F).
2Discret Structure for BSCS…… Prepared by Abdur-Rehman
o Corresponds to 1 and 0 in digital circuits
The Statement/Proposition Game
“Elephants are bigger than mice.”
Is this a statement? Yes
Is this a proposition? yes
What is the truth value
of the proposition? true
The Statement/Proposition Game
“520 < 111”
Is this a statement? yes
Is this a proposition? yes
What is the truth value
of the proposition? False
The Statement/Proposition Game
“y > 5”
Is this a statement? yes
Is this a proposition? no
Its truth value depends on the value of y, but this value is not specified.
We call this type of statement a propositional function or open sentence.
The Statement/Proposition Game
“Today is January 27 and 99 < 5.”
Is this a statement? yes
Is this a proposition? yes
What is the truth value
of the proposition? False
The Statement/Proposition Game
“Please do not fall asleep.”
3Discret Structure for BSCS…… Prepared by Abdur-Rehman
Is this a statement? no
It’s a request.
Is this a proposition? no
Only statements can be propositions.
The Statement/Proposition Game
“If the moon is made of cheese,
then I will be rich.”
Is this a statement? yes
Is this a proposition? yes
What is the truth value
of the proposition? probably true
The Statement/Proposition Game
“x < y if and only if y > x.”
Is this a statement? yes
Is this a proposition? yes
… because its truth value does not depend on specific values of x and y.
What is the truth value
of the proposition? true
Combining Propositions
As we have seen in the previous examples, one or more propositions can be combined
to form a single compound proposition.
We formalize this by denoting propositions with letters such as p, q, r, s, and introducing
several logical operators or logical connectives.
Logical Operators (Connectives)
We will examine the following logical operators:
• Negation (NOT, )
• Conjunction (AND, )
4Discret Structure for BSCS…… Prepared by Abdur-Rehman
• Disjunction (OR, )
• Exclusive-or (XOR,  )
• Implication (if – then,  )
• Biconditional (if and only if,  )
Truth tables can be used to show how these operators can combine propositions to
compound propositions.
Negation (NOT)
Unary Operator, Symbol: 
P  P
true (T) false (F)
false (F) true (T)
Conjunction (AND)
Binary Operator, Symbol: 
P Q P Q
T T T
T F F
F T F
F F F
Disjunction (OR)
Binary Operator, Symbol: 
5Discret Structure for BSCS…… Prepared by Abdur-Rehman
P Q P  Q
T T T
T F T
F T T
F F F
Connectives
Let p=“It rained last night”,
q=“The sprinklers came on last night,”
r=“The lawn was wet this morning.”
Translate each of the following into English:
≦p = “It didn’t rain last night.”
r ∧ ¬p =“The lawn was wet this morning,
and it didn’t rain last night.”
¬ r ∨ p ∨ q =“Either the lawn wasn’t wet this morning, or it rained last night, or the sprinklers
came on last night.”
Connectives:
Let p= “It is hot”
q=““It is sunny”
1. It is not hot but it is sunny.
2. It is neither hot nor sunny.
Solution
1. ⌐p∧q
2. ⌐p∧ ⌐q
Exclusive Or (XOR)
6Discret Structure for BSCS…… Prepared by Abdur-Rehman
Binary Operator, Symbol: 
p = “I will earn an A in this course,”
q = “I will drop this course,”
p ⊕ q = “I will either earn an A in this course, or I will drop it (but not both!)”
True when exactly one of p and q is true and is false otherwise.0
P Q PQ
T T F
T F T
F T T
F F F
7Discret Structure for BSCS…… Prepared by Abdur-Rehman
Truth Table
o The truth value of the compound proposition depends only on the truth value of the component
propositions. Such a list is a called a truth table.
Example
o (pq) ¬(pq)
p q pq pq ¬(pq) (pq) ¬(pq)
T T T T F F
T F T F T T
F T T F T T
F F F F T F
Example
o (p  q)  ¬r
P q r pq ¬r (pq)¬r
T T T
T T F
T F T
T F F
F T T
F T F
F F T
8Discret Structure for BSCS…… Prepared by Abdur-Rehman
Implication (if - then) 
o The conditional statement p → q is the proposition “if p, then q.”
o The conditional statement p → q is false when p is true and q is false, and true otherwise.
o p is called the hypothesis and q is called the conclusion.
Implication (if - then) 
p = “You study hard.”
q = “You will get a good grade.”
p → q = “If you study hard, then you will get a good grade.”
P Q PQ
T T T
T F F
F T T
F F T
Biconditionals (if and Only If) 
p = “Sharif wins the 2012 election.”
q = “Sharif will be prime minister for five years.”
p ↔ q = “If, and only if, Sharif wins the 2012 election, Sharif will be prime minister for five years.”
p ↔ q does not imply that p
and q are true, or that
either of them causes the other, or that they have a
common cause.
9Discret Structure for BSCS…… Prepared by Abdur-Rehman
Precedence of Logical Connectives
o ~ highest
o Ʌ second highest
o V third highest
o → fourth highest
o ↔ fifth highest
Logical Equivalence
1. 6 is greater than 2
2. 2 is less than 6
two different ways of saying the same thing.
both be true or both be false.
logical form of the statements is important.
3. p ∧ q is true when, and only when, q ∧ p is true.
4. The statement forms are called logically equivalent
Logical Equivalence
10Discret Structure for BSCS…… Prepared by Abdur-Rehman
o Two statement forms are called logically equivalent if, and only if, they have identical truth values for
each possible substitution of statements for their statement variables.
o P ≡ Q.
o Negation of the negation of a statement is logically equivalent to the statement.
o ∼(∼p) ≡ p
o ∼(p ∧ q) and ∼p ∧ ∼q are not logically equivalent
o p =“0 < 1” and let q =“1 < 0.”
Logical Equivalence
11Discret Structure for BSCS…… Prepared by Abdur-Rehman
De Morgan’s Laws
o The negation of the conjunction of two statements is logically equivalent to the disjunction of their
negations.
o ∼(p ∧ q) and ∼p ∨ ∼q are logically equivalent i.e. ∼(p ∧ q) ≡ ∼p ∨ ∼q.
De Morgan’s Laws
o Negation of the disjunction of two statements is logically equivalent to the conjunction of their negations:
o Write negations for each of the following statements:
o John is 6 feet tall and he weighs at least 200 pounds.
o The bus was late or Tom’s watch was slow.
o Negation of these statements
o John is not 6 feet tall or he weighs less than 200 pounds.
o The bus was not late and Tom’s watch was not slow(/“Neither was the bus late nor was
Tom’s watch slow.”)
o Negation of a disjunction is formed by taking the conjunction of the negations of the component
propositions.
o Negation of a conjunction is formed by taking the disjunction of the negations of the component
propositions.
qpqp
qpqp


)(
)(
12Discret Structure for BSCS…… Prepared by Abdur-Rehman
o Frequently used in writing computer programs.
o For instance, suppose you want your program to delete all files modified outside a certain range
of dates, say from date 1 through date 2 inclusive.
o ∼(date1 ≤ file_modification_date ≤ date2)
o is equivalent to
o ( file_modification_date < date1) or (date2 < file_modification_date).
13Discret Structure for BSCS…… Prepared by Abdur-Rehman
Tautologies and Contradictions
A tautology is a statement that is always true.
Examples:
R(R)
(PQ)  (P)( Q)
A contradiction is a statement that is always false.
Examples:
R(R)
((P  Q)  (P)  (Q))
The negation of any tautology is a contradiction, and the negation of any contradiction is a tautology.
Equivalence
Definition: two propositional statements S1 and S2 are said to be (logically) equivalent, denoted S1  S2 if
They have the same truth table, or
S1  S2 is a tautology
Equivalence can be established by
Constructing truth tables
Using equivalence laws (Table 5 in Section 1.2)
Equivalence laws
Identity laws, P  T  P,
Domination laws, P  F  F,
Idempotent laws, P  P  P,
Double negation law,  ( P)  P
Commutative laws, P  Q  Q  P,
Associative laws, P  (Q  R) (P  Q)  R,
Distributive laws, P  (Q  R) (P  Q)  (P  R),
De Morgan’s laws,  (PQ)  ( P)  ( Q)
Law with implication P  Q   P  Q
14Discret Structure for BSCS…… Prepared by Abdur-Rehman
Associative Laws
(p ∨ q) ∨ r ≡ p ∨ (q ∨ r)
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r)
Simplifying Statement Forms
o ∼(∼p ∧ q) ∧ (p ∨ q) ≡ p
P q r pq (p ∧ q) ∧ r q ∧ r p ∧ (q ∧ r)
T T T T T T T
T T F T F F F
T F T F F F F
T F F F F F F
F T T F F T F
F T F F F F F
F F T F F F F
15Discret Structure for BSCS…… Prepared by Abdur-Rehman
CONVERSE, CONTRAPOSITIVE, INVERSE
o The proposition q → p is called the converse of p → q.
o A conditional statement and its converse are NOT logically equivalent.
o The proposition ¬p →¬q is called the inverse of p → q.
o A conditional statement and its inverse are NOT logically equivalent.
o If a conditional statement is true, then its converse and inverse must also be true. This is not correct!
o If Howard can swim across the lake, then Howard can swim to the island.
o Converse:
o If Howard can swim to the island, then Howard can swim across the lake.
o Inverse:
o If Howard cannot swim across the lake, then Howard cannot swim to the island.
o If today is Easter, then tomorrow is Monday.
o Converse: If tomorrow is Monday, then today is Easter.
o Inverse: If today is not Easter, then tomorrow is not Monday.
o The contrapositive of p → q is the proposition ¬q →¬p.
o A conditional statement is logically equivalent to its contrapositive!
16Discret Structure for BSCS…… Prepared by Abdur-Rehman
o If Howard can swim across the lake, then Howard can swim to the island.
o If today is Easter, then tomorrow is Monday.
o If Howard cannot swim to the island, then Howard cannot swim across the lake.
o If tomorrow is not Monday, then today is not Easter.
o The contrapositive of p → q is the proposition ¬q →¬p.
o A conditional statement is logically equivalent to its contrapositive!
o If Howard can swim across the lake, then Howard can swim to the island.
o If today is Easter, then tomorrow is Monday.
o If Howard cannot swim to the island, then Howard cannot swim across the lake.
o If tomorrow is not Monday, then today is not Easter.
Negations of If-Then Statements
If my car is in the repair shop, then I cannot get to class.
If Sara lives in Athens, then she lives in Greece.
o Negation
My car is in the repair shop and I can get to class.
Sara lives in Athens and she does not live in Greece.
o The negation of an if-then statement does not start with the word if.
17Discret Structure for BSCS…… Prepared by Abdur-Rehman
Simplifying Statement
“you are hardworking and the sun shines, or you are hardworking and it rains.”
p=“ you are hardworking “.
q=“the sun shines”
r= “it rains”
(p  q)  (p  r)  p (q r) using distributive law
“you are hardworking and the sun shines or it rains”
Translating English Sentences
“If the moon is out and it is not snowing, then Sam goes out for a walk.”
p=“Phyllis goes out for a walk”.
q=“The moon is out”
r= “It is snowing”
 If the moon is out and it is not snowing, then Sam goes out for a walk.
“If it is snowing and the moon is not out, then Sam will not go out for a walk.”
“You can access the Internet from campus only if you are a computer science major or you are not a freshman.”
a=“You can access the Internet from campus“.
c=“You are a computer science major”
pqr  )(
prq  )(
18Discret Structure for BSCS…… Prepared by Abdur-Rehman
f= “You are a freshman”
a → (c ∨¬f ).
o Let p, q, and r be the propositions:
p = “you have the flu”
q = “you miss the final exam”
r = “you pass the course”
o Express the following propositions as an English sentence.
o p → q
If you have flu, then you will miss the final exam.
o ~q → r
If you don’t miss the final exam, you will pass the course.
o ~p → ~q → r
If you neither have flu nor miss the final exam, then you will pass the course.
BICONDITIONALS
o If it is hot outside you buy an ice cream cone, and if you buy an ice cream cone it is hot outside.
You buy an ice cream cone if and only if it is hot outside.
o For you to win the contest it is necessary and sufficient that you have the only winning ticket.
You win the contest if and only if you hold the only winning ticket.
o If you read the news paper every day, you will be informed and conversely.
You will be informed if and only if you read the news paper every day.
o It rains if it is a weekend day, and it is a weekend day if it rains.
It rains if and only if it is a weekend day.
o The train runs late on exactly those days when I take it.
The train runs late if and only if it is a day I take the train.
o This number is divisible by 6 precisely when it is divisible by both 2 and 3.
This number is divisible by 6 if and only if it is divisible by both 2 and 3.
Predicate
o p=“is a student at Bedford College”
o q =“is a student at.”
• p & q are predicate symbols
19Discret Structure for BSCS…… Prepared by Abdur-Rehman
• p(x)=“x is a student at Bedford College.
• q(x,y) =“x is a student at y.”
 x and y are predicate variables that take values in appropriate sets.
• When concrete values are substituted in place of predicate variables, a statement results.
o A predicate is a predicate symbol together with suitable predicate variables.
o A predicate is a sentence that contains a finite number of variables and becomes a statement when
specific values are substituted for the variables.
o The domain of a predicate variable is the set of all values that may be substituted in place of the variable.
o Also referred as propositional functions or open sentences
Predicate(Example)
o Person(x), which is true if x is a person
o Person(Socrates) = T
o Person(dolly-the-sheep) = F
o Let U = Z, the integers = {. . . -2, -1, 0 , 1, 2, 3, . . .}
• P(x): x > 0 is the predicate. It has no truth value until the variable x is bound.
o Examples of propositions where x is assigned a value:
• P(-3) is false,
• P(0) is false,
• P(3) is true.
Truth Values of a Predicate
o P(x)=“x2 > x”
o Domain = set R of all real numbers
o Find truth values of P(2), P( 1/2 ), and P(−1/2 )
• P(2): 2
2
> 2, or 4 > 2. True
• P(1/2):(1/2)
2
<1/2 or (1/4) <1/2 False
• P(-1/2):(-1/2)
2
>-1/2 or (1/4) >-1/2 True
o 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 they are substituted for x. The truth set of P(x) is denoted
{x ∈ D | P(x)}
“the set of all x in D such that P(x).”
o Let R be the three-variable predicate R(x, y z): x + y= z
20Discret Structure for BSCS…… Prepared by Abdur-Rehman
o Find the truth value of
R(2, -1, 5), R(3, 4, 7), R(x, 3, z)
Universal Quantification
o To change predicates into statements is to assign specific values to all their variables.
if x represents the number 35, the sentence “x is divisible by 5” is a true statement since 35 = 5·
7.
o Another way is to add quantifiers.
Quantifiers are words that refer to quantities such as "some" or "all" and tell for how many
elements a given predicate is true.
o Let P(x) be a predicate (propositional function).
o Universally quantified sentence:
For all x in the universe of discourse P(x) is true.
o Using the universal quantifier  :
"  x ϵ D,Q(x).“ universal statement
It is defined to be true if, and only if, Q(x) is true for every x in D.
It is defined to be false if, and only if, Q(x) is false for at least one x in D.
A value for x for which Q(x) is false is called a counterexample to the universal statement.
o When all the elements in the universe of discourse can be listed —say x1, x2, ..., xn — it follows that the
universal quantification
o ∀x P(x) is the same as the conjunction
P(x1) ∧ P(x2) ∧ · · · ∧ P(xn)
o because this conjunction is true if and only if P(x1), P(x2), ...,P(xn) are all true.
o Example: Let the universe of discourse be U = {1,2,3}. Then
o ∀x P(x) ≡ P(1)∧ P(2)∧ P(3).
Truth and Falsity of Universal Statements
Sentence:
o All UAJ&K students are smart.
o Assume: the domain of discourse of x are UAJ&K students
o Translation:
o ∀ x Smart(x)
o Assume: the universe of discourse are students (all students):
21Discret Structure for BSCS…… Prepared by Abdur-Rehman
o ∀ x at(x, UAJ&K)  Smart(x)
o Assume: the universe of discourse are people:
o ∀ x student(x) Λ at(x, UAJ&K)  Smart(x)
o Let D = {1, 2, 3, 4, 5}, and consider the statement
∀x ∈ D, x
2
≥ x.
Show that this statement is true.
Check that “x
2
≥ x” is true for each individual x in D.
1
2
≥ 1, 2
2
≥ 2, 3
2
≥ 3, 4
2
≥ 4, 5
2
≥ 5.
Hence “∀x ∈ D, x
2
≥ x” is true.
The Existential Quantifier: ∃
o The symbol ∃ denotes “there exists” and is called the existential quantifier.
o “There is a student in Math 140” can be written as
∃ a person p such that p is a student in Math 140,
or, more formally,
∃p ∈ P such that p is a student in Math 140,
where P is the set of all people.
o At least one member of the group satisfy the property
o Let Q(x) be a predicate and D the domain of x. An existential statement is a statement of the form “∃x ∈ D
such that Q(x).” It is defined to be 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
o x in D:
o Let T(x) denote x > 5 and x is from Real numbers.
o What is the truth value of ∃ x T(x)?
o Answer:
o Since 10 > 5 is true. Therefore, it is true that ∃ x T(x).
o Consider the statement
∃m ∈ Z+ such that m
2
= m.
Show that this statement is true.
Observe that 1
2
= 1. Thus “m
2
= m” is true for at least one integer m. Hence “∃m ∈ Z
such that m
2
= m” is true.
o Assume two predicates S(x) and P(x)
22Discret Structure for BSCS…… Prepared by Abdur-Rehman
o Universal statements typically tie with implications
o All S(x) is P(x)
o ∀x ( S(x)  P(x) )
o No S(x) is P(x)
o ∀x( S(x)  ¬P(x) )
o Existential statements typically tie with conjunctions
o Some S(x) is P(x)
o ∃x (S(x)  P(x) )
o Some S(x) is not P(x)
o ∃x (S(x)  ¬P(x) )
Quantifiers:Example
o There exist an x such that x is black
o ∃xb(x) where b(x):x is black.
o |x|={
1. (∀x)(x
2
0) 2. (∀x)(|x| 0)
Nested quantifiers
o More than one quantifier may be necessary to capture the meaning of a statement in the predicate logic.
o Example:
Every real number has its corresponding negative.
Translation:
Assume:
a real number is denoted as x and its negative as y
A predicate P(x,y) denotes: “x + y =0”
Then we can write:
(∀x)(∃y)P(x,y)
o Translate the following English sentence into logical expression
“There is a rational number in between every pair of distinct rational numbers”
Use predicate Q(x), which is true when x is a rational number
x,y (Q(x)  Q (y)  (x < y)  u (Q(u)  (x < u)  (u < y)))
23Discret Structure for BSCS…… Prepared by Abdur-Rehman
Understanding Multiply Quantifiers
A college cafeteria line has four stations: salads, main courses, desserts, and beverages.
1. The salad station offers a choice of green salad or fruit salad.
2. The main course station offers spaghetti or fish;
3. The dessert station offers pie or cake;
4. The beverage station offers milk, soda, or coffee.
Three students, Uta, Tim, and Yuen, go through the line and make the following choices:
o Uta: green salad, spaghetti, pie, milk
o Tim: fruit salad, fish, pie, cake, milk, coffee
Yuen: spaghetti, fish, pie, soda
Understanding Multiply Quantifiers
a) ∃ an item I such that ∀ students S, S chose I .
b) ∃ a student S such that ∀ items I, S chose I .
c) ∃ a student S such that ∀ stations Z, ∃ an item I in Z such that S chose I .
d) ∀ students S and ∀ stations Z, ∃ an item I in Z such that S chose I .
a) ∃ an item I such that ∀ students S, S chose I .
b) ∃ a student S such that ∀ items I, S chose I .
c) ∃ a student S such that ∀ stations Z, ∃ an item I in Z such that S chose I .
d) ∀ students S and ∀ stations Z, ∃ an item I in Z such that S chose I .
24Discret Structure for BSCS…… Prepared by Abdur-Rehman
e) There is an item that was chosen by every student. This is true; every student chose pie.
f) There is a student who chose every available item. This is false; no student chose all nine items.
g) There is a student who chose at least one item from every station. This is true; both Uta and Tim chose at
least one item from every station.
h) Every student chose at least one item from every station. This is false; Yuen did not choose a salad.
Order of quantifiers
o The order of nested quantifiers matters if quantifiers are of different type
1. ∀ people x, ∃ a person y such that x cares y.
2. ∃ a person y such that ∀ people x, x cares y.
o ∀ x ∃ y C(x,y) is not the same as ∃y ∀ x C(x,y)
1. Given any person, it is possible to find someone whom that person cares,
2. whereas the second means that there is one amazing individual who is cared by all people.
o If one quantifier immediately follows another quantifier of the same type, then the order of the
quantifiers does not affect the meaning.
o Let Q(x, y, z) be the predicate:“x + y = z.”
o ∀x ∀y ∃z Q(x, y, z) True
1. “For all real numbers x and for all real numbers y there is a real number z such that x + y = z,”
o ∃z ∀x ∀y Q(x, y, z) False
1. “There is a real number z such that for all real numbers x and for all real numbers y it is true that
x + y = z,”
2. because there is no value of z that satisfies the equation x + y = z for all values of x and y.
25Discret Structure for BSCS…… Prepared by Abdur-Rehman
Bound and Free Variables
o Definitions: If a quantifier is used on the variable x, then this variable is bound.
o An occurrence of a variable that is not bound by a quantifier or set equal to a particular value is said to be
free.
o When all the variables that occur in a propositional function are bound or set to a particular value, then
the propositional function is a proposition.
Bound and Free Variables-Example
o Let P(x, y), the propositional function “x + y = 0”.
o The logical variables x and y are free and we cannot evaluate the truth value of P(x, y).
o If the value 3 is set to x, then x is no longer a free variable, but P(3, y) is still a propositional function
because y is still a free variable.
o If we apply the universal quantification to the variable y, the propositional function ∀y P(3, y) is now a
proposition. Both variables x and y are no longer free and the truth value of the proposition is false.
Negation of quantifiers
o ∼(∀x, if P(x) then Q(x)) ≡ ∃x such that P(x) and ∼Q(x).
1. ∀ people p, if p is blond then p has blue eyes.
∃ a person p such that p is blond and p does not have blue eyes.
1. If a computer program has more than 100,000 lines, then it contains a bug.
There is at least one computer program that has more than 100,000 lines and does not contain a bug.
26Discret Structure for BSCS…… Prepared by Abdur-Rehman
o ∼(∃x ∈ D such that Q(x)) ≡ ∀x ∈ D,∼Q(x).
o The negation of an existential statement (“some are”) is logically equivalent to a universal statement
(“none are” or “all are not”).
1. Some computer hackers are over 40.
No computer hackers are over 40 Or: All computer hackers are 40 or under
1. ∃ a triangle T such that the sum of the angles of T equals 200◦.
∀ triangles T, the sum of the angles of T does not equal 200◦.
o English statement:
It is not the case that all dogs are fleabags.
Translation: ¬ ∀ x Dog(x) Fleabag(x)
o Another way to express the same meaning:
There is a dog that is not a fleabag.
o Translation: ∃ x Dog(x)  ¬ Fleabag(x)
Logically equivalent to:
∃ x ¬ ( Dog(x)  Fleabag(x) )
o Conclusion: ¬ ∀ x P (x) is equivalent to ∃ x ¬ P(x)
(a) rewrite the statement formally
using quantifiers
and variables, and (b) write a
negation for the statement.
27Discret Structure for BSCS…… Prepared by Abdur-Rehman
.
Valid & Invalid Arguments
o Argument is a sequence of statements ending in a conclusion.
o Determination of validity of an argument depends only on the form of an argument, not on its content.
“If you have a current password, then you can log onto the network.”
p=“You have a current password”
q=“You can log onto the network.”
p → q
p
∴ q where ∴ is the symbol that denotes “therefore.”
o An argument is a sequence of statements, and an argument form is a sequence of statement forms(have
proposition var.).
o All statements in an argument and all statement forms in an argument form, except for the final one, are
called premises (or assumptions or hypotheses).
o The final statement or statement form is called the conclusion. The symbol ∴, which is read “therefore,” is
normally placed just before the conclusion.
o To say that an argument form is valid means that no matter what particular statements are substituted for
the statement variables in its premises, if the resulting premises are all true, then the conclusion is also
true. Conclusion q is valid, when (p1 ∧ p2 ∧ · · · ∧ pn) → q is a tautology.
o To say that an argument is valid means that its form is valid.
o The truth of its conclusion follows necessarily or by logical form alone from the truth of its premises.
o When an argument is valid and its premises are true, the truth of the conclusion is said to be
inferred or deduced from the truth of the premises.
o If a conclusion “ain’t necessarily so,” then it isn’t a valid deduction.
Testing an Argument Form for Validity
1. Identify the premises and conclusion of the argument form.
2. Construct a truth table showing the truth values of all the premises and the conclusion.
3. A row of the truth table in which all the premises are true is called a critical row.
If there is a critical row in which the conclusion is false, then it is possible for an argument of the
given form to have true premises and a false conclusion, and so the argument form is invalid.
If the conclusion in every critical row is true, then the argument form is valid.
Testing an Argument Form for Validity
28Discret Structure for BSCS…… Prepared by Abdur-Rehman
o p →q ∨ ∼r
o q → p ∧ r
o ∴ p →r
“If 101 is divisible by 3, then 101
2
is divisible by 9. 101 is divisible by 3. Consequently, 101
2
is divisible by 9.”
Although the argument is valid, its conclusion is incorrect, because one of the hypotheses is false (“101 is divisible
by 3.”).
If in the above argument we replace 101 with 102, we could correctly conclude that 102
2
is divisible by 9.
Rules of Inference for Propositional Logic
o An argument form consisting of two premises and a conclusion is called a syllogism.
o The first and second premises are called the major premise and minor premise, respectively.
o The most famous form of syllogism in logic is called modus ponens.
Modus Ponens
o The modus ponens argument form has the following form(“method of affirming”):
If p then q.
p
∴ q
If the sum of the digits of 371,487 is divisible by 3, then 371,487 is divisible by 3.
The sum of the digits of 371,487 is divisible by 3.
∴ 371,487 is divisible by 3.
o if a conditional statement and the hypothesis of this conditional statement are both true, then the
conclusion must also be true.
29Discret Structure for BSCS…… Prepared by Abdur-Rehman
Modus Tollens
o Modus tollens(“method of denying” (the conclusion is a denial)) has the following form:
If p then q.
∼q
∴ ∼p
If Zeus is human, then Zeus is mortal.
Zeus is not mortal.
∴ Zeus is not human.
1) If Zeus is human, then Zeus is mortal; and
(2) Zeus is not mortal.
Must Zeus necessarily be nonhuman?
Yes!
Because, if Zeus were human, then by (1) he would be mortal.
But by (2) he is not mortal.
Hence, Zeus cannot be human.
Translating Propositions
Rules of Inference for Propositional Logic
o When an argument form involves 10 different propositional variables, to use a truth table to show this
argument form is valid requires 2
10
= 1024 different rows.
o Rules of inference.
First establish the validity of some relatively simple argument forms.
30Discret Structure for BSCS…… Prepared by Abdur-Rehman
A rule of inference is a form of argument that is valid.
Thus modus ponens and modus tollens are both rules of inference.
o Generalization
The following argument forms are valid:
a. p b. q
∴ p ∨ q ∴ p ∨ q
if p is true, then, more generally, “p or q” is true for any other statement q.
Anton is a junior.
∴ (more generally) Anton is a junior or Anton is a senior.
o At some places with the name Addition
It is below freezing now. Therefore, it is below freezing or raining snow.
o Specialization
The following argument forms are valid:
a. p ∧ q b. p ∧ q
∴ p ∴ q
These argument forms are used for specializing.
Ana knows numerical analysis and Ana knows graph algorithms.
∴ (in particular) Ana knows graph algorithms.
o At some places with the name simplification
It is below freezing and snowing. Therefore it is below freezing.
o Elimination
The following argument forms are valid:
a. p ∨ q b. p ∨ q
∼q ∼p
∴ p ∴ q
o These argument forms say that when you have only two possibilities and you can rule one out, the other
must be the case.
31Discret Structure for BSCS…… Prepared by Abdur-Rehman
x − 3 =0 or x + 2 = 0.
If you also know that x is not negative, then x ≠ −2, so
x + 2 ≠ 0.
By elimination, you can then conclude that
∴ x − 3 = 0.
o At some places with the name Disjunctive Syllogism
o Transitivity
o The following argument form is valid:
p →q
q →r
∴ p →r
If 18,486 is divisible by 18, then 18,486 is divisible by 9.
If 18,486 is divisible by 9, then the sum of the digits of 18,486 is divisible by 9.
∴ If 18,486 is divisible by 18, then the sum of the digits of 18,486 is divisible by 9.
o At some places with the name Hypothetical Syllogism
o Proof by Division into Cases
The following argument form is valid:
p ∨ q
p →r
q →r
∴ r
o If you can show that in either case a certain conclusion follows, then this conclusion must also be true.
x is positive or x is negative.
If x is positive, then x
2
> 0.
If x is negative, then x
2
> 0.
∴ x
2
> 0.
o Conjunction
p
q
∴ p ∧ q
o Resolution
32Discret Structure for BSCS…… Prepared by Abdur-Rehman
p ∨ q
¬p ∨ r
∴ q ∨ r
Rules of Inference for Propositional Logic-Example
o “If it rains today, then we will not have a barbeque today. If we do not have a barbeque today, then we
will have a barbeque tomorrow.
Therefore, if it rains today, then we will have a barbeque tomorrow.”
p: “It is raining today.”
q: “We will not have a barbecue today.”
r: “We will have a barbecue tomorrow.”
So the argument is of the following form:
o “If it rains today, then we will not have a barbeque today. If we do not have a barbeque today, then we
will have a barbeque tomorrow.
Therefore, if it rains today, then we will have a barbeque tomorrow.”
p: “It is raining today.”
q: “We will not have a barbecue today.”
r: “We will have a barbecue tomorrow.”
So the argument is of the following form:
o “It is not sunny this afternoon and it is colder than yesterday,” “We will go swimming only if it is sunny,”
“If we do not go swimming, then we will take a canoe trip,” and “If we take a canoe trip, then we will be
home by sunset” lead to the conclusion “We will be home by sunset.”
p: “It is sunny this afternoon ”
q: “It is colder than yesterday.”
33Discret Structure for BSCS…… Prepared by Abdur-Rehman
r: “We will go swimming .”
s:” we will take a canoe trip”
t: “We will be home by sunset”
Step Reason
1. ¬pΛq Premise
2. ¬p Simplification using (1)
3. r → p Premise
4. ¬r Modus tollens using (2) and (3)
5. ¬r → s Premise
6. s
7. s→t
Modus ponens using (4) and (5)
Premise
8. t Modus ponens using (6) and (7)
Fallacies
o A fallacy is an error in reasoning that results in an invalid argument.
1. Using ambiguous premises, and treating them as if they were unambiguous.
2. Circular reasoning (assuming what is to be proved without having derived it from the premises)
3. Jumping to a conclusion (without adequate grounds).
o An argument is invalid means that there is an argument of that form whose premises are all true and
whose conclusion is false.
o A fallacy is an error in reasoning that results in an invalid argument.
1. Using ambiguous premises, and treating them as if they were unambiguous.
2. Circular reasoning (assuming what is to be proved without having derived it from the premises)
3. Jumping to a conclusion (without adequate grounds).
o An argument is invalid means that there is an argument of that form whose premises are all true and
whose conclusion is false.
o Inverse Error
1. The conclusion of the argument would follow from the premises if the premise p →q were
replaced by its inverse. Such a replacement is not allowed, however, because a conditional
statement is not logically equivalent to its inverse. Inverse error is also known as the fallacy of
denying the antecedent.
2. “A cow eats grass. This animal is not a cow, so it won't eat grass.“
34Discret Structure for BSCS…… Prepared by Abdur-Rehman
3. “An odd number is prime, 15 is odd, so 15 is prime" is not fallacious| it is a logically correct
argument based on an incorrect hypothesis.”
Rules of Inference for Propositional Logic
In logic, the words true and valid have very different meanings. A valid argument may have a false
conclusion, and an invalid argument may have a true conclusion.
Example
Arguments with Quantified Statements
All men are mortal.
valid by modus ponens. But its major premise is
false, and so is its conclusion.
The argument is invalid by the converse error, but it has a true
conclusion.
35Discret Structure for BSCS…… Prepared by Abdur-Rehman
Socrates is a man.
∴ Socrates is mortal.
o Universal Instantiation
If some property is true of everything in a set, then it is true of any particular thing in the set.
For all real numbers x, x
1
= x. universal truth
r is a particular real number. particular instance
∴ r
1
= r.
Universal Modus Ponens
o Could be written as “All things that make P(x) true make Q(x) true,” in which case the conclusion would
follow by universal instantiation alone.
If an integer is even, then its square is even.
k is a particular integer that is even.
∴ k
2
is even.
o Major premise can be written as ∀x, if x is an even integer then x
2
is even.
o Let E(x) be “x is an even integer,” let S(x) be “x
2
is even,” and let k stand for a particular integer that is
even. Then the argument has the following form:
∀x, if E(x) then S(x).
E(k), for a particular k.
∴ S(k).
o This argument has the form of universal modus ponens and is therefore valid.
Universal Modus Tollens
36Discret Structure for BSCS…… Prepared by Abdur-Rehman
All human beings are mortal.
Zeus is not mortal.
∴ Zeus is not human.
Solution The major premise can be rewritten as ∀x, if x is human then x is mortal.
Let H(x) be “x is human,” let M(x) be “x is mortal,” and let Z stand for Zeus. The argument becomes
∀x, if H(x) then M(x)
∼M(Z)
∴ ∼H(Z).
This argument has the form of universal modus tollens and is therefore valid.

More Related Content

What's hot

Introducing yourself in Arabic
Introducing yourself in ArabicIntroducing yourself in Arabic
Introducing yourself in Arabic
Mohammed Dayoub
 
150 روایات کی تحقیق.pdf
150 روایات کی تحقیق.pdf150 روایات کی تحقیق.pdf
150 روایات کی تحقیق.pdf
Faizan ali Siddiqui
 
Quantum Computing and D-Wave
Quantum Computing and D-WaveQuantum Computing and D-Wave
Quantum Computing and D-Wave
Recruit Communications Co., Ltd.
 
Optimization Methods in Finance
Optimization Methods in FinanceOptimization Methods in Finance
Optimization Methods in Finance
thilankm
 
Discrete Math Presentation(Rules of Inference)
Discrete Math Presentation(Rules of Inference)Discrete Math Presentation(Rules of Inference)
Discrete Math Presentation(Rules of Inference)
Ikhtiar Khan Sohan
 
Book of John the Baptist - Drasha id yahia - Mandaic
Book of John the Baptist - Drasha id yahia - MandaicBook of John the Baptist - Drasha id yahia - Mandaic
Book of John the Baptist - Drasha id yahia - Mandaic
مكتبة موسوعة العيون المعرفية MandaeanNetwork.com
 
Quantifier
QuantifierQuantifier
Mathematical Logic Part 2
Mathematical Logic Part 2Mathematical Logic Part 2
Mathematical Logic Part 2
blaircomp2003
 
Introduction to Quantum Computing and Engineering
Introduction to Quantum Computing and EngineeringIntroduction to Quantum Computing and Engineering
Introduction to Quantum Computing and Engineering
Sarun Sumriddetchkajorn
 
Quantum Computing: The Why and How
Quantum Computing: The Why and HowQuantum Computing: The Why and How
Quantum Computing: The Why and How
inside-BigData.com
 
مصحف القراءات العشر طبعة دار الصحابة إشراف الشيخ جمال شرف
مصحف القراءات العشر طبعة دار الصحابة إشراف الشيخ جمال شرفمصحف القراءات العشر طبعة دار الصحابة إشراف الشيخ جمال شرف
مصحف القراءات العشر طبعة دار الصحابة إشراف الشيخ جمال شرف
سمير بسيوني
 
Mercuryアルゴリズムではじめる範囲検索のできるDHT
Mercuryアルゴリズムではじめる範囲検索のできるDHTMercuryアルゴリズムではじめる範囲検索のできるDHT
Mercuryアルゴリズムではじめる範囲検索のできるDHTHiroya Nagao
 
ﺧﺮاﻓﺎت اﻟﺸﯿﻌﺔ
ﺧﺮاﻓﺎت اﻟﺸﯿﻌﺔﺧﺮاﻓﺎت اﻟﺸﯿﻌﺔ
ﺧﺮاﻓﺎت اﻟﺸﯿﻌﺔ
Noor Al Islam
 
Important bangla spelling rules by tanbircox
Important bangla spelling rules by tanbircoxImportant bangla spelling rules by tanbircox
Matrix Completion Presentation
Matrix Completion PresentationMatrix Completion Presentation
Matrix Completion Presentation
Michael Hankin
 
Asfer mulwasha - Mandaic
Asfer mulwasha - MandaicAsfer mulwasha - Mandaic
Slideshare Recurrent Neural Networks (RNN)
Slideshare Recurrent Neural Networks (RNN)Slideshare Recurrent Neural Networks (RNN)
Slideshare Recurrent Neural Networks (RNN)
Datamics
 
Nanocomputing
NanocomputingNanocomputing
Nanocomputing
pioneercitizen
 
TensorfLow_Basic.pptx
TensorfLow_Basic.pptxTensorfLow_Basic.pptx
TensorfLow_Basic.pptx
TMUb202109065
 

What's hot (19)

Introducing yourself in Arabic
Introducing yourself in ArabicIntroducing yourself in Arabic
Introducing yourself in Arabic
 
150 روایات کی تحقیق.pdf
150 روایات کی تحقیق.pdf150 روایات کی تحقیق.pdf
150 روایات کی تحقیق.pdf
 
Quantum Computing and D-Wave
Quantum Computing and D-WaveQuantum Computing and D-Wave
Quantum Computing and D-Wave
 
Optimization Methods in Finance
Optimization Methods in FinanceOptimization Methods in Finance
Optimization Methods in Finance
 
Discrete Math Presentation(Rules of Inference)
Discrete Math Presentation(Rules of Inference)Discrete Math Presentation(Rules of Inference)
Discrete Math Presentation(Rules of Inference)
 
Book of John the Baptist - Drasha id yahia - Mandaic
Book of John the Baptist - Drasha id yahia - MandaicBook of John the Baptist - Drasha id yahia - Mandaic
Book of John the Baptist - Drasha id yahia - Mandaic
 
Quantifier
QuantifierQuantifier
Quantifier
 
Mathematical Logic Part 2
Mathematical Logic Part 2Mathematical Logic Part 2
Mathematical Logic Part 2
 
Introduction to Quantum Computing and Engineering
Introduction to Quantum Computing and EngineeringIntroduction to Quantum Computing and Engineering
Introduction to Quantum Computing and Engineering
 
Quantum Computing: The Why and How
Quantum Computing: The Why and HowQuantum Computing: The Why and How
Quantum Computing: The Why and How
 
مصحف القراءات العشر طبعة دار الصحابة إشراف الشيخ جمال شرف
مصحف القراءات العشر طبعة دار الصحابة إشراف الشيخ جمال شرفمصحف القراءات العشر طبعة دار الصحابة إشراف الشيخ جمال شرف
مصحف القراءات العشر طبعة دار الصحابة إشراف الشيخ جمال شرف
 
Mercuryアルゴリズムではじめる範囲検索のできるDHT
Mercuryアルゴリズムではじめる範囲検索のできるDHTMercuryアルゴリズムではじめる範囲検索のできるDHT
Mercuryアルゴリズムではじめる範囲検索のできるDHT
 
ﺧﺮاﻓﺎت اﻟﺸﯿﻌﺔ
ﺧﺮاﻓﺎت اﻟﺸﯿﻌﺔﺧﺮاﻓﺎت اﻟﺸﯿﻌﺔ
ﺧﺮاﻓﺎت اﻟﺸﯿﻌﺔ
 
Important bangla spelling rules by tanbircox
Important bangla spelling rules by tanbircoxImportant bangla spelling rules by tanbircox
Important bangla spelling rules by tanbircox
 
Matrix Completion Presentation
Matrix Completion PresentationMatrix Completion Presentation
Matrix Completion Presentation
 
Asfer mulwasha - Mandaic
Asfer mulwasha - MandaicAsfer mulwasha - Mandaic
Asfer mulwasha - Mandaic
 
Slideshare Recurrent Neural Networks (RNN)
Slideshare Recurrent Neural Networks (RNN)Slideshare Recurrent Neural Networks (RNN)
Slideshare Recurrent Neural Networks (RNN)
 
Nanocomputing
NanocomputingNanocomputing
Nanocomputing
 
TensorfLow_Basic.pptx
TensorfLow_Basic.pptxTensorfLow_Basic.pptx
TensorfLow_Basic.pptx
 

Viewers also liked

Qué es una ileostomía
Qué es una ileostomíaQué es una ileostomía
Qué es una ileostomía
yucetecom
 
Testing Model Transformations
Testing Model TransformationsTesting Model Transformations
Testing Model Transformations
miso_uam
 
Tammam Azzam speaks exclusively to the Burnet News Club
Tammam Azzam speaks exclusively to the Burnet News ClubTammam Azzam speaks exclusively to the Burnet News Club
Tammam Azzam speaks exclusively to the Burnet News Club
The Economist Educational Foundation
 
Wordpress
WordpressWordpress
Wordpress
Vô Danh
 
Blended Learning: Transform Daily Class into an Engaging Learning Environment
Blended Learning:  Transform Daily Class into  an Engaging Learning EnvironmentBlended Learning:  Transform Daily Class into  an Engaging Learning Environment
Blended Learning: Transform Daily Class into an Engaging Learning Environment
NECTJ
 
30.08.2013, NEWSWIRE, Issue 289
30.08.2013, NEWSWIRE, Issue 28930.08.2013, NEWSWIRE, Issue 289
30.08.2013, NEWSWIRE, Issue 289
The Business Council of Mongolia
 
Heilsueflandi skoli3
Heilsueflandi skoli3Heilsueflandi skoli3
Heilsueflandi skoli3
ingileif2507
 
Proving existential statements
Proving existential statementsProving existential statements
Proving existential statements
Abdur Rehman
 
Siva resume
Siva resumeSiva resume
Siva resume
siva vaithiyanathan
 
11 engineering final year project i deas: app ideas
11 engineering  final year project i deas: app ideas11 engineering  final year project i deas: app ideas
11 engineering final year project i deas: app ideas
Mayank Mohan Upadhyay
 
Peer Editing
Peer EditingPeer Editing
Peer Editing
morag
 
The newyork times paywall case solution - Shubham Parsekar - PGDM
The newyork times paywall case solution - Shubham Parsekar - PGDMThe newyork times paywall case solution - Shubham Parsekar - PGDM
The newyork times paywall case solution - Shubham Parsekar - PGDM
Shubham Parsekar
 
бүтээлч сэтгэлгээг хөгжүүлэх нь
бүтээлч сэтгэлгээг хөгжүүлэх ньбүтээлч сэтгэлгээг хөгжүүлэх нь
бүтээлч сэтгэлгээг хөгжүүлэх нь
Азжаргал Нинжбадгар
 

Viewers also liked (13)

Qué es una ileostomía
Qué es una ileostomíaQué es una ileostomía
Qué es una ileostomía
 
Testing Model Transformations
Testing Model TransformationsTesting Model Transformations
Testing Model Transformations
 
Tammam Azzam speaks exclusively to the Burnet News Club
Tammam Azzam speaks exclusively to the Burnet News ClubTammam Azzam speaks exclusively to the Burnet News Club
Tammam Azzam speaks exclusively to the Burnet News Club
 
Wordpress
WordpressWordpress
Wordpress
 
Blended Learning: Transform Daily Class into an Engaging Learning Environment
Blended Learning:  Transform Daily Class into  an Engaging Learning EnvironmentBlended Learning:  Transform Daily Class into  an Engaging Learning Environment
Blended Learning: Transform Daily Class into an Engaging Learning Environment
 
30.08.2013, NEWSWIRE, Issue 289
30.08.2013, NEWSWIRE, Issue 28930.08.2013, NEWSWIRE, Issue 289
30.08.2013, NEWSWIRE, Issue 289
 
Heilsueflandi skoli3
Heilsueflandi skoli3Heilsueflandi skoli3
Heilsueflandi skoli3
 
Proving existential statements
Proving existential statementsProving existential statements
Proving existential statements
 
Siva resume
Siva resumeSiva resume
Siva resume
 
11 engineering final year project i deas: app ideas
11 engineering  final year project i deas: app ideas11 engineering  final year project i deas: app ideas
11 engineering final year project i deas: app ideas
 
Peer Editing
Peer EditingPeer Editing
Peer Editing
 
The newyork times paywall case solution - Shubham Parsekar - PGDM
The newyork times paywall case solution - Shubham Parsekar - PGDMThe newyork times paywall case solution - Shubham Parsekar - PGDM
The newyork times paywall case solution - Shubham Parsekar - PGDM
 
бүтээлч сэтгэлгээг хөгжүүлэх нь
бүтээлч сэтгэлгээг хөгжүүлэх ньбүтээлч сэтгэлгээг хөгжүүлэх нь
бүтээлч сэтгэлгээг хөгжүүлэх нь
 

Similar to Dscrete structure

Drinkfromme.pptx
Drinkfromme.pptxDrinkfromme.pptx
Drinkfromme.pptx
Ravind8
 
Truth table
Truth tableTruth table
Truth table
Abdur Rehman
 
Artificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logicArtificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logic
Taymoor Nazmy
 
Discrete Structures lecture 2
 Discrete Structures lecture 2 Discrete Structures lecture 2
Discrete Structures lecture 2
Ali Usman
 
Chapter1p1.pdf
Chapter1p1.pdfChapter1p1.pdf
Chapter1p1.pdf
IqraAli875037
 
Chapter1p1
Chapter1p1Chapter1p1
Chapter1p1
Angel Martinez
 
DISMATH_Part1
DISMATH_Part1DISMATH_Part1
DISMATH_Part1
Melvin Cabatuan
 
Chapter 01 - p1.pdf
Chapter 01 - p1.pdfChapter 01 - p1.pdf
Chapter 01 - p1.pdf
smarwaneid
 
L2.pdf
L2.pdfL2.pdf
Discrete Mathematics Details tree pt.pptx
Discrete Mathematics Details tree pt.pptxDiscrete Mathematics Details tree pt.pptx
Discrete Mathematics Details tree pt.pptx
FariaHassan4
 
logic, preposition etc
logic, preposition etclogic, preposition etc
logic, preposition etc
Abdur Rehman
 
L03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicL03 ai - knowledge representation using logic
L03 ai - knowledge representation using logic
Manjula V
 
Laws of Logic in Discrete Structures and their applications
Laws of Logic in Discrete Structures and their applicationsLaws of Logic in Discrete Structures and their applications
Laws of Logic in Discrete Structures and their applications
ZenLooper
 
Valid &amp; invalid arguments
Valid &amp; invalid argumentsValid &amp; invalid arguments
Valid &amp; invalid arguments
Abdur Rehman
 
DS Lecture 2.ppt
DS Lecture 2.pptDS Lecture 2.ppt
DS Lecture 2.ppt
NomanMehboob4
 
UGC NET Computer Science & Application book.pdf [Sample]
UGC NET Computer Science & Application book.pdf  [Sample]UGC NET Computer Science & Application book.pdf  [Sample]
UGC NET Computer Science & Application book.pdf [Sample]
DIwakar Rajput
 
Propositional logic in Discretes tructures.pptx
Propositional logic in Discretes tructures.pptxPropositional logic in Discretes tructures.pptx
Propositional logic in Discretes tructures.pptx
ShaukatAliChaudhry1
 
Valid and Invalid Arguments.pptx
Valid and Invalid Arguments.pptxValid and Invalid Arguments.pptx
Valid and Invalid Arguments.pptx
LuisSalenga1
 
Logic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptxLogic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptx
PriyalMayurManvar
 
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDiscrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Dr. Khaled Bakro
 

Similar to Dscrete structure (20)

Drinkfromme.pptx
Drinkfromme.pptxDrinkfromme.pptx
Drinkfromme.pptx
 
Truth table
Truth tableTruth table
Truth table
 
Artificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logicArtificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logic
 
Discrete Structures lecture 2
 Discrete Structures lecture 2 Discrete Structures lecture 2
Discrete Structures lecture 2
 
Chapter1p1.pdf
Chapter1p1.pdfChapter1p1.pdf
Chapter1p1.pdf
 
Chapter1p1
Chapter1p1Chapter1p1
Chapter1p1
 
DISMATH_Part1
DISMATH_Part1DISMATH_Part1
DISMATH_Part1
 
Chapter 01 - p1.pdf
Chapter 01 - p1.pdfChapter 01 - p1.pdf
Chapter 01 - p1.pdf
 
L2.pdf
L2.pdfL2.pdf
L2.pdf
 
Discrete Mathematics Details tree pt.pptx
Discrete Mathematics Details tree pt.pptxDiscrete Mathematics Details tree pt.pptx
Discrete Mathematics Details tree pt.pptx
 
logic, preposition etc
logic, preposition etclogic, preposition etc
logic, preposition etc
 
L03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicL03 ai - knowledge representation using logic
L03 ai - knowledge representation using logic
 
Laws of Logic in Discrete Structures and their applications
Laws of Logic in Discrete Structures and their applicationsLaws of Logic in Discrete Structures and their applications
Laws of Logic in Discrete Structures and their applications
 
Valid &amp; invalid arguments
Valid &amp; invalid argumentsValid &amp; invalid arguments
Valid &amp; invalid arguments
 
DS Lecture 2.ppt
DS Lecture 2.pptDS Lecture 2.ppt
DS Lecture 2.ppt
 
UGC NET Computer Science & Application book.pdf [Sample]
UGC NET Computer Science & Application book.pdf  [Sample]UGC NET Computer Science & Application book.pdf  [Sample]
UGC NET Computer Science & Application book.pdf [Sample]
 
Propositional logic in Discretes tructures.pptx
Propositional logic in Discretes tructures.pptxPropositional logic in Discretes tructures.pptx
Propositional logic in Discretes tructures.pptx
 
Valid and Invalid Arguments.pptx
Valid and Invalid Arguments.pptxValid and Invalid Arguments.pptx
Valid and Invalid Arguments.pptx
 
Logic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptxLogic in Computer Science Unit 2 (1).pptx
Logic in Computer Science Unit 2 (1).pptx
 
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDiscrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
 

More from Abdur Rehman

Financial accounting
Financial accountingFinancial accounting
Financial accounting
Abdur Rehman
 
Sets
SetsSets
Sequences
SequencesSequences
Sequences
Abdur Rehman
 
Recursion
RecursionRecursion
Recursion
Abdur Rehman
 
Queue
QueueQueue
Quantification
QuantificationQuantification
Quantification
Abdur Rehman
 
Method of direct proof
Method of direct proofMethod of direct proof
Method of direct proof
Abdur Rehman
 
Proofs by contraposition
Proofs by contrapositionProofs by contraposition
Proofs by contraposition
Abdur Rehman
 
Laws in disceret
Laws in disceretLaws in disceret
Laws in disceret
Abdur Rehman
 
Converse, contrapositive, inverse
Converse, contrapositive, inverseConverse, contrapositive, inverse
Converse, contrapositive, inverse
Abdur Rehman
 
Constructing circuits for boolean expressions(gate)
Constructing circuits for boolean expressions(gate)Constructing circuits for boolean expressions(gate)
Constructing circuits for boolean expressions(gate)
Abdur Rehman
 
Application of bases
Application of basesApplication of bases
Application of bases
Abdur Rehman
 
Intro to disceret structure
Intro to disceret structureIntro to disceret structure
Intro to disceret structure
Abdur Rehman
 
Dst lec3
Dst lec3Dst lec3
Dst lec3
Abdur Rehman
 

More from Abdur Rehman (14)

Financial accounting
Financial accountingFinancial accounting
Financial accounting
 
Sets
SetsSets
Sets
 
Sequences
SequencesSequences
Sequences
 
Recursion
RecursionRecursion
Recursion
 
Queue
QueueQueue
Queue
 
Quantification
QuantificationQuantification
Quantification
 
Method of direct proof
Method of direct proofMethod of direct proof
Method of direct proof
 
Proofs by contraposition
Proofs by contrapositionProofs by contraposition
Proofs by contraposition
 
Laws in disceret
Laws in disceretLaws in disceret
Laws in disceret
 
Converse, contrapositive, inverse
Converse, contrapositive, inverseConverse, contrapositive, inverse
Converse, contrapositive, inverse
 
Constructing circuits for boolean expressions(gate)
Constructing circuits for boolean expressions(gate)Constructing circuits for boolean expressions(gate)
Constructing circuits for boolean expressions(gate)
 
Application of bases
Application of basesApplication of bases
Application of bases
 
Intro to disceret structure
Intro to disceret structureIntro to disceret structure
Intro to disceret structure
 
Dst lec3
Dst lec3Dst lec3
Dst lec3
 

Recently uploaded

RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.
IsmaelVazquez38
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
TechSoup
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
RamseyBerglund
 
MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025
khuleseema60
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
Iris Thiele Isip-Tan
 
Accounting for Restricted Grants When and How To Record Properly
Accounting for Restricted Grants  When and How To Record ProperlyAccounting for Restricted Grants  When and How To Record Properly
Accounting for Restricted Grants When and How To Record Properly
TechSoup
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
RidwanHassanYusuf
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
Juneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School DistrictJuneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School District
David Douglas School District
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
nitinpv4ai
 
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
Payaamvohra1
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
heathfieldcps1
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
deepaannamalai16
 
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
EduSkills OECD
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
Celine George
 
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
Nguyen Thanh Tu Collection
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 

Recently uploaded (20)

RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
 
MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025MDP on air pollution of class 8 year 2024-2025
MDP on air pollution of class 8 year 2024-2025
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
 
Accounting for Restricted Grants When and How To Record Properly
Accounting for Restricted Grants  When and How To Record ProperlyAccounting for Restricted Grants  When and How To Record Properly
Accounting for Restricted Grants When and How To Record Properly
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
Juneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School DistrictJuneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School District
 
Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
 
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
 
HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.HYPERTENSION - SLIDE SHARE PRESENTATION.
HYPERTENSION - SLIDE SHARE PRESENTATION.
 
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
Andreas Schleicher presents PISA 2022 Volume III - Creative Thinking - 18 Jun...
 
How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17How to Download & Install Module From the Odoo App Store in Odoo 17
How to Download & Install Module From the Odoo App Store in Odoo 17
 
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
CHUYÊN ĐỀ ÔN TẬP VÀ PHÁT TRIỂN CÂU HỎI TRONG ĐỀ MINH HỌA THI TỐT NGHIỆP THPT ...
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 

Dscrete structure

  • 1. A R Usmani Skardu Gilgit-Baltistan abdurrehmanusmani65@gmail.com
  • 2. 1Discret Structure for BSCS…… Prepared by Abdur-Rehman Why is it o “Discrete” (≠ “discreet”!) - Composed of distinct, separable parts. o “Structures” - objects built up from simpler objects according to a definite pattern. Why it is important o Provides mathematical foundation for computer science courses such as o data structures, algorithms, relational database theory, automata theory and o formal languages, compiler design, and cryptography, o Mathematics courses such as linear and abstract algebra, probability, logic and set theory, and number theory. What it does o Describes processes that consist of a sequence of individual steps. o Helps students to develop the ability to think abstractly. ESSENTIAL TOPICS TO BE COVERED: o Functions, relations and sets o Basic logic o Proof techniques o Basics of counting o Graphs and trees o Recursion Logic o Crucial for mathematical reasoning o Important for program design o Used for designing electronic circuitry o (Propositional )Logic is a system based on propositions. o A proposition is a (declarative) statement that is either true or false (not both). o We say that the truth value of a proposition is either true (T) or false (F).
  • 3. 2Discret Structure for BSCS…… Prepared by Abdur-Rehman o Corresponds to 1 and 0 in digital circuits The Statement/Proposition Game “Elephants are bigger than mice.” Is this a statement? Yes Is this a proposition? yes What is the truth value of the proposition? true The Statement/Proposition Game “520 < 111” Is this a statement? yes Is this a proposition? yes What is the truth value of the proposition? False The Statement/Proposition Game “y > 5” Is this a statement? yes Is this a proposition? no Its truth value depends on the value of y, but this value is not specified. We call this type of statement a propositional function or open sentence. The Statement/Proposition Game “Today is January 27 and 99 < 5.” Is this a statement? yes Is this a proposition? yes What is the truth value of the proposition? False The Statement/Proposition Game “Please do not fall asleep.”
  • 4. 3Discret Structure for BSCS…… Prepared by Abdur-Rehman Is this a statement? no It’s a request. Is this a proposition? no Only statements can be propositions. The Statement/Proposition Game “If the moon is made of cheese, then I will be rich.” Is this a statement? yes Is this a proposition? yes What is the truth value of the proposition? probably true The Statement/Proposition Game “x < y if and only if y > x.” Is this a statement? yes Is this a proposition? yes … because its truth value does not depend on specific values of x and y. What is the truth value of the proposition? true Combining Propositions As we have seen in the previous examples, one or more propositions can be combined to form a single compound proposition. We formalize this by denoting propositions with letters such as p, q, r, s, and introducing several logical operators or logical connectives. Logical Operators (Connectives) We will examine the following logical operators: • Negation (NOT, ) • Conjunction (AND, )
  • 5. 4Discret Structure for BSCS…… Prepared by Abdur-Rehman • Disjunction (OR, ) • Exclusive-or (XOR,  ) • Implication (if – then,  ) • Biconditional (if and only if,  ) Truth tables can be used to show how these operators can combine propositions to compound propositions. Negation (NOT) Unary Operator, Symbol:  P  P true (T) false (F) false (F) true (T) Conjunction (AND) Binary Operator, Symbol:  P Q P Q T T T T F F F T F F F F Disjunction (OR) Binary Operator, Symbol: 
  • 6. 5Discret Structure for BSCS…… Prepared by Abdur-Rehman P Q P  Q T T T T F T F T T F F F Connectives Let p=“It rained last night”, q=“The sprinklers came on last night,” r=“The lawn was wet this morning.” Translate each of the following into English: ≦p = “It didn’t rain last night.” r ∧ ¬p =“The lawn was wet this morning, and it didn’t rain last night.” ¬ r ∨ p ∨ q =“Either the lawn wasn’t wet this morning, or it rained last night, or the sprinklers came on last night.” Connectives: Let p= “It is hot” q=““It is sunny” 1. It is not hot but it is sunny. 2. It is neither hot nor sunny. Solution 1. ⌐p∧q 2. ⌐p∧ ⌐q Exclusive Or (XOR)
  • 7. 6Discret Structure for BSCS…… Prepared by Abdur-Rehman Binary Operator, Symbol:  p = “I will earn an A in this course,” q = “I will drop this course,” p ⊕ q = “I will either earn an A in this course, or I will drop it (but not both!)” True when exactly one of p and q is true and is false otherwise.0 P Q PQ T T F T F T F T T F F F
  • 8. 7Discret Structure for BSCS…… Prepared by Abdur-Rehman Truth Table o The truth value of the compound proposition depends only on the truth value of the component propositions. Such a list is a called a truth table. Example o (pq) ¬(pq) p q pq pq ¬(pq) (pq) ¬(pq) T T T T F F T F T F T T F T T F T T F F F F T F Example o (p  q)  ¬r P q r pq ¬r (pq)¬r T T T T T F T F T T F F F T T F T F F F T
  • 9. 8Discret Structure for BSCS…… Prepared by Abdur-Rehman Implication (if - then)  o The conditional statement p → q is the proposition “if p, then q.” o The conditional statement p → q is false when p is true and q is false, and true otherwise. o p is called the hypothesis and q is called the conclusion. Implication (if - then)  p = “You study hard.” q = “You will get a good grade.” p → q = “If you study hard, then you will get a good grade.” P Q PQ T T T T F F F T T F F T Biconditionals (if and Only If)  p = “Sharif wins the 2012 election.” q = “Sharif will be prime minister for five years.” p ↔ q = “If, and only if, Sharif wins the 2012 election, Sharif will be prime minister for five years.” p ↔ q does not imply that p and q are true, or that either of them causes the other, or that they have a common cause.
  • 10. 9Discret Structure for BSCS…… Prepared by Abdur-Rehman Precedence of Logical Connectives o ~ highest o Ʌ second highest o V third highest o → fourth highest o ↔ fifth highest Logical Equivalence 1. 6 is greater than 2 2. 2 is less than 6 two different ways of saying the same thing. both be true or both be false. logical form of the statements is important. 3. p ∧ q is true when, and only when, q ∧ p is true. 4. The statement forms are called logically equivalent Logical Equivalence
  • 11. 10Discret Structure for BSCS…… Prepared by Abdur-Rehman o Two statement forms are called logically equivalent if, and only if, they have identical truth values for each possible substitution of statements for their statement variables. o P ≡ Q. o Negation of the negation of a statement is logically equivalent to the statement. o ∼(∼p) ≡ p o ∼(p ∧ q) and ∼p ∧ ∼q are not logically equivalent o p =“0 < 1” and let q =“1 < 0.” Logical Equivalence
  • 12. 11Discret Structure for BSCS…… Prepared by Abdur-Rehman De Morgan’s Laws o The negation of the conjunction of two statements is logically equivalent to the disjunction of their negations. o ∼(p ∧ q) and ∼p ∨ ∼q are logically equivalent i.e. ∼(p ∧ q) ≡ ∼p ∨ ∼q. De Morgan’s Laws o Negation of the disjunction of two statements is logically equivalent to the conjunction of their negations: o Write negations for each of the following statements: o John is 6 feet tall and he weighs at least 200 pounds. o The bus was late or Tom’s watch was slow. o Negation of these statements o John is not 6 feet tall or he weighs less than 200 pounds. o The bus was not late and Tom’s watch was not slow(/“Neither was the bus late nor was Tom’s watch slow.”) o Negation of a disjunction is formed by taking the conjunction of the negations of the component propositions. o Negation of a conjunction is formed by taking the disjunction of the negations of the component propositions. qpqp qpqp   )( )(
  • 13. 12Discret Structure for BSCS…… Prepared by Abdur-Rehman o Frequently used in writing computer programs. o For instance, suppose you want your program to delete all files modified outside a certain range of dates, say from date 1 through date 2 inclusive. o ∼(date1 ≤ file_modification_date ≤ date2) o is equivalent to o ( file_modification_date < date1) or (date2 < file_modification_date).
  • 14. 13Discret Structure for BSCS…… Prepared by Abdur-Rehman Tautologies and Contradictions A tautology is a statement that is always true. Examples: R(R) (PQ)  (P)( Q) A contradiction is a statement that is always false. Examples: R(R) ((P  Q)  (P)  (Q)) The negation of any tautology is a contradiction, and the negation of any contradiction is a tautology. Equivalence Definition: two propositional statements S1 and S2 are said to be (logically) equivalent, denoted S1  S2 if They have the same truth table, or S1  S2 is a tautology Equivalence can be established by Constructing truth tables Using equivalence laws (Table 5 in Section 1.2) Equivalence laws Identity laws, P  T  P, Domination laws, P  F  F, Idempotent laws, P  P  P, Double negation law,  ( P)  P Commutative laws, P  Q  Q  P, Associative laws, P  (Q  R) (P  Q)  R, Distributive laws, P  (Q  R) (P  Q)  (P  R), De Morgan’s laws,  (PQ)  ( P)  ( Q) Law with implication P  Q   P  Q
  • 15. 14Discret Structure for BSCS…… Prepared by Abdur-Rehman Associative Laws (p ∨ q) ∨ r ≡ p ∨ (q ∨ r) (p ∧ q) ∧ r ≡ p ∧ (q ∧ r) Simplifying Statement Forms o ∼(∼p ∧ q) ∧ (p ∨ q) ≡ p P q r pq (p ∧ q) ∧ r q ∧ r p ∧ (q ∧ r) T T T T T T T T T F T F F F T F T F F F F T F F F F F F F T T F F T F F T F F F F F F F T F F F F
  • 16. 15Discret Structure for BSCS…… Prepared by Abdur-Rehman CONVERSE, CONTRAPOSITIVE, INVERSE o The proposition q → p is called the converse of p → q. o A conditional statement and its converse are NOT logically equivalent. o The proposition ¬p →¬q is called the inverse of p → q. o A conditional statement and its inverse are NOT logically equivalent. o If a conditional statement is true, then its converse and inverse must also be true. This is not correct! o If Howard can swim across the lake, then Howard can swim to the island. o Converse: o If Howard can swim to the island, then Howard can swim across the lake. o Inverse: o If Howard cannot swim across the lake, then Howard cannot swim to the island. o If today is Easter, then tomorrow is Monday. o Converse: If tomorrow is Monday, then today is Easter. o Inverse: If today is not Easter, then tomorrow is not Monday. o The contrapositive of p → q is the proposition ¬q →¬p. o A conditional statement is logically equivalent to its contrapositive!
  • 17. 16Discret Structure for BSCS…… Prepared by Abdur-Rehman o If Howard can swim across the lake, then Howard can swim to the island. o If today is Easter, then tomorrow is Monday. o If Howard cannot swim to the island, then Howard cannot swim across the lake. o If tomorrow is not Monday, then today is not Easter. o The contrapositive of p → q is the proposition ¬q →¬p. o A conditional statement is logically equivalent to its contrapositive! o If Howard can swim across the lake, then Howard can swim to the island. o If today is Easter, then tomorrow is Monday. o If Howard cannot swim to the island, then Howard cannot swim across the lake. o If tomorrow is not Monday, then today is not Easter. Negations of If-Then Statements If my car is in the repair shop, then I cannot get to class. If Sara lives in Athens, then she lives in Greece. o Negation My car is in the repair shop and I can get to class. Sara lives in Athens and she does not live in Greece. o The negation of an if-then statement does not start with the word if.
  • 18. 17Discret Structure for BSCS…… Prepared by Abdur-Rehman Simplifying Statement “you are hardworking and the sun shines, or you are hardworking and it rains.” p=“ you are hardworking “. q=“the sun shines” r= “it rains” (p  q)  (p  r)  p (q r) using distributive law “you are hardworking and the sun shines or it rains” Translating English Sentences “If the moon is out and it is not snowing, then Sam goes out for a walk.” p=“Phyllis goes out for a walk”. q=“The moon is out” r= “It is snowing”  If the moon is out and it is not snowing, then Sam goes out for a walk. “If it is snowing and the moon is not out, then Sam will not go out for a walk.” “You can access the Internet from campus only if you are a computer science major or you are not a freshman.” a=“You can access the Internet from campus“. c=“You are a computer science major” pqr  )( prq  )(
  • 19. 18Discret Structure for BSCS…… Prepared by Abdur-Rehman f= “You are a freshman” a → (c ∨¬f ). o Let p, q, and r be the propositions: p = “you have the flu” q = “you miss the final exam” r = “you pass the course” o Express the following propositions as an English sentence. o p → q If you have flu, then you will miss the final exam. o ~q → r If you don’t miss the final exam, you will pass the course. o ~p → ~q → r If you neither have flu nor miss the final exam, then you will pass the course. BICONDITIONALS o If it is hot outside you buy an ice cream cone, and if you buy an ice cream cone it is hot outside. You buy an ice cream cone if and only if it is hot outside. o For you to win the contest it is necessary and sufficient that you have the only winning ticket. You win the contest if and only if you hold the only winning ticket. o If you read the news paper every day, you will be informed and conversely. You will be informed if and only if you read the news paper every day. o It rains if it is a weekend day, and it is a weekend day if it rains. It rains if and only if it is a weekend day. o The train runs late on exactly those days when I take it. The train runs late if and only if it is a day I take the train. o This number is divisible by 6 precisely when it is divisible by both 2 and 3. This number is divisible by 6 if and only if it is divisible by both 2 and 3. Predicate o p=“is a student at Bedford College” o q =“is a student at.” • p & q are predicate symbols
  • 20. 19Discret Structure for BSCS…… Prepared by Abdur-Rehman • p(x)=“x is a student at Bedford College. • q(x,y) =“x is a student at y.”  x and y are predicate variables that take values in appropriate sets. • When concrete values are substituted in place of predicate variables, a statement results. o A predicate is a predicate symbol together with suitable predicate variables. o A predicate is a sentence that contains a finite number of variables and becomes a statement when specific values are substituted for the variables. o The domain of a predicate variable is the set of all values that may be substituted in place of the variable. o Also referred as propositional functions or open sentences Predicate(Example) o Person(x), which is true if x is a person o Person(Socrates) = T o Person(dolly-the-sheep) = F o Let U = Z, the integers = {. . . -2, -1, 0 , 1, 2, 3, . . .} • P(x): x > 0 is the predicate. It has no truth value until the variable x is bound. o Examples of propositions where x is assigned a value: • P(-3) is false, • P(0) is false, • P(3) is true. Truth Values of a Predicate o P(x)=“x2 > x” o Domain = set R of all real numbers o Find truth values of P(2), P( 1/2 ), and P(−1/2 ) • P(2): 2 2 > 2, or 4 > 2. True • P(1/2):(1/2) 2 <1/2 or (1/4) <1/2 False • P(-1/2):(-1/2) 2 >-1/2 or (1/4) >-1/2 True o 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 they are substituted for x. The truth set of P(x) is denoted {x ∈ D | P(x)} “the set of all x in D such that P(x).” o Let R be the three-variable predicate R(x, y z): x + y= z
  • 21. 20Discret Structure for BSCS…… Prepared by Abdur-Rehman o Find the truth value of R(2, -1, 5), R(3, 4, 7), R(x, 3, z) Universal Quantification o To change predicates into statements is to assign specific values to all their variables. if x represents the number 35, the sentence “x is divisible by 5” is a true statement since 35 = 5· 7. o Another way is to add quantifiers. Quantifiers are words that refer to quantities such as "some" or "all" and tell for how many elements a given predicate is true. o Let P(x) be a predicate (propositional function). o Universally quantified sentence: For all x in the universe of discourse P(x) is true. o Using the universal quantifier  : "  x ϵ D,Q(x).“ universal statement It is defined to be true if, and only if, Q(x) is true for every x in D. It is defined to be false if, and only if, Q(x) is false for at least one x in D. A value for x for which Q(x) is false is called a counterexample to the universal statement. o When all the elements in the universe of discourse can be listed —say x1, x2, ..., xn — it follows that the universal quantification o ∀x P(x) is the same as the conjunction P(x1) ∧ P(x2) ∧ · · · ∧ P(xn) o because this conjunction is true if and only if P(x1), P(x2), ...,P(xn) are all true. o Example: Let the universe of discourse be U = {1,2,3}. Then o ∀x P(x) ≡ P(1)∧ P(2)∧ P(3). Truth and Falsity of Universal Statements Sentence: o All UAJ&K students are smart. o Assume: the domain of discourse of x are UAJ&K students o Translation: o ∀ x Smart(x) o Assume: the universe of discourse are students (all students):
  • 22. 21Discret Structure for BSCS…… Prepared by Abdur-Rehman o ∀ x at(x, UAJ&K)  Smart(x) o Assume: the universe of discourse are people: o ∀ x student(x) Λ at(x, UAJ&K)  Smart(x) o Let D = {1, 2, 3, 4, 5}, and consider the statement ∀x ∈ D, x 2 ≥ x. Show that this statement is true. Check that “x 2 ≥ x” is true for each individual x in D. 1 2 ≥ 1, 2 2 ≥ 2, 3 2 ≥ 3, 4 2 ≥ 4, 5 2 ≥ 5. Hence “∀x ∈ D, x 2 ≥ x” is true. The Existential Quantifier: ∃ o The symbol ∃ denotes “there exists” and is called the existential quantifier. o “There is a student in Math 140” can be written as ∃ a person p such that p is a student in Math 140, or, more formally, ∃p ∈ P such that p is a student in Math 140, where P is the set of all people. o At least one member of the group satisfy the property o Let Q(x) be a predicate and D the domain of x. An existential statement is a statement of the form “∃x ∈ D such that Q(x).” It is defined to be 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 o x in D: o Let T(x) denote x > 5 and x is from Real numbers. o What is the truth value of ∃ x T(x)? o Answer: o Since 10 > 5 is true. Therefore, it is true that ∃ x T(x). o Consider the statement ∃m ∈ Z+ such that m 2 = m. Show that this statement is true. Observe that 1 2 = 1. Thus “m 2 = m” is true for at least one integer m. Hence “∃m ∈ Z such that m 2 = m” is true. o Assume two predicates S(x) and P(x)
  • 23. 22Discret Structure for BSCS…… Prepared by Abdur-Rehman o Universal statements typically tie with implications o All S(x) is P(x) o ∀x ( S(x)  P(x) ) o No S(x) is P(x) o ∀x( S(x)  ¬P(x) ) o Existential statements typically tie with conjunctions o Some S(x) is P(x) o ∃x (S(x)  P(x) ) o Some S(x) is not P(x) o ∃x (S(x)  ¬P(x) ) Quantifiers:Example o There exist an x such that x is black o ∃xb(x) where b(x):x is black. o |x|={ 1. (∀x)(x 2 0) 2. (∀x)(|x| 0) Nested quantifiers o More than one quantifier may be necessary to capture the meaning of a statement in the predicate logic. o Example: Every real number has its corresponding negative. Translation: Assume: a real number is denoted as x and its negative as y A predicate P(x,y) denotes: “x + y =0” Then we can write: (∀x)(∃y)P(x,y) o Translate the following English sentence into logical expression “There is a rational number in between every pair of distinct rational numbers” Use predicate Q(x), which is true when x is a rational number x,y (Q(x)  Q (y)  (x < y)  u (Q(u)  (x < u)  (u < y)))
  • 24. 23Discret Structure for BSCS…… Prepared by Abdur-Rehman Understanding Multiply Quantifiers A college cafeteria line has four stations: salads, main courses, desserts, and beverages. 1. The salad station offers a choice of green salad or fruit salad. 2. The main course station offers spaghetti or fish; 3. The dessert station offers pie or cake; 4. The beverage station offers milk, soda, or coffee. Three students, Uta, Tim, and Yuen, go through the line and make the following choices: o Uta: green salad, spaghetti, pie, milk o Tim: fruit salad, fish, pie, cake, milk, coffee Yuen: spaghetti, fish, pie, soda Understanding Multiply Quantifiers a) ∃ an item I such that ∀ students S, S chose I . b) ∃ a student S such that ∀ items I, S chose I . c) ∃ a student S such that ∀ stations Z, ∃ an item I in Z such that S chose I . d) ∀ students S and ∀ stations Z, ∃ an item I in Z such that S chose I . a) ∃ an item I such that ∀ students S, S chose I . b) ∃ a student S such that ∀ items I, S chose I . c) ∃ a student S such that ∀ stations Z, ∃ an item I in Z such that S chose I . d) ∀ students S and ∀ stations Z, ∃ an item I in Z such that S chose I .
  • 25. 24Discret Structure for BSCS…… Prepared by Abdur-Rehman e) There is an item that was chosen by every student. This is true; every student chose pie. f) There is a student who chose every available item. This is false; no student chose all nine items. g) There is a student who chose at least one item from every station. This is true; both Uta and Tim chose at least one item from every station. h) Every student chose at least one item from every station. This is false; Yuen did not choose a salad. Order of quantifiers o The order of nested quantifiers matters if quantifiers are of different type 1. ∀ people x, ∃ a person y such that x cares y. 2. ∃ a person y such that ∀ people x, x cares y. o ∀ x ∃ y C(x,y) is not the same as ∃y ∀ x C(x,y) 1. Given any person, it is possible to find someone whom that person cares, 2. whereas the second means that there is one amazing individual who is cared by all people. o If one quantifier immediately follows another quantifier of the same type, then the order of the quantifiers does not affect the meaning. o Let Q(x, y, z) be the predicate:“x + y = z.” o ∀x ∀y ∃z Q(x, y, z) True 1. “For all real numbers x and for all real numbers y there is a real number z such that x + y = z,” o ∃z ∀x ∀y Q(x, y, z) False 1. “There is a real number z such that for all real numbers x and for all real numbers y it is true that x + y = z,” 2. because there is no value of z that satisfies the equation x + y = z for all values of x and y.
  • 26. 25Discret Structure for BSCS…… Prepared by Abdur-Rehman Bound and Free Variables o Definitions: If a quantifier is used on the variable x, then this variable is bound. o An occurrence of a variable that is not bound by a quantifier or set equal to a particular value is said to be free. o When all the variables that occur in a propositional function are bound or set to a particular value, then the propositional function is a proposition. Bound and Free Variables-Example o Let P(x, y), the propositional function “x + y = 0”. o The logical variables x and y are free and we cannot evaluate the truth value of P(x, y). o If the value 3 is set to x, then x is no longer a free variable, but P(3, y) is still a propositional function because y is still a free variable. o If we apply the universal quantification to the variable y, the propositional function ∀y P(3, y) is now a proposition. Both variables x and y are no longer free and the truth value of the proposition is false. Negation of quantifiers o ∼(∀x, if P(x) then Q(x)) ≡ ∃x such that P(x) and ∼Q(x). 1. ∀ people p, if p is blond then p has blue eyes. ∃ a person p such that p is blond and p does not have blue eyes. 1. If a computer program has more than 100,000 lines, then it contains a bug. There is at least one computer program that has more than 100,000 lines and does not contain a bug.
  • 27. 26Discret Structure for BSCS…… Prepared by Abdur-Rehman o ∼(∃x ∈ D such that Q(x)) ≡ ∀x ∈ D,∼Q(x). o The negation of an existential statement (“some are”) is logically equivalent to a universal statement (“none are” or “all are not”). 1. Some computer hackers are over 40. No computer hackers are over 40 Or: All computer hackers are 40 or under 1. ∃ a triangle T such that the sum of the angles of T equals 200◦. ∀ triangles T, the sum of the angles of T does not equal 200◦. o English statement: It is not the case that all dogs are fleabags. Translation: ¬ ∀ x Dog(x) Fleabag(x) o Another way to express the same meaning: There is a dog that is not a fleabag. o Translation: ∃ x Dog(x)  ¬ Fleabag(x) Logically equivalent to: ∃ x ¬ ( Dog(x)  Fleabag(x) ) o Conclusion: ¬ ∀ x P (x) is equivalent to ∃ x ¬ P(x) (a) rewrite the statement formally using quantifiers and variables, and (b) write a negation for the statement.
  • 28. 27Discret Structure for BSCS…… Prepared by Abdur-Rehman . Valid & Invalid Arguments o Argument is a sequence of statements ending in a conclusion. o Determination of validity of an argument depends only on the form of an argument, not on its content. “If you have a current password, then you can log onto the network.” p=“You have a current password” q=“You can log onto the network.” p → q p ∴ q where ∴ is the symbol that denotes “therefore.” o An argument is a sequence of statements, and an argument form is a sequence of statement forms(have proposition var.). o All statements in an argument and all statement forms in an argument form, except for the final one, are called premises (or assumptions or hypotheses). o The final statement or statement form is called the conclusion. The symbol ∴, which is read “therefore,” is normally placed just before the conclusion. o To say that an argument form is valid means that no matter what particular statements are substituted for the statement variables in its premises, if the resulting premises are all true, then the conclusion is also true. Conclusion q is valid, when (p1 ∧ p2 ∧ · · · ∧ pn) → q is a tautology. o To say that an argument is valid means that its form is valid. o The truth of its conclusion follows necessarily or by logical form alone from the truth of its premises. o When an argument is valid and its premises are true, the truth of the conclusion is said to be inferred or deduced from the truth of the premises. o If a conclusion “ain’t necessarily so,” then it isn’t a valid deduction. Testing an Argument Form for Validity 1. Identify the premises and conclusion of the argument form. 2. Construct a truth table showing the truth values of all the premises and the conclusion. 3. A row of the truth table in which all the premises are true is called a critical row. If there is a critical row in which the conclusion is false, then it is possible for an argument of the given form to have true premises and a false conclusion, and so the argument form is invalid. If the conclusion in every critical row is true, then the argument form is valid. Testing an Argument Form for Validity
  • 29. 28Discret Structure for BSCS…… Prepared by Abdur-Rehman o p →q ∨ ∼r o q → p ∧ r o ∴ p →r “If 101 is divisible by 3, then 101 2 is divisible by 9. 101 is divisible by 3. Consequently, 101 2 is divisible by 9.” Although the argument is valid, its conclusion is incorrect, because one of the hypotheses is false (“101 is divisible by 3.”). If in the above argument we replace 101 with 102, we could correctly conclude that 102 2 is divisible by 9. Rules of Inference for Propositional Logic o An argument form consisting of two premises and a conclusion is called a syllogism. o The first and second premises are called the major premise and minor premise, respectively. o The most famous form of syllogism in logic is called modus ponens. Modus Ponens o The modus ponens argument form has the following form(“method of affirming”): If p then q. p ∴ q If the sum of the digits of 371,487 is divisible by 3, then 371,487 is divisible by 3. The sum of the digits of 371,487 is divisible by 3. ∴ 371,487 is divisible by 3. o if a conditional statement and the hypothesis of this conditional statement are both true, then the conclusion must also be true.
  • 30. 29Discret Structure for BSCS…… Prepared by Abdur-Rehman Modus Tollens o Modus tollens(“method of denying” (the conclusion is a denial)) has the following form: If p then q. ∼q ∴ ∼p If Zeus is human, then Zeus is mortal. Zeus is not mortal. ∴ Zeus is not human. 1) If Zeus is human, then Zeus is mortal; and (2) Zeus is not mortal. Must Zeus necessarily be nonhuman? Yes! Because, if Zeus were human, then by (1) he would be mortal. But by (2) he is not mortal. Hence, Zeus cannot be human. Translating Propositions Rules of Inference for Propositional Logic o When an argument form involves 10 different propositional variables, to use a truth table to show this argument form is valid requires 2 10 = 1024 different rows. o Rules of inference. First establish the validity of some relatively simple argument forms.
  • 31. 30Discret Structure for BSCS…… Prepared by Abdur-Rehman A rule of inference is a form of argument that is valid. Thus modus ponens and modus tollens are both rules of inference. o Generalization The following argument forms are valid: a. p b. q ∴ p ∨ q ∴ p ∨ q if p is true, then, more generally, “p or q” is true for any other statement q. Anton is a junior. ∴ (more generally) Anton is a junior or Anton is a senior. o At some places with the name Addition It is below freezing now. Therefore, it is below freezing or raining snow. o Specialization The following argument forms are valid: a. p ∧ q b. p ∧ q ∴ p ∴ q These argument forms are used for specializing. Ana knows numerical analysis and Ana knows graph algorithms. ∴ (in particular) Ana knows graph algorithms. o At some places with the name simplification It is below freezing and snowing. Therefore it is below freezing. o Elimination The following argument forms are valid: a. p ∨ q b. p ∨ q ∼q ∼p ∴ p ∴ q o These argument forms say that when you have only two possibilities and you can rule one out, the other must be the case.
  • 32. 31Discret Structure for BSCS…… Prepared by Abdur-Rehman x − 3 =0 or x + 2 = 0. If you also know that x is not negative, then x ≠ −2, so x + 2 ≠ 0. By elimination, you can then conclude that ∴ x − 3 = 0. o At some places with the name Disjunctive Syllogism o Transitivity o The following argument form is valid: p →q q →r ∴ p →r If 18,486 is divisible by 18, then 18,486 is divisible by 9. If 18,486 is divisible by 9, then the sum of the digits of 18,486 is divisible by 9. ∴ If 18,486 is divisible by 18, then the sum of the digits of 18,486 is divisible by 9. o At some places with the name Hypothetical Syllogism o Proof by Division into Cases The following argument form is valid: p ∨ q p →r q →r ∴ r o If you can show that in either case a certain conclusion follows, then this conclusion must also be true. x is positive or x is negative. If x is positive, then x 2 > 0. If x is negative, then x 2 > 0. ∴ x 2 > 0. o Conjunction p q ∴ p ∧ q o Resolution
  • 33. 32Discret Structure for BSCS…… Prepared by Abdur-Rehman p ∨ q ¬p ∨ r ∴ q ∨ r Rules of Inference for Propositional Logic-Example o “If it rains today, then we will not have a barbeque today. If we do not have a barbeque today, then we will have a barbeque tomorrow. Therefore, if it rains today, then we will have a barbeque tomorrow.” p: “It is raining today.” q: “We will not have a barbecue today.” r: “We will have a barbecue tomorrow.” So the argument is of the following form: o “If it rains today, then we will not have a barbeque today. If we do not have a barbeque today, then we will have a barbeque tomorrow. Therefore, if it rains today, then we will have a barbeque tomorrow.” p: “It is raining today.” q: “We will not have a barbecue today.” r: “We will have a barbecue tomorrow.” So the argument is of the following form: o “It is not sunny this afternoon and it is colder than yesterday,” “We will go swimming only if it is sunny,” “If we do not go swimming, then we will take a canoe trip,” and “If we take a canoe trip, then we will be home by sunset” lead to the conclusion “We will be home by sunset.” p: “It is sunny this afternoon ” q: “It is colder than yesterday.”
  • 34. 33Discret Structure for BSCS…… Prepared by Abdur-Rehman r: “We will go swimming .” s:” we will take a canoe trip” t: “We will be home by sunset” Step Reason 1. ¬pΛq Premise 2. ¬p Simplification using (1) 3. r → p Premise 4. ¬r Modus tollens using (2) and (3) 5. ¬r → s Premise 6. s 7. s→t Modus ponens using (4) and (5) Premise 8. t Modus ponens using (6) and (7) Fallacies o A fallacy is an error in reasoning that results in an invalid argument. 1. Using ambiguous premises, and treating them as if they were unambiguous. 2. Circular reasoning (assuming what is to be proved without having derived it from the premises) 3. Jumping to a conclusion (without adequate grounds). o An argument is invalid means that there is an argument of that form whose premises are all true and whose conclusion is false. o A fallacy is an error in reasoning that results in an invalid argument. 1. Using ambiguous premises, and treating them as if they were unambiguous. 2. Circular reasoning (assuming what is to be proved without having derived it from the premises) 3. Jumping to a conclusion (without adequate grounds). o An argument is invalid means that there is an argument of that form whose premises are all true and whose conclusion is false. o Inverse Error 1. The conclusion of the argument would follow from the premises if the premise p →q were replaced by its inverse. Such a replacement is not allowed, however, because a conditional statement is not logically equivalent to its inverse. Inverse error is also known as the fallacy of denying the antecedent. 2. “A cow eats grass. This animal is not a cow, so it won't eat grass.“
  • 35. 34Discret Structure for BSCS…… Prepared by Abdur-Rehman 3. “An odd number is prime, 15 is odd, so 15 is prime" is not fallacious| it is a logically correct argument based on an incorrect hypothesis.” Rules of Inference for Propositional Logic In logic, the words true and valid have very different meanings. A valid argument may have a false conclusion, and an invalid argument may have a true conclusion. Example Arguments with Quantified Statements All men are mortal. valid by modus ponens. But its major premise is false, and so is its conclusion. The argument is invalid by the converse error, but it has a true conclusion.
  • 36. 35Discret Structure for BSCS…… Prepared by Abdur-Rehman Socrates is a man. ∴ Socrates is mortal. o Universal Instantiation If some property is true of everything in a set, then it is true of any particular thing in the set. For all real numbers x, x 1 = x. universal truth r is a particular real number. particular instance ∴ r 1 = r. Universal Modus Ponens o Could be written as “All things that make P(x) true make Q(x) true,” in which case the conclusion would follow by universal instantiation alone. If an integer is even, then its square is even. k is a particular integer that is even. ∴ k 2 is even. o Major premise can be written as ∀x, if x is an even integer then x 2 is even. o Let E(x) be “x is an even integer,” let S(x) be “x 2 is even,” and let k stand for a particular integer that is even. Then the argument has the following form: ∀x, if E(x) then S(x). E(k), for a particular k. ∴ S(k). o This argument has the form of universal modus ponens and is therefore valid. Universal Modus Tollens
  • 37. 36Discret Structure for BSCS…… Prepared by Abdur-Rehman All human beings are mortal. Zeus is not mortal. ∴ Zeus is not human. Solution The major premise can be rewritten as ∀x, if x is human then x is mortal. Let H(x) be “x is human,” let M(x) be “x is mortal,” and let Z stand for Zeus. The argument becomes ∀x, if H(x) then M(x) ∼M(Z) ∴ ∼H(Z). This argument has the form of universal modus tollens and is therefore valid.