Download presentation
Presentation is loading. Please wait.
1
CMSC 250 Discrete Structures Number Theory
2
20 June 2007Number Theory2 Exactly one car in the plant has color H( a ) := “ a has color” x Cars –H( x ) a Cars –a x ~ H( a ) H( a, b ) := “ a has color b ” x Cars – y Colors H( x, y ) – a Cars, b Colors a x ~ H( a, b )
3
20 June 2007Number Theory3 At most one car in the plant has color H( a, b ) := “ a has color b ” x, a Cars – y, b Colors [H( x, y ) H( a, b )] x = a
4
20 June 2007Number Theory4 At least two cars in the plant have color H( a, b ) := “ a has color b ” x, a Cars – y, b Colors H( x, y ) H( a, b ) x a
5
20 June 2007Number Theory5 Existential Gen/Inst Existential Generalization –P(value) –value D x D such that P( x ) Existential Instantiation – x D such that P( x ) P( a ), a D such that P( a ) is true
6
20 June 2007Number Theory6 Proofs Must Have! Clear statement of what you are proving Clear indication you are starting the proof Clear indication of flow Clear indication of reason for each step Careful notation, completeness and order Clear indication of the conclusion and why it is valid. Suggest pencil and good erasure when needed
7
20 June 2007Number Theory7 Mathematical Proofs For any real number x, x – 1 = x – 1 –Can you prove that? For any real number x, x + y = x + y –Can you prove that?
8
20 June 2007Number Theory8 Domains Z – integers Q – rational numbers (quotients of integers) –r Q a, b Z, ( r = a / b ) ( b 0) –Irrational = not rational R – real numbers Superscripts: Z +, Z -, Z even, Z odd, Q >5
9
20 June 2007Number Theory9 Closure of Sets (Integers) Addition –If a Z and b Z, then ( a + b ) Z Subtraction –If a Z and b Z, then ( a – b ) Z Multiplication –If a Z and b Z, then ( a * b ) Z –If a Z and b Z, then ab Z
10
20 June 2007Number Theory10 Integer Definitions Even integer –n Z even k Z, n = 2 k Odd integer –n Z odd k Z, n = 2 k +1 Prime integer (Z >1 ) –n Z prime r, s Z +, ( n = r * s ) ( r =1) ( s =1) Composite integer (Z >1 ) –n Z composite r, s Z +, ( n = r * s ) ( r 1) ( s 1)
11
20 June 2007Number Theory11 Examples Prove 4 is even Prove 5100 is even Is 0 even? Is -301 even? If a Z and b Z, then is 6a 2 b even? Is every integer either even or odd? Prove? Is 1 prime? What are the first 6 primes? Is it true that every integer greater than 1 is either composite or prime? Prove?
12
20 June 2007Number Theory12 Constructive Proofs of Existence Proving an x D, such that Q ( x ): –Finding an x in D that makes Q ( x ) true –Giving a set of directions (such as a formula or algorithm) that will give an x in D that makes Q ( x ) true
13
20 June 2007Number Theory13 k Z such that 22 r + 18 s = 2 k Where r Z and s Z k,r,s Z, such that 22 r + 18 s = 2 k Prove?
14
20 June 2007Number Theory14 Constructive Proof of Existence If we want to prove: n Z even, p, q, r, s Z prime n = p + q n = r + s p r p s q r q s –Let n =10 n Z even by definition of even –Let p = 5 and the q = 5 p, q Z prime by definition of prime 10 = 5+5 –Let r = 3 and s = 7 r, s Z prime by definition of prime 10 = 3+7 –And all of the inequalities hold
15
20 June 2007Number Theory15 Proving Universal Statements Proof by exhaustion –Can only be used on finite domains r Z + where 23< r <29 p, q Z + ( r = pq ) ( p q ) But not even all of those Proof by Generalizing from the Generic Particular –Let x represent a particular but arbitrarily chosen element in the domain –Show that x satisfies the predicate –This does not mean you choose an element at random
16
20 June 2007Number Theory16 The sum of any two integers is even Formally – m, n Z even, ( m + n ) Z even – m, n Z, ( m Z even n Z even ) ( m + n ) Z even Proof: –Start Let m be a generic particular even number Let n be a generic particular even number –Show that ( m + n ) Z even (on the board)
17
20 June 2007Number Theory17 Proofs Must Have! Clear statement of what you are proving Clear indication you are starting the proof Clear indication of flow Clear indication of reason for each step Careful notation, completeness and order Clear indication of the conclusion and why it is valid. Suggest pencil and good erasure when needed
18
20 June 2007Number Theory18 An even number times an integer yields an even number
19
20 June 2007Number Theory19 The product of any two odd integers is odd
20
20 June 2007Number Theory20 Prove Universal False by Counterexample a, b R, a 2 =b 2 a = b Let a = 2; b = -2 a 2 =b 2 2 2 = (-2) 2 4 = 4 – is TRUE a = b 2 = -2 – is FALSE TRUE FALSE FALSE
21
20 June 2007Number Theory21 Rational Numbers Q – rational numbers (quotients of integers) –r Q a, b Z, ( r = a / b ) ( b 0) –Irrational = not rational Which of the following are rational? –10/3 –0.281 –7–7 –0–0 –2/0 –0.1212 –5.1212
22
20 June 2007Number Theory22 Prove 7 is a rational number r Q a, b Z, ( r = a / b ) ( b 0) Let a = 7 Let b = 1 7 = 7/1 (by algebra) 7 Z 1 Z 1 0
23
20 June 2007Number Theory23 Prove n Z, n is rational (i.e. n Q)
24
20 June 2007Number Theory24 Sum of any two rational numbers is rational r, s Q, r + s Q Let r = a / b Let s = c / d r + s = a / b + c / d = ( ad + cb )/ bd Theorem –Statement that is known to be true because it has been proved. Corollary –Statement whose truth can be immediately deduced from a proved theorem –E.g.: The double of a ration number is rational
25
20 June 2007Number Theory25 Division Definitions If n and d are integers, then –N is divisible by d if, and only if, n=dk for some integer k –d|n k Z, n=dk (read – “d divides n”) Alternatively, we say that –n is a multiple of d, or –n is divisible by d, or –d is a factor of n, or –d is a divisor of n, or –d divides n. 32 a multiple of -16? 21 divisible by 3? 7 a factor of -7? 5 divide 40? 7|42?
26
20 June 2007Number Theory26 Transitivity of Divisibility a,b,c R (a|b b|c) a|c Need to show: a|c c = a*k, where a 0 Choose generic particulars a,b,c s.t. a|b b|c –a|b b = ar, where a,r Z and a 0 –b|c c = bs, where b,s Z and b 0 Substitution –c = bs –c = (ar)s –c = a(rs) –k = (rs) –c = ak
27
20 June 2007Number Theory27 Proof Using Contrapositive For all positive integers, if n does not divide a number to which d is a factor, then n cannot divide d. n, d, c Z +, n dc n d n, d, c Z +, n|d n|dc (Contrapositive) Prove …
28
20 June 2007Number Theory28 a, b Z, ( a|b b|a ) a = b Choose general particular a, b Z s.t. a|b b|a a|b b = a*r, where a,r Z and a 0 b|a a = b*s, where b,s Z and b 0 Algebra –a = bs –a = (ar)s –a = a(rs) –1 = rs (since a 0) Is there a unique solution? –No; r=s=1, r=s=-1 Substitution –a=b or a=-b
29
20 June 2007Number Theory29 Proof by Contradiction Suppose the statement to be proven is FALSE Show that this leads to a logical contradiction Conclude the original statement is TRUE We can do this since every statement is TRUE or FALSE, but not BOTH.
30
20 June 2007Number Theory30 There is no largest integer. Suppose there is. Let P represent that integer. This means that n Z P ≥ n Show this leads to a contradiction: –Let m = P + 1 –m Z by closure of addition –m > p, by algebra; CONTRADICTION –So P, is not the largest integer.
31
20 June 2007Number Theory31 Sum of any rational number and any irrational number is irrational Suppose there exists a rational number r and an irrational number s such that r + s is rational This means: –r = a / b for a, b Z b 0 –r + s = c / d Z for d 0 –r + s = c / d Z fo –a / b + s = c / d –s = c / d – a / b –s = ( cb – ad )/ bd, num integer, denom int 0 –Contradiction!
32
20 June 2007Number Theory32 Proof by Contradiction Every integer is rational Suppose every integer is irrational From supposition, 1 is irrational, but 1 = 1/1 which is rational Since our supposition led to a contradiction, then our original statement must be true ERROR – n Z, n Q – n Z, n Q –There is some integer that is irrational
33
20 June 2007Number Theory33 Unique Factorization Example: –72 –2 2 2 3 3 –2 3 3 2 2 –3 2 2 3 2 –3 2 2 3 –2 3 3 2 (Standard Factored Form)
34
20 June 2007Number Theory34
35
20 June 2007Number Theory35
36
20 June 2007Number Theory36 More Integer Definitions Div and mod operators –n div d – integer quotient for n d –n div d – integer remainder for n d –(n div d = q) (n mod d = r) n = qd + r where n Z 0, d Z +, r Z, q Z, 0 r<d –(Quotient Remainder Theorem) Relating “ mod ” to “ divides ” –d|n 0 = n mod d –d|n 0 d n
37
20 June 2007Number Theory37 Modular Notation For p,q,r Z Equivalent notations: –p x q –( p mod x ) = ( q mod x ) –x |( p – q )
38
20 June 2007Number Theory38 Proofs Using this Notation m Z +, a, b Z a m b k Z a = b + km m Z +, a, b, c, d Z ( a m b ) ( c m d ) ( a + c ) m ( b + d )
39
20 June 2007Number Theory39 Proof by Division into Cases n Z, 3 n n 2 3 1
40
20 June 2007Number Theory40 The square of any integer has form 4 k or 4 k + 1 for some integer k
41
20 June 2007Number Theory41 Floor & Ceiling Definitions n is the floor of x where x R n Z – x = n n x < n + 1 n is the ceiling of x where x R n Z – x = n n – 1 < x n
42
20 June 2007Number Theory42 Floor Proofs x, y R x + y = x + y x R y Z x + y = x + y
43
20 June 2007Number Theory43 Another Floor Proof The floor of n /2 is either: –n /2 when n is even –( n -1)/2 when n is odd Prove by division into cases
44
20 June 2007Number Theory44 n Z, p Z prime, p | n p ( n + 1) Suppose n, p s.t. p | n p |( n + 1) Let n = pi, n + 1 = pj pj = pi + 1 pj – pi = 1 p ( j – i ) = 1 p |1 p can be 1 or -1, neither of which is prime
45
20 June 2007Number Theory45 Is the set of primes infinite? Assume finite set of primes of size N –{ p 1, p 2, , p N } Construct x = p 1 p 2 … p N Prime factorization says: – p i, such that p i |( x +1) That pi must be in { p 1, p 2, , p N } so p i | x p i | x p i |( x +1) Which contradicts the previous theorem
46
20 June 2007Number Theory46 Summary of Proof Methods Constructive Proof of Existence Proof by Exhaustion Proof by Generalizing from the Generic Particular Proof by Contraposition Proof by Contradiction Proof by Division into Cases
47
20 June 2007Number Theory47 Errors in Proofs Arguing from example for universal proof. Misuse of Variables Jumping to the Conclusion (missing steps) Begging the Question Using "if" about something that is known
48
20 June 2007Number Theory48 Applications Programming –If … then … –Loops … –Algorithms (e.g. gcd) … More examples –Calculator Sqrt(2) = 1.414213562 40.72727272727 – = ? –Cryptography …
49
20 June 2007Number Theory49 Using the Unique Prime Factorization Theorem Prove: a Z + 3 | a 2 3 | a Prove: a Z + q Z prime q|a 2 q|a
50
20 June 2007Number Theory50 n Z, n 2 Z odd n Z odd
51
20 June 2007Number Theory51 n Z, a, b Z odd, n = a + b
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.