






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Logic – its subject is reasoning; it measures the value of reasoning; whether something is correct; it is a set of rules to draw inferences.
Note: The form of logic is nothing to do with the content of the subject to which it is applied. Example 1:
All CS graduate students know Discrete Math. Everyone who knows discrete math knows the fundamentals of mathematical logic. Therefore, all CS graduate students know the fundamentals of mathematical logic.
No even natural number has a square root. 4 is an even number. Therefore, 4 does not have a square root.
Note: The conclusion is false but the reasoning is valid (logically correct); i.e., whenever the premises are true, the conclusion must be true.
Note: Here the conclusion is true and the reasoning is valid, but is not sound because the first premise is not true. A valid reasoning called sound if the premises are true.
Question: Does logic help us to find out the truth of these statements? NO.
Then why do we need to know mathematical logic?
To check if the computer programs are correct; (logical analysis). Mathematical Induction is one of the general methods in logical analysis to prove that an argument is correct.
p: John is tall. q: John is a CS Graduate Student. r: p and q ≡ John is tall and he is a CS graduate student.
Truth Table: It describes (defines) precisely and concisely the truth values ( meaning ) of compound propositions.
Note: Two propositions are logically equivalent if they have the same truth value.
Compound proposition P consists of elementary propositions p 1 ,…, pn:
p q (^) p∧q p∨q p exor q (^) ¬p T T T T F F T F F T T F F T F T T T F F F F F T
“∧” = “and”, “∨”= “inclusive or”, “ exor ”= “exclusive or”, “¬”= “not”.
Example 2:
p1 : John is tall. p2 : John is a CS student. p3 : John wrote a computer program and implemented the “lucky key” problem.
Either John is tall and it is not the case that he is a CS student or he wrote a computer program to implement the “lucky key” problem:
P: (p 1 ∧ ¬p (^) 2) ∨ p (^3) If all three are true, the value of P is (T ∧ F) ∨ T = T.
Different forms of “and”.
q: He will solve the “lucky key” problem.
“ p ” is called the antecedent (hypothesis), if-part. “ q ” is called the consequent (conclusion), then-part.
Example 3:
John may take CS4883 only if he has sophomore, junior, or senior standing ≡ if John takes CS4883, then he has sophomore, junior, or senior standing.
When you talk, I will enjoy ≡ I will enjoy when you talk.
A sufficient condition for John to pass CS3653 is
that he should make at least a C in this course ≡ If John makes at least a C in CS3653, then he will pass it.
The hypothesis expresses the sufficient condition.
John is taking CS 3653, then John has already taken the prerequisite courses.
The conclusion expresses a necessary condition. Implication Connectives:
p q p^ →^ q p^ ↔ q T T T T T F F F F T T F F F T T
Not making a claim about q if p is false, so p^ →^ q is nothing but to say q is true if p is true.
p iff q ≡ p if and only if q≡ biconditional proposition
≡ equivalence connective, ≡ p is a necessary and sufficient condition for q. ≡¬(p exor q)
let p: 3 < 9 q: 10 < 17
The statement if 3 < 9, then 10 < 17, or the statement p Æ q is true because both p and q are true.
not separated by parentheses, they are evaluated from left to right.
Example 4: ¬p∧q∧s →^ s∧q ¬p (¬p∧q) & s∧q (¬p∧q) ∧s ((¬p∧q) ∧s) →^ ( s∧q)
Definition: Compound propositions P and Q are made up of the propositions p1,…,pn. It is said that P and Q
are logically equivalent, P ≡ Q, if given any truth values pi’s, either P and Q are both true or P and Q are both false.
Example 5:
p q p^ →^ q q∨¬p T T T T T F F F F T T T F F T T
q ∨ ¬p ≡ p → q (these are logically equivalent) Show that
p → q ≡ ¬p → ¬q (Contrapositive or Transposition of p → q) Proof: p q p^ →^ q ¬q→¬p T T T T T F F F F T T T F F T T
Example 6: Show that the following propositions are equivalent.
Sol’n: Define p: it is Sunday. q: I am not on call. s: I’ll drive to a short trip.