SlideShare a Scribd company logo
1 of 45
Unit 1- Logic
Exercises
• Which of these sentences are propositions? What are the truth values of
those that are propositions?
a) Boston is the capital of Massachusetts.
b) Miami is the capital of Florida.
c) 2 + 3 = 5.
d) 5 + 7 = 10.
e) x + 2 = 11.
f ) Answer this question
2
• Which of these are propositions? What are the truth values of those that
are propositions?
a) Do not pass go.
b) What time is it?
c) There are no black flies in Maine
d) 4 + x = 5.
e) The moon is made of green cheese.
f ) 2n ≥ 100.
3
• What is the negation of each of these propositions?
a) Mei has an MP3 player.
b) There is no pollution in New Jersey.
c) 2 + 1 = 3.
d) The summer in Maine is hot and sunny.
4
• What is the negation of each of these propositions?
a) Jennifer and Teja are friends.
b) There are 13 items in a baker’s dozen.
c) Abby sent more than 100 text messages every
day.
d) 121 is a perfect square.
5
• What is the negation of each of these propositions?
a) Steve has more than 100 GB free disk space on his
laptop.
b) Zach blocks e-mails and texts from Jennifer.
c) 7 · 11 · 13 = 999.
d) Diane rode her bicycle 100 miles on Sunday.
6
• Suppose that Smartphone A has 256MB RAM and 32GB ROM, and the
resolution of its camera is 8 MP; Smartphone B has 288 MB RAM and 64
GB ROM, and the resolution of its camera is 4 MP; and Smartphone C has
128 MB RAM and 32 GB ROM, and the resolution of its camera is 5 MP.
Determine the truth value of each of these propositions.
• a) Smartphone B has the most RAM of these three smartphones.
• b) Smartphone C has more ROM or a higher resolution camera than
Smartphone B.
• c) Smartphone B has more RAM, more ROM, and a higher resolution
camera than Smartphone A.
• d) If Smartphone B has more RAM and more ROM than Smartphone C,
then it also has a higher resolution camera.
• e) Smartphone A has more RAM than Smartphone B if and only if
Smartphone B has more RAM than Smartphone A
7
• Let p and q be the propositions
• p : I bought a lottery ticket this week.
• q : I won the million dollar jackpot.
• Express each of these propositions as an English sentence.
• a) ¬p b) p ∨ q c) p → q
• d) p ∧ q e) p ↔ q f ) ¬p →¬q
• g) ¬q ∧¬p h) ¬p ∨ (p ∧ q)
8
• Let p and q be the propositions “Swimming at the New Jersey
shore is allowed” and “Sharks have been spotted near the shore,”
respectively. Express each of these compound propositions as an
English sentence.
a) ¬q b) p ∧ q c) ¬p ∨ q
d) p →¬q e) ¬q → p f ) ¬p →¬q
g) p ↔¬q h) ¬p ∧ (p∨ ¬q)
9
• Let p and q be the propositions “The election is decided” and
“The votes have been counted,” respectively. Express each of
these compound propositions as an English sentence.
a) ¬p b) p ∨ q
c) ¬p ∧ q d) q → p
e) ¬q →¬p f ) ¬p →¬q
g) p ↔ q h) ¬q ∨ (¬p ∧ q)
10
• Let p, q, and r be the propositions
• p :You have the flu.
• q :You miss the final examination.
• r :You pass the course.
• Express each of these propositions as an English sentence.
a) p → q b) ¬q ↔ r
c) q →¬r d) p ∨ q ∨ r
e) (p →¬r) ∨ (q →¬r)
f ) (p ∧ q) ∨ (¬q ∧ r)
11
• Construct a truth table for each of these compound propositions.
a) p ∧¬p b) p ∨¬p
c) (p ∨¬q) → q d) (p ∨ q) → (p ∧ q)
e) (p → q) ↔ (¬q →¬p)
f ) (p → q) → (q → p)
12
• Construct a truth table for each of these compound propositions.
• a) p →¬p b) p ↔¬p
• c) p ⊕ (p ∨ q) d) (p ∧ q) → (p ∨ q)
• e) (q →¬p) ↔ (p ↔ q)
• f ) (p ↔ q) ⊕ (p ↔¬q)
13
• Construct a truth table for each of these compound propositions.
• a) (p ∨ q) → (p ⊕ q) b) (p ⊕ q) → (p ∧ q)
• c) (p ∨ q) ⊕ (p ∧ q) d) (p ↔ q) ⊕ (¬p ↔ q)
• e) (p ↔ q) ⊕ (¬p ↔¬r)
• f ) (p ⊕ q) → (p ⊕¬q)
14
• Construct a truth table for each of these compound propositions.
• a) p ⊕ p b) p ⊕¬p
• c) p ⊕¬q d) ¬p ⊕¬q
• e) (p ⊕ q) ∨ (p ⊕¬q) f ) (p ⊕ q) ∧ (p ⊕¬q)
15
• Construct a truth table for each of these compound propositions.
• a) p →¬q b) ¬p ↔ q
• c) (p → q) ∨ (¬p → q) d) (p → q) ∧ (¬p → q)
• e) (p ↔ q) ∨ (¬p ↔ q)
• f ) (¬p ↔¬q) ↔ (p ↔ q)
16
• Construct a truth table for each of these compound propositions.
• a) (p ∨ q) ∨ r b) (p ∨ q) ∧ r
• c) (p ∧ q) ∨ r d) (p ∧ q) ∧ r
• e) (p ∨ q)∧¬r f ) (p ∧ q)∨¬r
17
• Construct a truth table for each of these compound propositions.
• a) p → (¬q ∨ r)
• b) ¬p → (q → r)
• c) (p → q) ∨ (¬p → r)
• d) (p → q) ∧ (¬p → r)
• e) (p ↔ q) ∨ (¬q ↔ r)
• f ) (¬p ↔¬q) ↔ (q ↔ r)
18
Construct a truth table for
•((p → q) → r) → s
•(p ↔ q) ↔ (r ↔ s)
19
• Use De-Morgans law to express the negations of “Miguel has a cell
phone and he has a laptop computer” and “Heather will go to
concert or Steve will go to concert”
20
• Show that ¬(p → q) and p ∧¬q are logically equivalent using laws
• Show that ¬(p ∨ (¬p ∧ q)) and ¬p ∧¬q are logically equivalent
by developing a series of logical equivalences.
• Show that (p ∧ q) → (p ∨ q) is a tautology.
21
• Show that each of these conditional statements is a tautology by
using truth tables.
• a) (p ∧ q) → p b) p → (p ∨ q)
• c) ¬p → (p → q d) (p ∧ q) → (p → q)
• e) ¬(p → q) → p f ) ¬(p → q)→¬q
22
• Show that each of these conditional statements is a tautology by
using truth tables.
• a) [¬p ∧ (p ∨ q)] → q
• b) [(p → q) ∧ (q → r)] → (p → r)
• c) [p ∧ (p → q)] → q
• d) [(p ∨ q) ∧ (p → r) ∧ (q → r)] → r
23
Subject - predicates
• x is greater than 3” has two parts.
• The first part, the variable x, is the subject of the statement.
• The second part—the predicate, “is greater than 3”—refers to a
property that the subject of the statement can have.
• We can denote the statement “x is greater than 3” by P(x), where
P denotes the predicate “is greater than 3” and x is the variable.
• The statement P(x) is also said to be the value of the
propositional function P at x
24
• Let P(x) denote the statement “x > 3.” What are the truth values
of P(4) and P(2)?
25
Try this 
1. Let P(x) denote the statement “x ≤ 4.” What are these truth
values?
a) P(0) b) P(4) c) P(6)
2. Let P(x) be the statement “the word x contains the letter a.”
What are these truth values?
a) P(orange) b) P(lemon)
c) P(true) d) P(false)
26
• Let R(x, y, z) denote the statement`‘ x + y = z.” When values are
assigned to the variables x, y, and z, this statement has a truth
value. What are the truth values of the propositions R(1, 2, 3) and
R(0, 0, 1)?
27
• Let A(x) denote the statement “Computer x is under attack by an
intruder.” Suppose that of the computers on campus, only CS2 and
MATH1 are currently under attack by intruders. What are truth
values of A(CS1), A(CS2), and A(MATH1)?
28
• Let Q(x, y) denote the statement “x = y + 3.” What are the truth
values of the propositions Q(1, 2) and Q(3, 0)?
29
• if x > 0 then x := x + 1
30
• Let A(c, n) denote the statement “Computer c is connected to
network n,” where c is a variable representing a computer and n is
a variable representing a network. Suppose that the computer
MATH1 is connected to network CAMPUS2, but not to network
CAMPUS1. What are the values of A(MATH1, CAMPUS1) and
A(MATH1, CAMPUS2)?
31
Try this one 
State the value of x after the statement ifP(x) then x := 1 is
executed, where P(x) is the statement “x > 1,” if the value of x
when this statement is reached is
• a) x = 0 b) x = 1
• c) x = 2
32
Preconditions and postcondition
• The statements that describe valid input are known as
preconditions
• The conditions that the output should satisfy when the program
has run are known as postconditions.
33
• Consider the following program, designed to interchange the
values of two variables x and y.
temp := x
x := y
y := temp
• Find predicates that we can use as the precondition and the
postcondition to verify the correctness of this program.
34
Quantifiers
• Quantification expresses the extent to which a predicate
is true over a range of elements.
• Two types of quantification
• Universal quantification: which tells us that a predicate is
true for every element under consideration
• Existential quantification, which tells us that there is one or
more element under consideration for which the predicate is
true.
• The area of logic that deals with predicates and
quantifiers is called the predicate calculus
35
• The universal quantification of P(x) is the statement
• “P(x) for all values of x in the domain.”
• The notation ∀ x P(x) denotes the universal quantification of P(x).
Here ∀ is called the universal quantifier.
• We read ∀xP(x) as “ for all x P(x)” or “for every xP(x).”
• An element for which P(x) is false is called a counterexample of
∀xP(x).
36
37
example
• Let P(x) be the statement “x + 1 > x.” What is the truth value of
the quantification ∀xP(x), where the domain consists of all real
numbers?
• Let Q(x) be the statement “x < 2.” What is the truth value of the
quantification ∀xQ(x), where the domain consists of all real
numbers?
38
• When all the elements in the domain can be listed—say, x1, x2, . .
., xn—it follows that the universal quantification ∀xP(x) is the
same as the conjunction
P(x1) ∧ P(x2) ∧ · · · ∧ P(xn),
because this conjunction is true if and only if P(x1), P(x2), . . . , P
(xn) are all true.
39
• What is the truth value of ∀x P(x), where P(x) is the statement
“x2 < 10” and the domain consists of the positive integers not
exceeding 4?
• What does the statement ∀x N(x) mean if N(x) is “Computer x is
connected to the network” and the domain consists of all
computers on campus?
40
Existential quantification
• There exists an element x in the domain such that p(x)
• There is an x such that P(x)
• There is at least one x such that P(x)
• the statement ∃xP(x) is false if and only if there is no element x in
the domain for which P(x) is true.
• That is, ∃xP(x) is false if and only if P(x) is false for every element
of the domain
41
examples
• Let P(x) denote the statement “x > 3.” What is the truth value of
the quantification ∃xP(x), where the domain consists of all real
numbers?
42
• Let Q(x) denote the statement “x = x + 1.”What is the truth value
of the quantification ∃x Q(x), where the domain consists of all
real numbers?
43
• When all elements in the domain can be listed—say, x1, x2, . . . ,
xn—the existential quantification ∃xP(x) is the same as the
disjunction
P(x1) ∨ P(x2) ∨ · · · ∨ P(xn),
because this disjunction is true if and only if at least one of P(x1),
P(x2), . . . , P (xn) is true.
44
• What is the truth value of ∃x P(x), where P(x) is the statement
“x2 > 10” and the universe of discourse consists of the positive
integers not exceeding 4?
45

More Related Content

What's hot

Discrete Structure Lecture #5 & 6.pdf
Discrete Structure Lecture #5 & 6.pdfDiscrete Structure Lecture #5 & 6.pdf
Discrete Structure Lecture #5 & 6.pdfMuhammadUmerIhtisham
 
Quantifiers and its Types
Quantifiers and its TypesQuantifiers and its Types
Quantifiers and its TypesHumayunNaseer4
 
Predicates and Quantifiers
Predicates and Quantifiers Predicates and Quantifiers
Predicates and Quantifiers Istiak Ahmed
 
Chapter-3: DIRECT PROOF AND PROOF BY CONTRAPOSITIVE
Chapter-3: DIRECT PROOF AND PROOF BY CONTRAPOSITIVEChapter-3: DIRECT PROOF AND PROOF BY CONTRAPOSITIVE
Chapter-3: DIRECT PROOF AND PROOF BY CONTRAPOSITIVEnszakir
 
Testing for mixtures by seeking components
Testing for mixtures by seeking componentsTesting for mixtures by seeking components
Testing for mixtures by seeking componentsChristian Robert
 
Boolean Programs and Quantified Propositional Proof System -
Boolean Programs and Quantified Propositional Proof System - Boolean Programs and Quantified Propositional Proof System -
Boolean Programs and Quantified Propositional Proof System - Michael Soltys
 
Predicates and quantifiers presentation topics
Predicates  and quantifiers  presentation topicsPredicates  and quantifiers  presentation topics
Predicates and quantifiers presentation topicsR.h. Himel
 
Delayed acceptance for Metropolis-Hastings algorithms
Delayed acceptance for Metropolis-Hastings algorithmsDelayed acceptance for Metropolis-Hastings algorithms
Delayed acceptance for Metropolis-Hastings algorithmsChristian Robert
 
Chapter-4: More on Direct Proof and Proof by Contrapositive
Chapter-4: More on Direct Proof and Proof by ContrapositiveChapter-4: More on Direct Proof and Proof by Contrapositive
Chapter-4: More on Direct Proof and Proof by Contrapositivenszakir
 
Imc2020 day1&amp;2 problems&amp;solutions
Imc2020 day1&amp;2 problems&amp;solutionsImc2020 day1&amp;2 problems&amp;solutions
Imc2020 day1&amp;2 problems&amp;solutionsChristos Loizos
 
Presentation mathmatic 3
Presentation mathmatic 3Presentation mathmatic 3
Presentation mathmatic 3nashaat algrara
 
Kolev skalna2018 article-exact_solutiontoa_parametricline
Kolev skalna2018 article-exact_solutiontoa_parametriclineKolev skalna2018 article-exact_solutiontoa_parametricline
Kolev skalna2018 article-exact_solutiontoa_parametriclineAlina Barbulescu
 

What's hot (20)

Course notes2summer2012
Course notes2summer2012Course notes2summer2012
Course notes2summer2012
 
Discrete Structure Lecture #5 & 6.pdf
Discrete Structure Lecture #5 & 6.pdfDiscrete Structure Lecture #5 & 6.pdf
Discrete Structure Lecture #5 & 6.pdf
 
Quantifiers and its Types
Quantifiers and its TypesQuantifiers and its Types
Quantifiers and its Types
 
Formal Logic - Lesson 8 - Predicates and Quantifiers
Formal Logic - Lesson 8 - Predicates and QuantifiersFormal Logic - Lesson 8 - Predicates and Quantifiers
Formal Logic - Lesson 8 - Predicates and Quantifiers
 
Predicate &amp; quantifier
Predicate &amp; quantifierPredicate &amp; quantifier
Predicate &amp; quantifier
 
Predicates and Quantifiers
Predicates and Quantifiers Predicates and Quantifiers
Predicates and Quantifiers
 
Math
MathMath
Math
 
Chapter-3: DIRECT PROOF AND PROOF BY CONTRAPOSITIVE
Chapter-3: DIRECT PROOF AND PROOF BY CONTRAPOSITIVEChapter-3: DIRECT PROOF AND PROOF BY CONTRAPOSITIVE
Chapter-3: DIRECT PROOF AND PROOF BY CONTRAPOSITIVE
 
Testing for mixtures by seeking components
Testing for mixtures by seeking componentsTesting for mixtures by seeking components
Testing for mixtures by seeking components
 
Boolean Programs and Quantified Propositional Proof System -
Boolean Programs and Quantified Propositional Proof System - Boolean Programs and Quantified Propositional Proof System -
Boolean Programs and Quantified Propositional Proof System -
 
Discrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order LogicDiscrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order Logic
 
Predicates and quantifiers presentation topics
Predicates  and quantifiers  presentation topicsPredicates  and quantifiers  presentation topics
Predicates and quantifiers presentation topics
 
Delayed acceptance for Metropolis-Hastings algorithms
Delayed acceptance for Metropolis-Hastings algorithmsDelayed acceptance for Metropolis-Hastings algorithms
Delayed acceptance for Metropolis-Hastings algorithms
 
Chapter-4: More on Direct Proof and Proof by Contrapositive
Chapter-4: More on Direct Proof and Proof by ContrapositiveChapter-4: More on Direct Proof and Proof by Contrapositive
Chapter-4: More on Direct Proof and Proof by Contrapositive
 
Quantum Search and Quantum Learning
Quantum Search and Quantum Learning Quantum Search and Quantum Learning
Quantum Search and Quantum Learning
 
Final
Final Final
Final
 
O2
O2O2
O2
 
Imc2020 day1&amp;2 problems&amp;solutions
Imc2020 day1&amp;2 problems&amp;solutionsImc2020 day1&amp;2 problems&amp;solutions
Imc2020 day1&amp;2 problems&amp;solutions
 
Presentation mathmatic 3
Presentation mathmatic 3Presentation mathmatic 3
Presentation mathmatic 3
 
Kolev skalna2018 article-exact_solutiontoa_parametricline
Kolev skalna2018 article-exact_solutiontoa_parametriclineKolev skalna2018 article-exact_solutiontoa_parametricline
Kolev skalna2018 article-exact_solutiontoa_parametricline
 

Viewers also liked

第一週學習單:教學用Ppt
第一週學習單:教學用Ppt第一週學習單:教學用Ppt
第一週學習單:教學用PptWade Jin
 
Unit 6 input modeling problems
Unit 6 input modeling problemsUnit 6 input modeling problems
Unit 6 input modeling problemsraksharao
 
Unit 1 introduction contd
Unit 1 introduction contdUnit 1 introduction contd
Unit 1 introduction contdraksharao
 
java-Unit4 chap2- awt controls and layout managers of applet
java-Unit4 chap2- awt controls and layout managers of appletjava-Unit4 chap2- awt controls and layout managers of applet
java-Unit4 chap2- awt controls and layout managers of appletraksharao
 
Logic Notes
Logic NotesLogic Notes
Logic Notesacavis
 
Simulation & Modeling - Smilulation Queuing System
Simulation & Modeling - Smilulation Queuing SystemSimulation & Modeling - Smilulation Queuing System
Simulation & Modeling - Smilulation Queuing SystemMaruf Rion
 
Queuing model
Queuing model Queuing model
Queuing model goyalrama
 
Unit 4 queuing models
Unit 4 queuing modelsUnit 4 queuing models
Unit 4 queuing modelsraksharao
 
Truth Vs. Validity
Truth Vs. ValidityTruth Vs. Validity
Truth Vs. ValidityLisaMD4061
 
QUEUING THEORY
QUEUING THEORYQUEUING THEORY
QUEUING THEORYavtarsingh
 

Viewers also liked (14)

Laws in disceret
Laws in disceretLaws in disceret
Laws in disceret
 
第一週學習單:教學用Ppt
第一週學習單:教學用Ppt第一週學習單:教學用Ppt
第一週學習單:教學用Ppt
 
Logic
LogicLogic
Logic
 
Logic
LogicLogic
Logic
 
Unit 6 input modeling problems
Unit 6 input modeling problemsUnit 6 input modeling problems
Unit 6 input modeling problems
 
Unit 1 introduction contd
Unit 1 introduction contdUnit 1 introduction contd
Unit 1 introduction contd
 
java-Unit4 chap2- awt controls and layout managers of applet
java-Unit4 chap2- awt controls and layout managers of appletjava-Unit4 chap2- awt controls and layout managers of applet
java-Unit4 chap2- awt controls and layout managers of applet
 
Notes for logic
Notes for logicNotes for logic
Notes for logic
 
Logic Notes
Logic NotesLogic Notes
Logic Notes
 
Simulation & Modeling - Smilulation Queuing System
Simulation & Modeling - Smilulation Queuing SystemSimulation & Modeling - Smilulation Queuing System
Simulation & Modeling - Smilulation Queuing System
 
Queuing model
Queuing model Queuing model
Queuing model
 
Unit 4 queuing models
Unit 4 queuing modelsUnit 4 queuing models
Unit 4 queuing models
 
Truth Vs. Validity
Truth Vs. ValidityTruth Vs. Validity
Truth Vs. Validity
 
QUEUING THEORY
QUEUING THEORYQUEUING THEORY
QUEUING THEORY
 

Similar to Logic Exercises Unit 1

Discrete Math Chapter 1 :The Foundations: Logic and Proofs
Discrete Math Chapter 1 :The Foundations: Logic and ProofsDiscrete Math Chapter 1 :The Foundations: Logic and Proofs
Discrete Math Chapter 1 :The Foundations: Logic and ProofsAmr Rashed
 
Algorithmic foundations.docx
Algorithmic foundations.docxAlgorithmic foundations.docx
Algorithmic foundations.docxedwin orege
 
1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.ppt1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.pptTejasAditya2
 
Discreate structure presentation introduction
Discreate structure presentation introductionDiscreate structure presentation introduction
Discreate structure presentation introductionyashirraza123
 
Discrete Mathematics - All chapters
Discrete Mathematics - All chapters Discrete Mathematics - All chapters
Discrete Mathematics - All chapters Omnia A. Abdullah
 
Unit III Knowledge Representation in AI K.Sundar,AP/CSE,VEC
Unit III  Knowledge Representation in AI   K.Sundar,AP/CSE,VECUnit III  Knowledge Representation in AI   K.Sundar,AP/CSE,VEC
Unit III Knowledge Representation in AI K.Sundar,AP/CSE,VECsundarKanagaraj1
 
Otter 2016-11-28-01-ss
Otter 2016-11-28-01-ssOtter 2016-11-28-01-ss
Otter 2016-11-28-01-ssRuo Ando
 
Large-scale computation without sacrificing expressiveness
Large-scale computation without sacrificing expressivenessLarge-scale computation without sacrificing expressiveness
Large-scale computation without sacrificing expressivenessSangjin Han
 
Talk at CIRM on Poisson equation and debiasing techniques
Talk at CIRM on Poisson equation and debiasing techniquesTalk at CIRM on Poisson equation and debiasing techniques
Talk at CIRM on Poisson equation and debiasing techniquesPierre Jacob
 
A Family Of Extragradient Methods For Solving Equilibrium Problems
A Family Of Extragradient Methods For Solving Equilibrium ProblemsA Family Of Extragradient Methods For Solving Equilibrium Problems
A Family Of Extragradient Methods For Solving Equilibrium ProblemsYasmine Anino
 
Ch8-LogicalRepresentationAndReasoning.ppt
Ch8-LogicalRepresentationAndReasoning.pptCh8-LogicalRepresentationAndReasoning.ppt
Ch8-LogicalRepresentationAndReasoning.pptFELICIALILIANJ
 

Similar to Logic Exercises Unit 1 (20)

Discrete Math Chapter 1 :The Foundations: Logic and Proofs
Discrete Math Chapter 1 :The Foundations: Logic and ProofsDiscrete Math Chapter 1 :The Foundations: Logic and Proofs
Discrete Math Chapter 1 :The Foundations: Logic and Proofs
 
Algorithmic foundations.docx
Algorithmic foundations.docxAlgorithmic foundations.docx
Algorithmic foundations.docx
 
1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.ppt1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.ppt
 
Discreate structure presentation introduction
Discreate structure presentation introductionDiscreate structure presentation introduction
Discreate structure presentation introduction
 
Discrete Mathematics - All chapters
Discrete Mathematics - All chapters Discrete Mathematics - All chapters
Discrete Mathematics - All chapters
 
Abstract machines for great good
Abstract machines for great goodAbstract machines for great good
Abstract machines for great good
 
Unit III Knowledge Representation in AI K.Sundar,AP/CSE,VEC
Unit III  Knowledge Representation in AI   K.Sundar,AP/CSE,VECUnit III  Knowledge Representation in AI   K.Sundar,AP/CSE,VEC
Unit III Knowledge Representation in AI K.Sundar,AP/CSE,VEC
 
1. Logic and Proofs.ppt
1. Logic and Proofs.ppt1. Logic and Proofs.ppt
1. Logic and Proofs.ppt
 
PTSP PPT.pdf
PTSP PPT.pdfPTSP PPT.pdf
PTSP PPT.pdf
 
jalalam.ppt
jalalam.pptjalalam.ppt
jalalam.ppt
 
Tutorial_2.pdf
Tutorial_2.pdfTutorial_2.pdf
Tutorial_2.pdf
 
09
0909
09
 
Otter 2016-11-28-01-ss
Otter 2016-11-28-01-ssOtter 2016-11-28-01-ss
Otter 2016-11-28-01-ss
 
Large-scale computation without sacrificing expressiveness
Large-scale computation without sacrificing expressivenessLarge-scale computation without sacrificing expressiveness
Large-scale computation without sacrificing expressiveness
 
Talk at CIRM on Poisson equation and debiasing techniques
Talk at CIRM on Poisson equation and debiasing techniquesTalk at CIRM on Poisson equation and debiasing techniques
Talk at CIRM on Poisson equation and debiasing techniques
 
Per3 logika
Per3 logikaPer3 logika
Per3 logika
 
chapter9.ppt
chapter9.pptchapter9.ppt
chapter9.ppt
 
X02PredCalculus.ppt
X02PredCalculus.pptX02PredCalculus.ppt
X02PredCalculus.ppt
 
A Family Of Extragradient Methods For Solving Equilibrium Problems
A Family Of Extragradient Methods For Solving Equilibrium ProblemsA Family Of Extragradient Methods For Solving Equilibrium Problems
A Family Of Extragradient Methods For Solving Equilibrium Problems
 
Ch8-LogicalRepresentationAndReasoning.ppt
Ch8-LogicalRepresentationAndReasoning.pptCh8-LogicalRepresentationAndReasoning.ppt
Ch8-LogicalRepresentationAndReasoning.ppt
 

More from raksharao

Unit 1 rules of inference
Unit 1  rules of inferenceUnit 1  rules of inference
Unit 1 rules of inferenceraksharao
 
Unit 1 introduction to proofs
Unit 1  introduction to proofsUnit 1  introduction to proofs
Unit 1 introduction to proofsraksharao
 
Unit 7 verification &amp; validation
Unit 7 verification &amp; validationUnit 7 verification &amp; validation
Unit 7 verification &amp; validationraksharao
 
Unit 6 input modeling
Unit 6 input modeling Unit 6 input modeling
Unit 6 input modeling raksharao
 
Unit 5 general principles, simulation software
Unit 5 general principles, simulation softwareUnit 5 general principles, simulation software
Unit 5 general principles, simulation softwareraksharao
 
Unit 5 general principles, simulation software problems
Unit 5  general principles, simulation software problemsUnit 5  general principles, simulation software problems
Unit 5 general principles, simulation software problemsraksharao
 
Unit 4 queuing models problems
Unit 4 queuing models problemsUnit 4 queuing models problems
Unit 4 queuing models problemsraksharao
 
Unit 3 random number generation, random-variate generation
Unit 3 random number generation, random-variate generationUnit 3 random number generation, random-variate generation
Unit 3 random number generation, random-variate generationraksharao
 
Unit 1 introduction
Unit 1 introductionUnit 1 introduction
Unit 1 introductionraksharao
 
Module1 part2
Module1 part2Module1 part2
Module1 part2raksharao
 
Module1 Mobile Computing Architecture
Module1 Mobile Computing ArchitectureModule1 Mobile Computing Architecture
Module1 Mobile Computing Architectureraksharao
 
java Unit4 chapter1 applets
java Unit4 chapter1 appletsjava Unit4 chapter1 applets
java Unit4 chapter1 appletsraksharao
 
Chap3 multi threaded programming
Chap3 multi threaded programmingChap3 multi threaded programming
Chap3 multi threaded programmingraksharao
 
Java-Unit 3- Chap2 exception handling
Java-Unit 3- Chap2 exception handlingJava-Unit 3- Chap2 exception handling
Java-Unit 3- Chap2 exception handlingraksharao
 
FIT-Unit3 chapter2- Computer Languages
FIT-Unit3 chapter2- Computer LanguagesFIT-Unit3 chapter2- Computer Languages
FIT-Unit3 chapter2- Computer Languagesraksharao
 
FIT-Unit3 chapter 1 -computer program
FIT-Unit3 chapter 1 -computer programFIT-Unit3 chapter 1 -computer program
FIT-Unit3 chapter 1 -computer programraksharao
 
output devices
output devicesoutput devices
output devicesraksharao
 
Chap2 exception handling
Chap2 exception handlingChap2 exception handling
Chap2 exception handlingraksharao
 
Chap2 input devices
Chap2 input devicesChap2 input devices
Chap2 input devicesraksharao
 

More from raksharao (20)

Unit 1 rules of inference
Unit 1  rules of inferenceUnit 1  rules of inference
Unit 1 rules of inference
 
Unit 1 introduction to proofs
Unit 1  introduction to proofsUnit 1  introduction to proofs
Unit 1 introduction to proofs
 
Unit 7 verification &amp; validation
Unit 7 verification &amp; validationUnit 7 verification &amp; validation
Unit 7 verification &amp; validation
 
Unit 6 input modeling
Unit 6 input modeling Unit 6 input modeling
Unit 6 input modeling
 
Unit 5 general principles, simulation software
Unit 5 general principles, simulation softwareUnit 5 general principles, simulation software
Unit 5 general principles, simulation software
 
Unit 5 general principles, simulation software problems
Unit 5  general principles, simulation software problemsUnit 5  general principles, simulation software problems
Unit 5 general principles, simulation software problems
 
Unit 4 queuing models problems
Unit 4 queuing models problemsUnit 4 queuing models problems
Unit 4 queuing models problems
 
Unit 3 random number generation, random-variate generation
Unit 3 random number generation, random-variate generationUnit 3 random number generation, random-variate generation
Unit 3 random number generation, random-variate generation
 
Unit 1 introduction
Unit 1 introductionUnit 1 introduction
Unit 1 introduction
 
Module1 part2
Module1 part2Module1 part2
Module1 part2
 
Module1 Mobile Computing Architecture
Module1 Mobile Computing ArchitectureModule1 Mobile Computing Architecture
Module1 Mobile Computing Architecture
 
java Unit4 chapter1 applets
java Unit4 chapter1 appletsjava Unit4 chapter1 applets
java Unit4 chapter1 applets
 
Chap3 multi threaded programming
Chap3 multi threaded programmingChap3 multi threaded programming
Chap3 multi threaded programming
 
Java-Unit 3- Chap2 exception handling
Java-Unit 3- Chap2 exception handlingJava-Unit 3- Chap2 exception handling
Java-Unit 3- Chap2 exception handling
 
FIT-Unit3 chapter2- Computer Languages
FIT-Unit3 chapter2- Computer LanguagesFIT-Unit3 chapter2- Computer Languages
FIT-Unit3 chapter2- Computer Languages
 
FIT-Unit3 chapter 1 -computer program
FIT-Unit3 chapter 1 -computer programFIT-Unit3 chapter 1 -computer program
FIT-Unit3 chapter 1 -computer program
 
output devices
output devicesoutput devices
output devices
 
Chap2 exception handling
Chap2 exception handlingChap2 exception handling
Chap2 exception handling
 
C#unit4
C#unit4C#unit4
C#unit4
 
Chap2 input devices
Chap2 input devicesChap2 input devices
Chap2 input devices
 

Recently uploaded

ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 

Recently uploaded (20)

ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 

Logic Exercises Unit 1

  • 2. • Which of these sentences are propositions? What are the truth values of those that are propositions? a) Boston is the capital of Massachusetts. b) Miami is the capital of Florida. c) 2 + 3 = 5. d) 5 + 7 = 10. e) x + 2 = 11. f ) Answer this question 2
  • 3. • Which of these are propositions? What are the truth values of those that are propositions? a) Do not pass go. b) What time is it? c) There are no black flies in Maine d) 4 + x = 5. e) The moon is made of green cheese. f ) 2n ≥ 100. 3
  • 4. • What is the negation of each of these propositions? a) Mei has an MP3 player. b) There is no pollution in New Jersey. c) 2 + 1 = 3. d) The summer in Maine is hot and sunny. 4
  • 5. • What is the negation of each of these propositions? a) Jennifer and Teja are friends. b) There are 13 items in a baker’s dozen. c) Abby sent more than 100 text messages every day. d) 121 is a perfect square. 5
  • 6. • What is the negation of each of these propositions? a) Steve has more than 100 GB free disk space on his laptop. b) Zach blocks e-mails and texts from Jennifer. c) 7 · 11 · 13 = 999. d) Diane rode her bicycle 100 miles on Sunday. 6
  • 7. • Suppose that Smartphone A has 256MB RAM and 32GB ROM, and the resolution of its camera is 8 MP; Smartphone B has 288 MB RAM and 64 GB ROM, and the resolution of its camera is 4 MP; and Smartphone C has 128 MB RAM and 32 GB ROM, and the resolution of its camera is 5 MP. Determine the truth value of each of these propositions. • a) Smartphone B has the most RAM of these three smartphones. • b) Smartphone C has more ROM or a higher resolution camera than Smartphone B. • c) Smartphone B has more RAM, more ROM, and a higher resolution camera than Smartphone A. • d) If Smartphone B has more RAM and more ROM than Smartphone C, then it also has a higher resolution camera. • e) Smartphone A has more RAM than Smartphone B if and only if Smartphone B has more RAM than Smartphone A 7
  • 8. • Let p and q be the propositions • p : I bought a lottery ticket this week. • q : I won the million dollar jackpot. • Express each of these propositions as an English sentence. • a) ¬p b) p ∨ q c) p → q • d) p ∧ q e) p ↔ q f ) ¬p →¬q • g) ¬q ∧¬p h) ¬p ∨ (p ∧ q) 8
  • 9. • Let p and q be the propositions “Swimming at the New Jersey shore is allowed” and “Sharks have been spotted near the shore,” respectively. Express each of these compound propositions as an English sentence. a) ¬q b) p ∧ q c) ¬p ∨ q d) p →¬q e) ¬q → p f ) ¬p →¬q g) p ↔¬q h) ¬p ∧ (p∨ ¬q) 9
  • 10. • Let p and q be the propositions “The election is decided” and “The votes have been counted,” respectively. Express each of these compound propositions as an English sentence. a) ¬p b) p ∨ q c) ¬p ∧ q d) q → p e) ¬q →¬p f ) ¬p →¬q g) p ↔ q h) ¬q ∨ (¬p ∧ q) 10
  • 11. • Let p, q, and r be the propositions • p :You have the flu. • q :You miss the final examination. • r :You pass the course. • Express each of these propositions as an English sentence. a) p → q b) ¬q ↔ r c) q →¬r d) p ∨ q ∨ r e) (p →¬r) ∨ (q →¬r) f ) (p ∧ q) ∨ (¬q ∧ r) 11
  • 12. • Construct a truth table for each of these compound propositions. a) p ∧¬p b) p ∨¬p c) (p ∨¬q) → q d) (p ∨ q) → (p ∧ q) e) (p → q) ↔ (¬q →¬p) f ) (p → q) → (q → p) 12
  • 13. • Construct a truth table for each of these compound propositions. • a) p →¬p b) p ↔¬p • c) p ⊕ (p ∨ q) d) (p ∧ q) → (p ∨ q) • e) (q →¬p) ↔ (p ↔ q) • f ) (p ↔ q) ⊕ (p ↔¬q) 13
  • 14. • Construct a truth table for each of these compound propositions. • a) (p ∨ q) → (p ⊕ q) b) (p ⊕ q) → (p ∧ q) • c) (p ∨ q) ⊕ (p ∧ q) d) (p ↔ q) ⊕ (¬p ↔ q) • e) (p ↔ q) ⊕ (¬p ↔¬r) • f ) (p ⊕ q) → (p ⊕¬q) 14
  • 15. • Construct a truth table for each of these compound propositions. • a) p ⊕ p b) p ⊕¬p • c) p ⊕¬q d) ¬p ⊕¬q • e) (p ⊕ q) ∨ (p ⊕¬q) f ) (p ⊕ q) ∧ (p ⊕¬q) 15
  • 16. • Construct a truth table for each of these compound propositions. • a) p →¬q b) ¬p ↔ q • c) (p → q) ∨ (¬p → q) d) (p → q) ∧ (¬p → q) • e) (p ↔ q) ∨ (¬p ↔ q) • f ) (¬p ↔¬q) ↔ (p ↔ q) 16
  • 17. • Construct a truth table for each of these compound propositions. • a) (p ∨ q) ∨ r b) (p ∨ q) ∧ r • c) (p ∧ q) ∨ r d) (p ∧ q) ∧ r • e) (p ∨ q)∧¬r f ) (p ∧ q)∨¬r 17
  • 18. • Construct a truth table for each of these compound propositions. • a) p → (¬q ∨ r) • b) ¬p → (q → r) • c) (p → q) ∨ (¬p → r) • d) (p → q) ∧ (¬p → r) • e) (p ↔ q) ∨ (¬q ↔ r) • f ) (¬p ↔¬q) ↔ (q ↔ r) 18
  • 19. Construct a truth table for •((p → q) → r) → s •(p ↔ q) ↔ (r ↔ s) 19
  • 20. • Use De-Morgans law to express the negations of “Miguel has a cell phone and he has a laptop computer” and “Heather will go to concert or Steve will go to concert” 20
  • 21. • Show that ¬(p → q) and p ∧¬q are logically equivalent using laws • Show that ¬(p ∨ (¬p ∧ q)) and ¬p ∧¬q are logically equivalent by developing a series of logical equivalences. • Show that (p ∧ q) → (p ∨ q) is a tautology. 21
  • 22. • Show that each of these conditional statements is a tautology by using truth tables. • a) (p ∧ q) → p b) p → (p ∨ q) • c) ¬p → (p → q d) (p ∧ q) → (p → q) • e) ¬(p → q) → p f ) ¬(p → q)→¬q 22
  • 23. • Show that each of these conditional statements is a tautology by using truth tables. • a) [¬p ∧ (p ∨ q)] → q • b) [(p → q) ∧ (q → r)] → (p → r) • c) [p ∧ (p → q)] → q • d) [(p ∨ q) ∧ (p → r) ∧ (q → r)] → r 23
  • 24. Subject - predicates • x is greater than 3” has two parts. • The first part, the variable x, is the subject of the statement. • The second part—the predicate, “is greater than 3”—refers to a property that the subject of the statement can have. • We can denote the statement “x is greater than 3” by P(x), where P denotes the predicate “is greater than 3” and x is the variable. • The statement P(x) is also said to be the value of the propositional function P at x 24
  • 25. • Let P(x) denote the statement “x > 3.” What are the truth values of P(4) and P(2)? 25
  • 26. Try this  1. Let P(x) denote the statement “x ≤ 4.” What are these truth values? a) P(0) b) P(4) c) P(6) 2. Let P(x) be the statement “the word x contains the letter a.” What are these truth values? a) P(orange) b) P(lemon) c) P(true) d) P(false) 26
  • 27. • Let R(x, y, z) denote the statement`‘ x + y = z.” When values are assigned to the variables x, y, and z, this statement has a truth value. What are the truth values of the propositions R(1, 2, 3) and R(0, 0, 1)? 27
  • 28. • Let A(x) denote the statement “Computer x is under attack by an intruder.” Suppose that of the computers on campus, only CS2 and MATH1 are currently under attack by intruders. What are truth values of A(CS1), A(CS2), and A(MATH1)? 28
  • 29. • Let Q(x, y) denote the statement “x = y + 3.” What are the truth values of the propositions Q(1, 2) and Q(3, 0)? 29
  • 30. • if x > 0 then x := x + 1 30
  • 31. • Let A(c, n) denote the statement “Computer c is connected to network n,” where c is a variable representing a computer and n is a variable representing a network. Suppose that the computer MATH1 is connected to network CAMPUS2, but not to network CAMPUS1. What are the values of A(MATH1, CAMPUS1) and A(MATH1, CAMPUS2)? 31
  • 32. Try this one  State the value of x after the statement ifP(x) then x := 1 is executed, where P(x) is the statement “x > 1,” if the value of x when this statement is reached is • a) x = 0 b) x = 1 • c) x = 2 32
  • 33. Preconditions and postcondition • The statements that describe valid input are known as preconditions • The conditions that the output should satisfy when the program has run are known as postconditions. 33
  • 34. • Consider the following program, designed to interchange the values of two variables x and y. temp := x x := y y := temp • Find predicates that we can use as the precondition and the postcondition to verify the correctness of this program. 34
  • 35. Quantifiers • Quantification expresses the extent to which a predicate is true over a range of elements. • Two types of quantification • Universal quantification: which tells us that a predicate is true for every element under consideration • Existential quantification, which tells us that there is one or more element under consideration for which the predicate is true. • The area of logic that deals with predicates and quantifiers is called the predicate calculus 35
  • 36. • The universal quantification of P(x) is the statement • “P(x) for all values of x in the domain.” • The notation ∀ x P(x) denotes the universal quantification of P(x). Here ∀ is called the universal quantifier. • We read ∀xP(x) as “ for all x P(x)” or “for every xP(x).” • An element for which P(x) is false is called a counterexample of ∀xP(x). 36
  • 37. 37
  • 38. example • Let P(x) be the statement “x + 1 > x.” What is the truth value of the quantification ∀xP(x), where the domain consists of all real numbers? • Let Q(x) be the statement “x < 2.” What is the truth value of the quantification ∀xQ(x), where the domain consists of all real numbers? 38
  • 39. • When all the elements in the domain can be listed—say, x1, x2, . . ., xn—it follows that the universal quantification ∀xP(x) is the same as the conjunction P(x1) ∧ P(x2) ∧ · · · ∧ P(xn), because this conjunction is true if and only if P(x1), P(x2), . . . , P (xn) are all true. 39
  • 40. • What is the truth value of ∀x P(x), where P(x) is the statement “x2 < 10” and the domain consists of the positive integers not exceeding 4? • What does the statement ∀x N(x) mean if N(x) is “Computer x is connected to the network” and the domain consists of all computers on campus? 40
  • 41. Existential quantification • There exists an element x in the domain such that p(x) • There is an x such that P(x) • There is at least one x such that P(x) • the statement ∃xP(x) is false if and only if there is no element x in the domain for which P(x) is true. • That is, ∃xP(x) is false if and only if P(x) is false for every element of the domain 41
  • 42. examples • Let P(x) denote the statement “x > 3.” What is the truth value of the quantification ∃xP(x), where the domain consists of all real numbers? 42
  • 43. • Let Q(x) denote the statement “x = x + 1.”What is the truth value of the quantification ∃x Q(x), where the domain consists of all real numbers? 43
  • 44. • When all elements in the domain can be listed—say, x1, x2, . . . , xn—the existential quantification ∃xP(x) is the same as the disjunction P(x1) ∨ P(x2) ∨ · · · ∨ P(xn), because this disjunction is true if and only if at least one of P(x1), P(x2), . . . , P (xn) is true. 44
  • 45. • What is the truth value of ∃x P(x), where P(x) is the statement “x2 > 10” and the universe of discourse consists of the positive integers not exceeding 4? 45