53
Mathematics for Computer Engineering Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman Vellore Institute of Technology, Tamilnadu, India [email protected] July 28, 2016 Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT) Higher Mathematics July 28, 2016 1 / 53

Mathematics for Computer Engineering

Embed Size (px)

Citation preview

Page 1: Mathematics for Computer Engineering

Mathematics for Computer Engineering

Faculty: Dr.D.EzhilmaranTeaching Research Associate: M.Adhiyaman

Vellore Institute of Technology, Tamilnadu, India

[email protected]

July 28, 2016

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 1 / 53

Page 2: Mathematics for Computer Engineering

Overview

1 Proof TechniquesBaics of Proof TechniquesImplication, EquivalanceConverse, Inverse, ContrapositiveNegation, Contradiction, StructureDirect Proof, Disproof (In Direct Proof)Natural Number Induction, Structural Induction, Weak/StringInductionRecursion, Well Orderings

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 2 / 53

Page 3: Mathematics for Computer Engineering

Basics of proof techniques

Definition 1. (Proposition)A statement or proposition is a declarative sentence that is either true orfalse (but not both).

For instance, the following are propositions:1. 3 > 1 (true).2. 2 < 4 (true).3. 4 = 7 (false)

However the following are a not propositions:1. x is an even number.2. what is your name?.3. How old are you?.4. Close the door.5. Wow! Wonderful statue.

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 3 / 53

Page 4: Mathematics for Computer Engineering

Definition 2. (Atomic statements)Declarative sentences which cannot be further split into simple sentencesare called atomic statements (also called primary statements or primitivestatements).

Example: p is a prime number

Definition 3. (Compound statements)New statements can be formed from atomic statements through the use ofconnectives such as ”and, but, or etc...” The resulting statement are calledmolecular or compound (composite) statements.

Example: If p is a prime number then, the divisors are p and 1 itself

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 4 / 53

Page 5: Mathematics for Computer Engineering

Definition 4. (truth value)The truth or falsehood of a proposition is called its truth value.

Definition 5. (Truth Table)A table, giving the truth values of a compound statement interms of itscomponent parts, is called a Truth Table.

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 5 / 53

Page 6: Mathematics for Computer Engineering

Definition 6. (Connectives)

Connectives are used for making compound propositions. The main onesare the following (p and q represent given two propositions):

Table 1. Logic Connectives

Name Represented Meaning

Negation ¬p not in pConjunction p ∧ q p and qDisjunction p ∨ q p or q (or both)Implication p → q if p then qBiconditional p ↔ q p if and only if q

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 6 / 53

Page 7: Mathematics for Computer Engineering

The truth value of a compound proposition depends only on the value ofits components. Writing F for false and T for true, we can summarize themeaning of the connectives in the following way:

p q ¬p p ∧ q p ∨ q p → q p ↔ q

T T F T T T TT F F F T F FF T T F T T FF F T F F T T

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 7 / 53

Page 8: Mathematics for Computer Engineering

Definition 7. (Tautology)A proposition is said to be a tautology if its truth value is T for anyassignment of truth values to its components.

Example: The proposition p ∨ ¬p is a tautology.

Definition 8. (Contradiction)A proposition is said to be a contradiction if its truth value is F for anyassignment of truth values to its components.

Example: The proposition p ∧ ¬p is a contradiction.

Definition 9.(Contingency)A proposition that is neither a tautology nor a contradiction is called acontingency.

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 8 / 53

Page 9: Mathematics for Computer Engineering

p ¬p p ∧¬p p ∨¬p

T F F TT F F T

p q p ∨ q ¬p (p ∨ q) ∨ (¬p)

T T T F TT F T F TF T T T TF F F T T

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 9 / 53

Page 10: Mathematics for Computer Engineering

I. Construct the truth table for the following statements

(i) (p → q) ←→ (¬p ∨ q)

(ii) p ∧ (p ∨ q)

(iii) (p → q) → p

(iv) ¬ (p ∧ q) ←→ (¬ p ∨ ¬ q)

(v) (p ∨ ¬q) → q

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 10 / 53

Page 11: Mathematics for Computer Engineering

Solutions

(i) Let S = (p → q) ←→ (¬p ∨ q)

p q ¬p p → q ¬p ∨ q S

T T F T T TT F F F F TF T T T T TF F T T T T

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 11 / 53

Page 12: Mathematics for Computer Engineering

(ii) Let S = p ∧ (p ∨ q)

p q p ∨ q S

T T T TT F T TF T T FF F F F

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 12 / 53

Page 13: Mathematics for Computer Engineering

(iii) Let S = (p → q) → p

p q p → q S

T T T TT F F TF T T FF F T F

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 13 / 53

Page 14: Mathematics for Computer Engineering

(iv) Let S = ¬ (p ∧ q) ←→ ¬ p ∨ ¬ q

p q p ∧ q ¬ (p ∧ q) ¬p ¬q ¬ p ∨ ¬ q S

T T T F F F F TT F F T F T T TF T F T T F T TF F F T T T T T

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 14 / 53

Page 15: Mathematics for Computer Engineering

(v) Let S = (p ∨ ¬q) → q

p q ¬q p ∨ ¬q S

T T F T TT F T T FF T F F TF F T T F

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 15 / 53

Page 16: Mathematics for Computer Engineering

Implications

S.No Formula Name

1 p ∧ q ⇒ p simplificationp ∧ q ⇒ q

2 p ⇒ p ∨ q additionq ⇒ p ∨ q

3 p, q ⇒ p ∧ q4 p, p → q ⇒ q modus ponens5 ¬p, p ∨ q ⇒ q disjunctive syllogism6 ¬q, p → q ⇒ ¬p modus tollens7 p → q , q → r ⇒ p → r hypothetical syllogism

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 16 / 53

Page 17: Mathematics for Computer Engineering

Logical Equivalence

The compound propositions p → q and ¬p ∨ q have the same truthvalues:

p q ¬p p → q ¬p ∨ q

T T F T TT F F F FF T T T TF F T T T

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 17 / 53

Page 18: Mathematics for Computer Engineering

When two compound propositions have the same truth value they arecalled logically equivalent.

For instance p → q and ¬p ∨ q are logically equivalent, and it is denotedby

p → q ⇔ ¬p ∨ q

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 18 / 53

Page 19: Mathematics for Computer Engineering

Definition 10. (Logically Equivalent)Two propositions A and B are logically equivalent precisely when A ⇔ Bis a tautology.

Example: The following propositions are logically equivalent:p ↔ q ⇔ (p → q) ∧ (q → p)

p q p ↔ q p → q q → p (p → q) ∧ (q → p) S

T T T T T T TT F F F T F TF T F T F F TF F T T T T T

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 19 / 53

Page 20: Mathematics for Computer Engineering

Table 2. Logic equivalences

Equivalences Name

p ∧ T ⇔ p Identity lawp ∨ F ⇔ p

p ∨ T ⇔ T Dominent lawp ∧ F ⇔ F

p ∨ T ⇔ T Idempotent lawp ∧ F ⇔ F

p ∨ q ⇔ q ∨ p Commutative lawp ∧ q ⇔ q ∧ p

(p ∨ q) ∨ r ⇔ p ∨ (q ∨ r) Associative law(p ∧ q) ∧ r ⇔ p ∧ (q ∧ r)

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 20 / 53

Page 21: Mathematics for Computer Engineering

Table 2. Logic equivalences (Continued...)

Equivalences Name

(p ∨ q) ∧ r ⇔ (p ∧ r) ∨ (q ∧ r) Distributive law(p ∧ q) ∨ r ⇔ (p ∨ r) ∧ (q ∨ r)

(p ∨ q) ∧ p ⇔ p Absorbtion law(p ∧ q) ∨ p ⇔ p

¬ (p ∧ q) ⇔ ¬ p ∨ ¬ q De morgan’s law¬ (p ∨ q) ⇔ ¬ p ∧ ¬ q

¬ p ∧ p ⇔ F Negation law¬ p ∨ p ⇔ T¬ (¬ p ) ⇔ p

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 21 / 53

Page 22: Mathematics for Computer Engineering

Table 3. Logic equivalences involving implications

Implications

p → q ⇔ ¬p ∨ q

p → q ⇔ ¬q → ¬p

¬(p → q) ⇔ p ∧ ¬q

p ∨ q ⇔ ¬p → q

p ∧ q ⇔ ¬(p → ¬q)

(p → q) ∧ (p → r) ⇔ p → (q ∧ r)

(p → q) ∨ (p → r) ⇔ p → (q ∨ r)

(p → r) ∧ (q → r) ⇔ (p ∨ q)→ r)

(p → r) ∨ (q → r) ⇔ (p ∧ q)→ r)

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 22 / 53

Page 23: Mathematics for Computer Engineering

Table 4. Logic equivalences involving Biconditions

Biconditions

p ↔ q ⇔ (p → q) ∧ (q → p)

p ↔ q ⇔ ¬p ↔ ¬q

p ↔ q ⇔ (p ∧ q) ∨ (¬p ∧ ¬q)

¬(p ↔ q) ⇔ p ↔ ¬q

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 23 / 53

Page 24: Mathematics for Computer Engineering

Converse, Inverse, Contrapositive

Definition 11. (Converse)The converse of a conditional proposition p → q is the proposition q→ p

Definition 12. (Inverse)The inverse of a conditional proposition p → q is the proposition¬ p→¬ q

Definition 13. (Contrapositive)The contrapositive of a conditional proposition p → q is the proposition¬ q→¬ p.

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 24 / 53

Page 25: Mathematics for Computer Engineering

For example

Let us consider the statement,”The crops will be destroyed, if there is a flood.”Let F : there is a flood & C : The crops will be destroyedThe symbolic form is, F → C .Converse (C→F )

i.e., ”if the crops will be destroyed then there is flood.”Inverse (¬F→¬C )

i.e.,”if there is no flood then the crops won’t be destroyed, .”Contrapositive (¬C→¬F )

i.e., ”if the crops won’t be destroyed then there is no flood.”

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 25 / 53

Page 26: Mathematics for Computer Engineering

Negation, Contradiction, Structure

Definition 14. (Negation)Let p be a preposition. The negation of p, denoted by ¬p (also denotedby p), is the statement”it is not the case the p.”The proposition ¬p is read ”not p”. The truth value of the negation ofp,¬p, is the opposite value of the truth value of p.

For exampleFind the negation of the proposition ”Prathap PC runs Linux” and expressthis in simple English.

SolutionThe negation is ”It is not the case that Prathap PC runs Linux.” Thisnegation can be more simply expressed as ”Prathap PC does not runLinux.”

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 26 / 53

Page 27: Mathematics for Computer Engineering

Definition 14. (Contradiction)

A compound proposition that is always true, no matter what the truthvalues of the propositional variables that occur in it, is called a tautology.A compound proposition that is always false is called a contradiction. Acompound proposition that is neither a tautology nor a contradiction iscalled a contingency.

For example

p ¬p p ∨¬p p ∧¬p

T F T FT F T F

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 27 / 53

Page 28: Mathematics for Computer Engineering

Direct Proofs and Disproofs

Nature & Importance of Proofs

In mathematics, a proof is:A sequence of statements that form an argument. Must be correct(well-reasoned, logically valid) and complete (clear, detailed) that rig-orously & undeniably establishes the truth of a mathematical state-ment.

Why must the argument be correct & complete?Correctness prevents us from fooling ourselves. Completeness allowsanyone to verify the result.

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 28 / 53

Page 29: Mathematics for Computer Engineering

Rules of Inference

Rules of inference are patterns of logically valid deductions from hy-potheses to conclusions.

We will review ”inference rules” (i.e., correct & fallacious), and ”proofmethods”.

Inference Rules - General Form

Inference RulePattern establishing that if we know that a set of hypotheses are alltrue, then a certain related conclusion statement is true.Hypothesis 1Hypothesis 2...∴ conclusion ”∴” means ”therefore”

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 29 / 53

Page 30: Mathematics for Computer Engineering

Inference Rules & Implications

Each logical inference rule corresponds to an implication that is a tau-tology.

Hypothesis 1Hypothesis 2... Inference rule∴ conclusion

Corresponding tautology:((Hypoth. 1) ∧ (Hypoth. 2)∧... ) → conclusion

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 30 / 53

Page 31: Mathematics for Computer Engineering

Some Inference Rules

Rule of Addition {p ⇒ p ∨ q}”It is below freezing now. Therefore, it is either below freezing orraining now.”

Rule of Simplification {p ∧ q ⇒ p}”It is below freezing and raining now. Therefore, it is below freezingnow.”

Rule of Conjunction {p, q ⇒ p ∨ q}”It is below freezing. It is raining now. Therefore, it is below freezingand it is raining now.”

Rule of Modus Ponens & Tollens {p, p → q ⇒ q &¬q, p → q ⇒ ¬p}”If it is snows today, then we will go skiing” and ”It is snowingtoday” imply ”We will go skiing”

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 31 / 53

Page 32: Mathematics for Computer Engineering

Rule of hypothetical syllogism {p → q , q → r ⇒ p → r}Rule of disjunctive syllogism {¬p, p ∨ q ⇒ q}

Formal Proofs

A formal proof of a conclusion C , given premises p1, p2...pn consistsof a sequence of steps, each of which applies some inference rule topremises or to previously-proven statements (as hypotheses) to yield anew true statement (the conclusion).

A proof demonstrates that if the premises are true, then the conclusionis true (i.e., valid argument).

Example

Suppose we have the following premises:”It is not sunny and it is cold.””if it is not sunny, we will not swim.””If we do not swim, then we will canoe.””If we canoe, then we will be home early.”

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 32 / 53

Page 33: Mathematics for Computer Engineering

Given these premises, prove the theorem”We will be home early” using inference rules”

Let us adopt the following abbreviations:sunny = ”It is sunny”;cold = ”It is cold”;swim = ”We will swim”;canoe = ”We will canoe”;early = ”We will be home early”.

Then, the premises can be written as:1 ¬ sunny ∨ cold2 ¬ sunny ⇒ ¬ swim3 ¬ swim ⇒ canoe4 canoe ⇒ early

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 33 / 53

Page 34: Mathematics for Computer Engineering

Step Proved by

¬ sunny ∨ cold Premise -1¬ sunny Simplification of 1¬ sunny ⇒ ¬ swim Premise -2¬ swim Modus tollens on 2,3¬ swim ⇒ canoe Premise -3canoe Modus ponens on 4,5canoe ⇒ early Premise -3early Modus ponens on 6,7

Common Fallacies

A fallacy is an inference rule or other proof method that is notlogically valid.− May yield a false conclusion!

Fallacy of affirming the conclusion:− ”p ⇒ q is true, and q is true, so p must be true.” (No, because F⇒ T is true.)

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 34 / 53

Page 35: Mathematics for Computer Engineering

Fallacy of denying the hypothesis:− ”p ⇒ q is true, and p is false, so q must be false.” (No, againbecause F ⇒ T is true.)

Example

”If you do every problem in this book, then you will learn discretemathematics. You learned discrete mathematics.”p: ”You did every problem in this book”q: ”You learned discrete mathematics”

Fallacy of affirming the conclusion:p ⇒ q and q does not imply p

Fallacy of denying the hypothesis:p ⇒ q and ¬p does not imply ¬q

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 35 / 53

Page 36: Mathematics for Computer Engineering

Inference Rules for Quantifiers

Universal instantiation {∀xP(x)⇒ P(o)}Universal generalization {P(g)⇒ ∀xP(x)}Existential instantiation {∃xP(x)⇒ P(c)}Existential generalization {P(o)⇒ ∃xP(x)}

Example - 1”Everyone in this discrete math class has taken a course in computerscience” and ”Marla is a student in this class” imply ”Marla has taken acourse in computer science”D(x): ”x is in discrete math class”C (x): ”x has taken a course in computer science”

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 36 / 53

Page 37: Mathematics for Computer Engineering

Step Proved by

∀ x (D(x) ⇒C(x)) Premise -1D(Marla) ⇒ C (Marla) Univ. instantiationD(Marla) Premise -2C(Marla) Modus tollens on 2,3

Example - 2”A student in this class has not read the book” and ”Everyone in this classpassed the first exam” imply ”Someone who passed the first exam has notread the book”C (x): ”x is in this class”B(x): ”x has read the book”P(x): ”x passed the first exam”

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 37 / 53

Page 38: Mathematics for Computer Engineering

Step Proved by

∃x (C(x) ∨¬ B(x)) Premise -1(C(a)∨¬ B(a)) Exist. instantiationC(a) Simplication on 2∀x (C(x) Rightarrow P(x)) Premise -2C(a) ⇒ P(a) Univ.instantiationP(a) Modus ponens on 3,5¬ B(a) Simplication on 2P(a) ∧¬ B(a) Conjunction on 6,7∃x (P(x)∧¬ B(x)) Exist. generalization

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 38 / 53

Page 39: Mathematics for Computer Engineering

Example -3

Is this argument correct or incorrect?− ”All TAs compose easy quizzes. Ramesh is a TA. Therefore,Ramesh composes easy quizzes.”

First, separate the premises from conclusions:− Premise -1: All TAs compose easy quizzes.− Premise -2: Ramesh is a TA.− Conclusion: Ramesh composes easy quizzes. Next, re-render theexample in logic notation.

Premise -1: All TAs compose easy quizzes.− Let U.D. = all people− Let T (x) = ”x is a TA”− Let E (x) = ”x composes easy quizzes”− Then premise-1 says: ∀x , T (x)⇒ E (x)

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 39 / 53

Page 40: Mathematics for Computer Engineering

Premise -2: Ramesh is a TA.Let R = RameshThen Premise -2 says: T(R)

Conclusion says: E(R)

The argument is correct, because it can be reduced to a sequence ofapplications of valid inference rules, as follows

Statement How obtained

∃x (T(x) ⇒ E(x)) Premise -1T(Ramesh) ⇒ E(Ramesh) Univ. instantiationT(Ramesh) Premise - 2E(Ramesh) Modus ponens on 2,3

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 40 / 53

Page 41: Mathematics for Computer Engineering

Example-4

Correct or incorrect?At least one of the 280 students in the class is intelligent. Y is astudent of this class. Therefore, Y is intelligent.

First: Separate premises/conclusion, & translate to logic:− Premises:(1) ∃ x InClass(x) ∧ Intelligent(x)(2) InClass(Y)− Conclusion: Intelligent(Y)

No, the argument is invalid; we can disprove it with acounter-example, as follows:

Consider a case where there is only one intelligent student X in theclass, and X 6= Y .−Then the premise ∃x in InClass(x) ∧ Intelligent(x) is true, byexistential generalization of InClass(x) ∧ Intelligent(x) − But theconclusion Intelligent(Y) is false, since X is the only intelligentstudent in the class, and Y 6= X .

Therefore, the premises do not imply the conclusion.

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 41 / 53

Page 42: Mathematics for Computer Engineering

Proof Methods

Proving p ⇒ q− Direct proof: Assume p is true, and prove q.− Indirect proof: Assume ¬q, and prove ¬p.− Trivial proof: Prove q true.− Vacuous proof: Prove p is true.

Proving p− Proof by contradiction: Prove ¬p ⇒ (r ∧ ¬r)(r ∧ ¬r); therefore ¬p must be false.

Prove (a ∨ b)⇒ p− proof by cases: prove (a⇒ p) and (b ⇒ p)

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 42 / 53

Page 43: Mathematics for Computer Engineering

DefinitionAn integer n is called odd iff n = 2k + 1 for some integer k ; n is eveniff n = 2k for some k .

AxiomsEvery integer is either odd or even.

Theorem(For all numbers n) If n is an odd integer, then n2 is an odd integer.

ProofIf n is odd, then n = 2k + 1 for some integer k . Thus,n2 = (2k + 1)2 = 4k2 + 4k + 1 = 2(2k2 + 2k) + 1. Therefore n2 is ofthe form 2j + 1 (with j the integer 2k2 + 2k), thus n2 is odd.

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 43 / 53

Page 44: Mathematics for Computer Engineering

Example

DefinitionA real number r is rational if there exist integers p and q 6= 0, with nocommon factors other than 1 (i.e., gcd(p,q)=1), such that r = p

q . Areal number that is not rational is called irrational.

TheoremProve that the sum of two rational numbers is rational.

Indirect Proof

Proving p ⇒ q− Indirect proof : Assume ¬q, and prove ¬p.

Theorem(For all integers n) If 3n + 2 is odd, then n is odd.

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 44 / 53

Page 45: Mathematics for Computer Engineering

ProofSuppose that the conclusion is false, i.e., that n is even. Then n = 2kfor some integer k. Then 3n + 2 = 3(2k) + 2 = 6k + 2 = 2(3k + 1).Thus 3n + 2 is even, because it equals 2j for integer j = 3k + 1. So3n + 2 is not odd. We have shown that ¬(n is odd) ⇒ ¬(3n + 2 isodd), thus its contra-positive (3n + 2 is odd) (n is odd) is also true.

Example

TheoremProve that if n is an integer and n2 is odd, then n is odd.

Trivial Proof− Trivial proof : Prove q true.

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 45 / 53

Page 46: Mathematics for Computer Engineering

Example

Theorem(For integers n) If n is the sum of two prime numbers, then either n isodd or n is even.

ProofAny integer n is either odd or even. So the conclusion of theimplication is true regardless of the truth of the hypothesis. Thus theimplication is true trivially.

Vacuous Proof

Proving p ⇒ q− Vacuous proof : Prove ¬p is true.

Example

Theorem(For all n) If n is both odd and even, then n2 = n + n.

ProofThe statement ”n is both odd and even” is necessarily false, since nonumber can be both odd and even. So, the theorem is vacuously true.

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 46 / 53

Page 47: Mathematics for Computer Engineering

Proof by Contradiction

Proving p− Assume ¬p, and prove that ¬p ⇒ (r ∧ ¬r)− (r ∧ ¬r) is a trivial contradiction, equal to F− Thus ¬p ⇒ F is true only if ¬p = F

Example

TheoremProve that

√2 is irrational

Example

Prove that the sum of a rational number and an irrational number isalways irrational.

First, you have to understand exactly what the question is asking youto prove:”For all real numbers x , y , if x is rational and y is irrational, thenx + y is irrational.” ∀x , y : Rational(x) ∧ Irrational(y) ⇒Irrational(x+y)

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 47 / 53

Page 48: Mathematics for Computer Engineering

Next, think back to the definitions of the terms used in the statementof the theorem:−∀ reals r : Rational (r) ↔ ∃ Interger (i) ∧ Integer (j): r i

j−∀ reals r : Irrational (r) ↔ ¬ Rational (r)

You almost always need the definitions of the terms in order to provethe theorem!

Next, lets go through one valid proof

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 48 / 53

Page 49: Mathematics for Computer Engineering

Mathematical Induction

Mathematical induction is a form of mathematical proof.

Just because a rule, pattern, or formula seems to work for severalvalues of n, you cannot simply decide that it is valid for all values of nwithout going through a legitimate proof.

The Principle of Mathematical InductionLet Pn be a statement involving the positive integer n. If

1 P1 is true, and2 The truth of Pk implies the truth of Pk + 1 , for every positive integer

k, then Pn must be true for all integers n.

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 49 / 53

Page 50: Mathematics for Computer Engineering

Example-1

Use mathematical induction to prove the following formula.Sn = 1 + 3 + 5 + 7 + .....(2n − 1) = n2

First, we must show that the formula works for n = 1.

1 For n = 1S1 = 1 = 12

The second part of mathematical induction has two steps. The firststep is to assume that the formula is valid for some integer k . Thesecond step is to use this assumption to prove that the formula isvalid for the next integer, k + 1.

2 Assume Sk = 1 + 3 + 5 + 7 + ..... + (2k − 1) = k2

is true, show that Sk+1 = (k + 1)2

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 50 / 53

Page 51: Mathematics for Computer Engineering

Sk+1 = 1 + 3 + 5 + 7 + ... + (2k − 1) + [2(k + 1)− 1]= [1 + 3 + 5 + 7 + ... + (2k − 1)] + (2k + 2− 1)= Sk + (2k + 1)= k2 + 2k + 1= (k + 1)2

Example-2

Use mathematical induction to prove the following formula

Sn = 12 + 22 + 32 + 42 + ..... + n2 = n(n+1)(2n+1)6

1 Show n = 1 is trueSn = 12 = 1(2)(3)

6

2 Assume that Sk is trueSk = 12 + 22 + 32 + 42 + ..... + k2 = k(k+1)(2k+1)

6

show that Sk+1 = (k+1)(k+2)(2k+3)6 is true.

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 51 / 53

Page 52: Mathematics for Computer Engineering

Sk+1 = 12 + 22 + 32 + 42 + ..... + k2

= k(k+1)(2k+1)6 + (k + 1)2

= k(k+1)(2k+1)+6(k+1)2

6

= (k+1)[k(2k+1)+6(k+1)]6

= (k+1)[2k2+7k+6]6

= (k+1)(k+2)(2k+3)6

Exercise

1 Conjecture a formula for the sum of the first n positive odd integers.Then prove your conjecture using mathematical induction.

2 Use mathematical induction to show that1 + 2 + 22 + .... + 2n = 2n+1 − 1 for all non-negative integers n.

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 52 / 53

Page 53: Mathematics for Computer Engineering

Next module will be updated soon...

For further queriesProf.Dr.D.Ezhilmaran, Ph.D.,Assistant Professor (Senior),Department of Mathematics,Vellore Institute of Technology, Tamilnadu, India.E-mail.ID : [email protected]

Faculty: Dr.D.Ezhilmaran Teaching Research Associate: M.Adhiyaman (VIT)Higher Mathematics July 28, 2016 53 / 53