Computer Science CPSC 418 / Math 318

27
CPSC 418 / Math 318 Writing Proofs Computer Science

Transcript of Computer Science CPSC 418 / Math 318

CPSC 418 / Math 318Writing Proofs

Computer Science

How To Approach A Mathematical Proofhttps://people.ucalgary.ca/~rscheidl/crypto/handouts/Tutorial/proof-approach.pdf

Proof Writing Tipshttps://people.ucalgary.ca/~rscheidl/crypto/handouts/Tutorial/Proof%20writing%20tips.pdf

Sample Proofshttps://people.ucalgary.ca/~rscheidl/crypto/handouts/Tutorial/proofs.pdf

The incidence of breast cancer is 1%. A specific test for breast cancer has a false negative rate of 10% (ie. it is correct 90% of the time when the patient has cancer) and a false positive rate of 9% (ie. it is correct 91% of the time when the patient doesn’t have cancer). A patient takes this test and gets a positive result. What are the odds they have breast cancer?

The incidence of breast cancer is 1%. A specific test for breast cancer has a false negative rate of 10% (ie. it is correct 90% of the time when the patient has cancer) and a false positive rate of 9% (ie. it is correct 91% of the time when the patient doesn’t have cancer). A patient takes this test and gets a positive result. What are the odds they have breast cancer? https://www.youtube.com/watch?v=lG4VkPoG3ko

Gigerenzer, Gerd, et al. "Helping doctors and patients make sense of health statistics." Psychological science in the public interest 8.2 (2007): 53-96.

https://www.amazon.com/KNEX-Building-Construction-Education-Exclusive/dp/B00I2UZXZW

Proof Building Blocks

6

AssertionsX ≠ Y

Z is an integerP is a prime

ConnectivesOr Introduction

Associativity of AdditionMathematical Induction

Proof Building Blocks

7

AssertionsX ≠ Y

Z is an integerP is a prime

(Axioms explicitly stated by the question)

ConnectivesOr Introduction

Associativity of AdditionMathematical Induction

(Axioms implied by the question)

Know YourComponents

Patterns of Proofs

9

Proof by Construction

Proof by Contradiction

Proof by Contrapositive

Proof by Induction

Proof By Construction

A = B,And here’s why...

Proof By Construction

Assertion: At least one prime number is even.

Proof By Construction

Assertion: At least one prime number is even.Proof: 2.

Proof By Construction

https://commons.wikimedia.org/wiki/File:Pythagoras-proof-anim.svg

Proof By Contradiction

A = B?Assume A ≠ B instead.

(...consequences...)

Contradiction of a Premise!

Proof by Contradiction

Assertion: There are an infinite number of primes.

Proof by Contradiction

Assertion: There are an infinite number of primes.Proof: ● Assume a finite number instead.● Collect them all in an ordered list: { p1, p2, … pn }● Calculate 1 + ∏ pk● Not divisible by any prime, must be prime.● Bigger than pn .● Contradiction!

Proof by Contradiction?

Assertion: A = BProof: ● Assume A ≠ B● (proof by construction)● Contradiction!

Mix and Match

Divide andConquer

Proof By Contrapositive

A ⇒ B¬B ⇒ ¬A

Proof By Contrapositive via Proof By Contradiction

A ⇒ BAssume ¬B

Assume AB (premise 1)

⚔ (assumption 1)

¬A (non-contradiction)

¬B ⇒ ¬A (premise 1 and contradiction)

Proof by Contrapositive

Modus tollens is in the form, If P, then Q; not Q; therefore not P. Thus, whenever the consequent (Q) gets denied in the second premise, it leads to denying the antecedent (P) in the conclusion. Such operation ought to prevail with probabilistic premises, as well (e.g., Oaksford and Chater, 2001, 2009; Evans et al., 2015), whereby a probable consequent (Qp) may be denied without its probability warranting transposition onto a non-probabilistic antecedent (P). For example, if all red cars (P) have a 95% chance of getting stolen (Q ≥ 0.95) and we learn of a Lamborghini with a lesser probability of so disappearing (not Q ≥ 0.95), it is logical to conclude that the Lamborghini is not red (not P).

Perezgonzalez JD. Commentary: The Need for Bayesian Hypothesis Testing in Psychological Science. Front Psychol. 2017;8:1434. Published 2017 Aug 23. doi:10.3389/fpsyg.2017.01434 https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5572393/

Proof By Induction

Show A holds for all B,where B is a countable set.

Proof by Induction

Least Residues

Show that b ≡ a (mod n), where 0 ≤ a < n

Proof by Induction, Base Case

Least Residues0 ≤ b < n

b ≡ a (mod n)b = qn + a

q = 0b = a

Proof by Induction, Inductive Case 1

Least Residuesqn < b

Proven b = (q-1)n + a

b - n = qn - n + ab - n = (q-1)n + a

b ≡ b - n ≡ a

Proof by Induction, Inductive Case 2

Least Residuesb < qn ≤ 0

Proven b = (q+1)n + a

b + n = qn + n + ab + n = (q+1)n + a

b ≡ b + n ≡ a