Upload
armando-holden
View
21
Download
1
Embed Size (px)
DESCRIPTION
Lecture 11. 1.5, 3.1 Methods of Proof. Last time in 1.5. To prove theorems we use rules of inference such as: p, p q, therefore, q NOT q, pq, therefore NOT p. p AND q, therefore p FORALL x P(x), therefore for arbitrary c, P(c) EXISTS x P(x), therefore for some c, P(c) - PowerPoint PPT Presentation
Citation preview
Lecture 11
1.5, 3.1 Methods of Proof
Last time in 1.5To prove theorems we use rules of inference such as:p, pq, therefore, q NOT q, pq, therefore NOT p.p AND q, therefore p
FORALL x P(x), therefore for arbitrary c, P(c)EXISTS x P(x), therefore for some c, P(c)
It is easy to make mistakes, make sure that:1) All premises pi are true when you prove (p1 AND p2 AND...pn) q 2) Every rule of inference you use is correct.
Some proof strategies:To proof pq1) direct proof: assume p is true, use rules to prove that q is true.2) indirect proof, assume q is NOT true, use rules to prove p is NOT true.To prove p is true:3) By contradiction: assume p is NOT true, use rules to show that NOT pF i.e. it leads to a contradiction.
Vacuous –Trivial Proofs
Lets say we want to prove pq but the premise p can be shown to be false!Then pq is always true because (FT) = T and (FF) = T.This is a vacuous prove.
Old example: prove that for any set S:
Proof: The following must be shown to be true: However: the empty set does not contain any elementsand the premise is always false. Therefore the implicationmust always be true!
S
( )x x x S
Trivial Proof: We want to prove pq, and we can show that q is true.Then, because (TT) = T and (FT) = T we have proven the implication.
Example: P(n): a>=b a^n >= b^n for positive integers.Is P(0) true?P(0): a^0 >= b^0 is equivalent to 1>=1. Therefore, q is true and thus pq is true.
Example Indirect Proof
Prove that: if n is an integer and n^2 is odd, then n is odd.Direct prove is hard in this case.
Indirect proof: Assume NOT q : n is even.n = 2kn^2 = 4k^2 = 2(2k^2) is even, is not odd.Thus NOT q NOT p, pq
Example of Proof by Contradictiondef: rational number is a number that can be written as a/b for integers a,b, where b should not be 0. Reals that are not rational are irrational.
sqrt(2) is irrational. (note: we are not proving an implication now, although we could have written it as: if x=sqrt(2) x = irrational.)
Assume sqrt(2) is not irrational.sqrt(2) = a/b where there is no common divisor (otherwise divide by this number).2 = a^2 / b^22b^2 = a^2a^2 = evena = evena = 2c2b^2 = 4c^2b^2 = 2c^2b^2 = evenb=evenboth a and b can be divided by 2 (contradiction). p r r
1.5An indirect proof is in fact also a prove by contradiction:
Assume p = T and (NOT q) = Tindirect prove: (NOT q) (NOT p)Therefore: p AND (NOT p) = T, contradiction
Proof by cases:
(p1 OR p2 OR p3 ... OR pn) q (if at least one of the premises hold, q follows)
This is equivalent to (p1q) AND (p2q) AND ... AND (pnq)
Example: Prove x^2 >= 0
p1: x<0 x^2 >=0p2: x=0 x^2 >=0p3: x>0 x^2 >=0
Equivalence Proofs
These are bidirectional statements of the form pq.Equivalent to proving 2 cases:
pq AND qp.
Example: Prove integer n is odd if and only if (iff) n^2 is odd.Lecture 10: if n is odd n^2 is oddLecture 11: if n^2 is odd n is odd.
Lists of Equivalences
p1 p2p3.....pnThis means they are all equivalent.There are C(n,2) pairs to prove!
There is however a smarter way: Design one path through all pi’s that can bring you from any pi to any other then you are done:
p1p2
p3
p4p5
p6
Theorems with Quantifiers
Existence proofs: Proofs of the form: There exists an element x such that.....
these proofs may be constructive (construct some x) or non-constructive.
( )xP x
Uniqueness: Proofs of the form: there exists a unique element x such that...
! ( ) ( ( ) ( ( )))xP x x P x y y x P y
Example: Prove that ! ( 0)x y x y proof: for arbitrary x, y=-x makes the proposition true. Is it unique.Assume it is not true and show contradiction:Let say there is a r such that x+r=0 but r is not –x.Then it follows that x+r=x+y r=y which contradicts our assumption.
3.1
self reading
The Halting ProblemIs it possible to design an algorithm that always predicts for a given program Pand a given input to that program I, if it will stop or run forever?
Proposition: there isn’t
Proof. Assume there is such a predictor H(P,I). A program can be represented as a bit-string, and therefore as input to another program. Imagine a program P that can take itself as input. H(P,P) should predict if it stops: H = 1 if it stops, H=0 if it doesn’t stop.Define a new program K(P) as follows:that is K(P) loops forever if H(P,P) = 1 K(P) = stops if H(P,P) = 0
Can H(K,K) predict whether this program stops?K(K) loops forever if H(K,K) = 1K(K) stops if H(K,K) = 0
So H(K,K) does not predict correctly which is in contradiction with the assumption!
Sequences & Summations
definition: A sequence is a function from the set of integers to a set S:a1,a2,a3,.... (function from 1,2... a1,a2,...)an is a term in the sequence which is sometimes denoted with {an} (not a set!)
Example: {an} with an= 1/n over n=1,....1,1/2,1/3, ...
Geometric progression: Sequence of the form: a,ar,ar^2,...,ar^n,...a = initial term, r = common ratio are real numbers
3,6,12,24,... (a=3,r=2): ratios are constant
Arithmetic progression Sequence of the form a,a+d,a+2d,...,a+nd,...a = initial term and d = common difference are real numbers
3,5,7,9,11,...(a=3,r=2): differences are constant
A string: finite sequence a1,...,an.
Sums Notation
2 2 2
1 1 1
1 2 1
2
22
, , 1
,...,
( .... )
n n n
i a k m ni m a m k m
n n n
ij i m i m ini m j m i m
a a a a a
a a a a
notation:
single sum
double sum
Summations
Theorem
1
0
11
( 1) 1
nn
j
j
ar aif r
ar rn a if r
0
1
0
1
1
1
0
1
1
11
nj
j
nj
j
nk
k
nn k
k
n
n
S ar
rS ar
rS ar
rS ar a ar
rS ar a S
ar aS if r
r
proof
trivial
SummationsTheorem:
0
( 1)( 1)
2
n
j
n na jd n a d
0 1 2 ...
(0 ) (1 1) (2 2) ...
( 1)
2
n
n n n
n n
sketch of proof: Split into 2 cases: even and odd n.In both cases argue as follows: