Algorithms: Background

Size: px
Start display at page:

Download "Algorithms: Background"

Transcription

1 Algorithms: Background Amotz Bar-Noy CUNY Amotz Bar-Noy (CUNY) Algorithms: Background 1 / 66

2 What is a Proof? Definition I: The cogency of evidence that compels acceptance by the mind of a truth or a fact. Definition II: The process or an instance of establishing the validity of a statement especially by derivation from other statements in accordance with principles of reasoning. Definition III: A sequence of statements, each of which is either validly derived from those preceding it or is an axiom or assumption, and the final member of which, the conclusion, is the statement of which the truth is thereby established. Definition IV: a chain of reasoning using rules of inference, ultimately based on a set of axioms, that lead to a conclusion. Amotz Bar-Noy (CUNY) Algorithms: Background 2 / 66

3 The Pythagorean Theorem c b a Theorem: c 2 = a 2 + b 2 for a right triangle with short sides of length a and b and long side of length c. Amotz Bar-Noy (CUNY) Algorithms: Background 3 / 66

4 Proof I b a a c c b b c c a a b (a + b) 2 = c ab 2 a2 + b 2 = c 2 Amotz Bar-Noy (CUNY) Algorithms: Background 4 / 66

5 Proof II c c b a b a a b a b c c c 2 = 4 ab 2 + (b a)2 c 2 = b 2 + a 2 Amotz Bar-Noy (CUNY) Algorithms: Background 5 / 66

6 Proof III a c c b a b a + b c2 (a + b) = ab 2 a2 + b 2 = c 2 Amotz Bar-Noy (CUNY) Algorithms: Background 6 / 66

7 More Proofs 118 proofs: 6 proofs without words: An experimental proof: More about the Theorem and its proofs: Amotz Bar-Noy (CUNY) Algorithms: Background 7 / 66

8 Prime Numbers Theorem: There are infinitely many prime numbers. Proof: Let p 1 < p 2 < < p n be a set of n primes. Let Q = p 1 p 2 p n + 1. If Q is a prime, then a new prime is found. Otherwise, Q is a product of two or more primes. The Fundamental Theorem of Arithmetic. None of these primes can be p 1,..., p n. Therefore, a new prime is found. This process can continue infinitely often to find infinitely many primes. Amotz Bar-Noy (CUNY) Algorithms: Background 8 / 66

9 A Proof by Contradiction Theorem: The number 2 is an irrational number. Proof: Assume towards contradiction that p q = 2 for two positive integers p and q that have no common divisor. Squaring the equation implies p 2 = 2q 2. Therefore, p must be even. Let p = 2r for a positive integer r. It follows that 2q 2 = (2r) 2 = 4r 2 q 2 = 2r 2. Therefore, q must be even. A contradiction since both p and q are even. Amotz Bar-Noy (CUNY) Algorithms: Background 9 / 66

10 The Numbers An integer number: One of the (counting) numbers..., 3, 2, 1, 0, 1, 2, 3,.... Z (Z +, Z ) The set of all (positive, negative) integers. A rational number: A number that can be expressed as a fraction p/q where p (the numerator) and q (the denominator) are integers and q 0. Q (Q +, Q ) The set of all (positive, negative) rationals. A real number: A number of the form n.b 1 b 2 b 3... where n is an integer and b i {0, 1} for all i = 1, 2,.... R (R +, R ) The set of all (positive, negative) reals. Amotz Bar-Noy (CUNY) Algorithms: Background 10 / 66

11 Equality Between Sets Definition: Two finite or infinite sets S and T have the same cardinality (S T ) if and only if there is a one-to-one mapping f : S T from S to T. Mapping: For all s S there exists t T such that f (s) = t. From S: s 1 s 2 f (s 1 ) f (s 2 ). To T : For all t T there exists s S such that f (s) = t. Remark: For finite sets S = T is equivalent to S T. Amotz Bar-Noy (CUNY) Algorithms: Background 11 / 66

12 Examples Z Z + although it seems like Z is twice as large as Z +. Q Z although there are infinite number of rational numbers between any two consecutive integers. R Q although there are infinite number of rational numbers between any two real numbers. Since Q R (every rational number is also a real number), it follows that Q R from a cardinality point of view. Amotz Bar-Noy (CUNY) Algorithms: Background 12 / 66

13 Z Z + The mapping f : Z Z + : f (n) = 2n for a positive integer n. f ( n) = 2n + 1 for a positive integer n. f (0) = Amotz Bar-Noy (CUNY) Algorithms: Background 13 / 66

14 Z + Q + The mapping: From Z + to Q + by following the arrows and skipping the already assigned fractions. 1/1 2/1 3/1 4/1 5/1... 1/2 2/2 3/2 4/2 5/2... 1/3 2/3 3/3 4/3 5/3... 1/4 2/4 3/4 4/4 5/4... 1/5.. 2/5... 3/5.. 4/5... 5/ Amotz Bar-Noy (CUNY) Algorithms: Background 14 / 66

15 Z + R + Assume that a mapping f : Z + R + exists. f (1) = n 1.b1b 1 1b bi 1... f (2) = n 2.b2b 1 2b bi 2... f (3) = n 3.b3b 1 3b bi f (i) = n i.bi 1 bi 2 bi 3... bi i... Let x = n 1. b 1 1 b 2 2 b b i i... where b j j = 1 b j j. x f (i) for any i = 1, 2,.... Therefore f is not a valid mapping: a contradiction. Amotz Bar-Noy (CUNY) Algorithms: Background 15 / 66

16 A False Proof a = b + c (a b)a = (a b)(b + c) a 2 ab = ab + ac b 2 bc a 2 ab ac = ab b 2 bc a(a b c) = b(a b c) a = b Amotz Bar-Noy (CUNY) Algorithms: Background 16 / 66

17 Another False Proof i = i 1 = = 1 = = = 1 Amotz Bar-Noy (CUNY) Algorithms: Background 17 / 66

18 Induction Let P n be a statement for all the positive integer (n = 1, 2, 3,...). If the following 2 properties hold: Property I: P 1 is true. Property II: P k+1 is true if P k is true for each positive integer k. Then P n is true for all n. Amotz Bar-Noy (CUNY) Algorithms: Background 18 / 66

19 Why Induction Works? Let S be the set of all numbers n for which P n is false. Let k be the minimum number in S. k > 1 since by Property I of the induction definition, P 1 is true. By the minimality of k, P k 1 is true and P k is false. A contradiction to Property II of the induction definition. Amotz Bar-Noy (CUNY) Algorithms: Background 19 / 66

20 A Summation Problem Prove that for an integer n 1: Define: n = n(n+1) 2. L(n) = n. R(n) = n(n+1) 2. Prove that L(n) = R(n) for n 1. Amotz Bar-Noy (CUNY) Algorithms: Background 20 / 66

21 Verifying the Claim Check correctness for small values of n: n L(n) R(n) = 1 2 = = 3 2 = = 6 2 = = 55 2 = 55 Amotz Bar-Noy (CUNY) Algorithms: Background 21 / 66

22 A Direct Proof Idea: Compute the value of 2L(n). Example: 2( ) = ( ) + ( ) = (1 + 3) + (2 + 2) + (3 + 1) = 3 4 = 12 = Amotz Bar-Noy (CUNY) Algorithms: Background 22 / 66

23 A Direct Proof 2 L(n) = (1 + + n) + (n + + 1) = (1 + n) + (2 + (n 1)) + + (n + 1) = (n + 1) + (n + 1) + + (n + 1) = n(n + 1) This implies that: L(n) = n(n+1) 2 = R(n). Amotz Bar-Noy (CUNY) Algorithms: Background 23 / 66

24 A Proof by Induction Prove correctness for n + 1 assuming correctness for n: L(n + 1) = n + (n + 1) = L(n) + (n + 1) = R(n) + (n + 1) n(n + 1) = + (n + 1) 2 (n + 1)(n + 2) = 2 = R(n + 1) Amotz Bar-Noy (CUNY) Algorithms: Background 24 / 66

25 The Pigeonhole Principle Simple form: If k + 1 objects are placed into k boxes then there exists at least one box containing 2 or more objects. Dual form: If k objects are placed into k + 1 boxes then there exists at least one empty box. Generalized form: If K objects are placed into k boxes then there exists at least one box containing K /k or more objects. Amotz Bar-Noy (CUNY) Algorithms: Background 25 / 66

26 Hand Shaking Problem: In a group of n people handshaking takes place. No-one shakes their own hand and no pair of people shake hands more than once. Show that there must be two people who have shaken the same number of hands. Amotz Bar-Noy (CUNY) Algorithms: Background 26 / 66

27 Hand Shaking Problem: In a group of n people handshaking takes place. No-one shakes their own hand and no pair of people shake hands more than once. Show that there must be two people who have shaken the same number of hands. Proof: For 1 i n, person P i shakes 0 h i n 1 hands. There cannot be 2 people P i and P j such that h i = 0 and h j = n 1. There are only n 1 possible values for h 1, h 2,..., h n. By the pigeonhole principle at least 2 people have shaken the same number of hands. Amotz Bar-Noy (CUNY) Algorithms: Background 26 / 66

28 Friends and Enemies Problem: In a group of 6 people, each pair of individuals consists of 2 friends or 2 enemies. Show that there are either 3 mutual friends or 3 mutual enemies in the group. Amotz Bar-Noy (CUNY) Algorithms: Background 27 / 66

29 Friends and Enemies Problem: In a group of 6 people, each pair of individuals consists of 2 friends or 2 enemies. Show that there are either 3 mutual friends or 3 mutual enemies in the group. Proof: Let A be one of the 6 people. By the generalized pigeonhole principle either A has 3 friends or A has 3 enemies. Assume A has 3 friends B, C, D. If any 2 of B, C, D are friends then these 2 and A are 3 mutual friends. Otherwise B, C, D are 3 mutual enemies. Similar arguments hold if B, C, D are the enemies of A. Amotz Bar-Noy (CUNY) Algorithms: Background 27 / 66

30 Discussing Topics Problem: 17 people discuss 3 topics where each pair discuss only 1 topic. Prove that there are at least 3 people who discuss among themselves the same topic. Amotz Bar-Noy (CUNY) Algorithms: Background 28 / 66

31 Discussing Topics Problem: 17 people discuss 3 topics where each pair discuss only 1 topic. Prove that there are at least 3 people who discuss among themselves the same topic. Proof: Let A be one of the 17 people. By the generalized pigeonhole principle there exists a topic T discussed by A with at least 6 people. If among these 6 people there are B and C who discuss T, then A, B, C discuss T among themselves. Otherwise, these 6 people discuss only the other 2 topics. By the previous problem, there are 3 people who discuss among themselves the same topic. Amotz Bar-Noy (CUNY) Algorithms: Background 28 / 66

32 Ramsey s Numbers Friends and Enemies: R(3, 3) Discussing Topics: R(3, 3, 3) Amotz Bar-Noy (CUNY) Algorithms: Background 29 / 66

33 Induction vs. Pigeonhole Principle Induction:... then for all... Pigeonhole Principle:... then there exists... Amotz Bar-Noy (CUNY) Algorithms: Background 30 / 66

34 The Subsequence Theorem Theorem: Let x 1,..., x n 2 +1 be any sequence of distinct numbers. Then there exists either an increasing or a decreasing (n + 1)-subsequence Amotz Bar-Noy (CUNY) Algorithms: Background 31 / 66

35 The Subsequence Theorem Theorem: Let x 1,..., x n 2 +1 be any sequence of distinct numbers. Then there exists either an increasing or a decreasing (n + 1)-subsequence Without loss of generality the numbers are 1, 2,..., n Trivial for n = 1: the only possible sequences of length n = = 2 are the increasing sequence (1, 2) and the decreasing sequence (2, 1) of length n + 1 = 2. Amotz Bar-Noy (CUNY) Algorithms: Background 31 / 66

36 Sequences of Length n 2 The sequence (7, 8, 9, 4, 5, 6, 1, 2, 3) is an example why the theorem is not correct for n 2 numbers for n = 3. The sequence (4, 3, 2, 1, 8, 7, 6, 5, 12, 11, 10, 9, 16, 15, 14, 13) is an example why the theorem is not correct for n 2 numbers for n = 4. Amotz Bar-Noy (CUNY) Algorithms: Background 32 / 66

37 Sequences of Length n 2 The sequence (7, 8, 9, 4, 5, 6, 1, 2, 3) is an example why the theorem is not correct for n 2 numbers for n = 3. The sequence (4, 3, 2, 1, 8, 7, 6, 5, 12, 11, 10, 9, 16, 15, 14, 13) is an example why the theorem is not correct for n 2 numbers for n = 4. The following two sequences are examples why the theorem is not correct for n 2 numbers for any n 1: ([n 2 n + 1, n 2 n + 2,..., n 2 ], [n 2 2n + 1, n 2 2n + 2,..., n 2 n],..., [1, 2,..., n]) ([n, n 1,..., 1], [2n, 2n 1,..., n + 1],..., [n 2, n 2 1,..., n 2 n + 1]) Amotz Bar-Noy (CUNY) Algorithms: Background 32 / 66

38 n = 2: Sequences of Length 5 Check all the 120 permutations of 1, 2, 3, 4, 5 and show either an increasing or a decreasing 3-subsequence. Amotz Bar-Noy (CUNY) Algorithms: Background 33 / 66

39 n = 2: Sequences of Length 5 Check all the 120 permutations of 1, 2, 3, 4, 5 and show either an increasing or a decreasing 3-subsequence. Assume 3 is in position 3 in the sequence (,, 3,, ): If 1 is in positions 4 or 5, then either 4 or 5 must be in positions 1 or 2, creating a decreasing 3-subsequence. E.g., (5,, 3,, 1). If 1 is in positions 1 or 2, then either 4 or 5 must be in positions 4 or 5, creating an increasing 3-subsequence. E.g., (, 1, 3,, 4). Similar arguments find a decreasing or an increasing 3-subsequence if 2, 3, or 4 are in positions 2, 3, or 4. The proof follows since by the pigeonhole principle one of 2, 3, and 4 must be in one of the positions 2, 3, or 4. Amotz Bar-Noy (CUNY) Algorithms: Background 33 / 66

40 Proofs Five Proofs of the Subsequence Theorem By William Gasarch gasarch/blogpapers/subseq4proofs.pdf The three proofs by induction are more involved than the two proofs that use the pigeonhole principle. However, all the proofs use similar arguments. All the proofs fail on the example of a sequence of length n 2 that does not have an n + 1-subsequence. Amotz Bar-Noy (CUNY) Algorithms: Background 34 / 66

41 First Proof from the Book Let x 1,..., x n 2 +1 be any sequence of distinct numbers. Let f (i) be the length of the longest increasing subsequence that ends at x i. If there exists i such that f (i) n + 1, then an increasing (n + 1)-subsequence exists. Otherwise, f (i) n for all i. There are n indices, therefore by the generalized pigeonhole principle, there exists 1 v n and at least n + 1 indices i 1, i 2,..., i n+1 for which v = f (i 1 ) = f (i 2 ) = = f (i n+1 ). x ij > x ik for any 1 j < k n + 1 since otherwise f (k) f (j) + 1. Therefore, x i1 > x i2 > > x in+1 is a decreasing (n + 1)-subsequence. Amotz Bar-Noy (CUNY) Algorithms: Background 35 / 66

42 Second Proof from the Book Let x 1,..., x n 2 +1 be any sequence of distinct numbers. Let f (i) be the length of the longest increasing subsequence that ends at x i and let g(i) be the length of the longest decreasing subsequence that ends at x i. Assume towards contradiction that both f (i), g(i) n for all i. Then there are at most n 2 different pairs (f (i), g(i)). Since there are n indices, by the pigeonhole principle, there exist indices 1 j < k n such that f (j) = f (k) and g(j) = g(k). If x j < x k then f (k) f (j) + 1; a contradiction. If x j > x k then g(k) g(j) + 1; a contradiction. Amotz Bar-Noy (CUNY) Algorithms: Background 36 / 66

43 Properties of Logarithms For real numbers a > 1, b > 1, x > 0, and y > 0: log a x = z a z = x log a 1 = 0 log a a = 1 log a (x y ) = y log a x log a (xy) = log a x + log a y log a (x/y) = log a x log a y a log b x = x log b a log a b = 1 log b a log a x = log b x log b a = log a b log b x Amotz Bar-Noy (CUNY) Algorithms: Background 37 / 66

44 Summation Formulas n i=1 i0 = = n 1 1 n1 n i=1 i1 = n = n(n+1) n2 n i=1 i2 = n 2 = n(n+1)(2n+1) n3 n i=1 ik = 1 k + 2 k + + n k 1 k+1 nk+1 Amotz Bar-Noy (CUNY) Algorithms: Background 38 / 66

45 Summation Formulas Finite sums for a > 1: n i=0 ai = 1 + a + + a n = an+1 1 a 1 n i=0 2i = n = 2 n+1 1 Finite sums for a < 1: n i=0 ai = 1 + a + + a n = 1 an+1 n i=0 1 a ( 1 ) i 2 = = 2 1 n 2 n Infinite sums for a < 1: i=0 ai = 1 + a + a 2 + = 1 ( 1 i=0 2 1 a ) i = = 2 Amotz Bar-Noy (CUNY) Algorithms: Background 39 / 66

46 Summation Formulas n (i 2 i ) = n 2 n = (n 1)2 n i= n 2 n 2 n 2 n 2 n 2(2 n 1) 4(2 n 1 1) 8(2 n 2 1) 16(2 n 3 1) 2 n (2 1). n n n (i 2 i ) = 2 i (2 n i+1 1) = (2 n+1 2 i ) i=1 i=1 i=1 = n2 n+1 2(2 n 1) = (n 1)2 n Amotz Bar-Noy (CUNY) Algorithms: Background 40 / 66

47 Summation Formulas i=1 i 2 i = i 2 i + = 2 1/2 1/4 1/4 1/8 1/8 1/8... 1/2 i 1/2 i 1/2 i 1/2 i /2 1/4 1/2 i 1 i=1 i 2 i = i=0 1 2 i = 2. Amotz Bar-Noy (CUNY) Algorithms: Background 41 / 66

48 Summation Formulas n log 2 i = log log log 2 n i=1 = log 2 (1 2 n) = log 2 (n!) n log 2 n Upper bound: n log 2 i < i=1 n log 2 n = n log 2 n i=1 Lower bound: n n log 2 i > log 2 (n/2) = n/2 log 2 (n/2) n/2 i=1 i=n/2+1 Amotz Bar-Noy (CUNY) Algorithms: Background 42 / 66

49 Summation Formulas For n = 2 k : log 2 n i=0 log 2 ( n 2 i ) = log 2 ( n 1 ) ( n ) ( n ) + log log 2 2 n = log 2 n = log 2 n(log 2 n + 1) 2 log2 2 n 2 Amotz Bar-Noy (CUNY) Algorithms: Background 43 / 66

50 Sum Manipulation Rules u i=l ca i = c u i=l a i u i=l (a i ± b i ) = u i=l a i ± u i=l b i u i=l a i = m i=l a i + u i=m+1 a i for l m u u i=l+1 (a i a i 1 ) = a u a l Amotz Bar-Noy (CUNY) Algorithms: Background 44 / 66

51 Bounding Summations by Integrals For a monotonic non-decreasing function f (x): u l 1 f (x)dx u f (i) i=l u+1 l f (x)dx For a monotonic non-increasing function f (x): u+1 l f (x)dx u f (i) i=l u l 1 f (x)dx Amotz Bar-Noy (CUNY) Algorithms: Background 45 / 66

52 Bounding Summations by Integrals Amotz Bar-Noy (CUNY) Algorithms: Background 46 / 66

53 Harmonic Numbers H(n) = n i=1 1 i. f (x) = 1/x is a monotonic non-increasing function. Upper Bound: H(n) 1 + n dx 1 x Lower bound: H(n) n+1 dx 1 x = 1 + ln(n) ln(1) = 1 + ln(n). = ln(n + 1) ln(1) = ln(n + 1). Exact bound: H n = ln(n) + γ + 1/(2n) 1/(12n 2 ) + ɛ n /(120n 4 ) for 0 < ɛ n < 1 and γ (Euler s constant). Amotz Bar-Noy (CUNY) Algorithms: Background 47 / 66

54 Harmonic Numbers Amotz Bar-Noy (CUNY) Algorithms: Background 48 / 66

55 Floor and Ceiling Formulas For real x and integer n: x 1 < x x x < x + 1 x + n = x + n x + n = x + n n/2 + n/2 = n log 2 (n + 1) = 1 + log 2 n Amotz Bar-Noy (CUNY) Algorithms: Background 49 / 66

56 Modular Arithmetic For integers n and m and a positive integer p: (n + m) mod p = (n mod p + m mod p) mod p. (n m) mod p = (n mod p m mod p) mod p. Amotz Bar-Noy (CUNY) Algorithms: Background 50 / 66

57 Stirling s Formula n! = ( n ) n ( ( )) 1 2πn 1 + Θ e n n n! = ( n ) n 2πn e log 2 (n!) = Θ(n log 2 n) Amotz Bar-Noy (CUNY) Algorithms: Background 51 / 66

58 Fibonacci Numbers The sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, Recursive Definition: 0 for k = 0, F k = 1 for k = 1, F k 1 + F k 2 for k 2. Wikipedia: Amotz Bar-Noy (CUNY) Algorithms: Background 52 / 66

59 Fibonacci Numbers - The Original Problem Story: A young pair of rabbits (one of each sex) is placed on an island. A pair of rabbits does not breed until they are 2 months old. After they are 2 months old, each pair of rabbits produces another pair each month. Problem: Find a recurrence relation for the number of pairs of rabbits on the island after k months, assuming that no rabbits ever die. Solution: F k pairs of rabbits on the island after k months. Amotz Bar-Noy (CUNY) Algorithms: Background 53 / 66

60 The Golden Ratio Find a rectangle of size x 1 such that after removing a 1 1 square the remaining rectangle has size 1 1 x. x 1 = 1 x. Amotz Bar-Noy (CUNY) Algorithms: Background 54 / 66

61 Solving the Equation x = x Start with x 1 = 1. Define x i = x i 1 for i > 1. x 2 = = 2. x 3 = = 3 2 = 1.5. x 4 = /2 = x 5 = /3 = 8 5 = 1.6. x 6 = /5 = 13 8 = x 7 = /8 = x 8 = /13 = x 9 = /21 = Amotz Bar-Noy (CUNY) Algorithms: Background 55 / 66

62 Solving the Equation x = x 1 x = Amotz Bar-Noy (CUNY) Algorithms: Background 56 / 66

63 Solving the Equation x = x Proposition: x i = F i+1 F i. Proof: Initially x 1 = 1 = 1 1 = F 2 F 1. Assume the statement is correct for x i and prove it by induction for x i+1. x i+1 = = 1 + x i F i+1 /F i = 1 + F i F i+1 = F i+1 + F i F i+1 = F i+2 F i+1. Amotz Bar-Noy (CUNY) Algorithms: Background 57 / 66

64 The Golden Ratio Definition: The positive root of the equation x 2 x 1 = 0. Remark: This equation is equivalent to x = x. Solution to the quadratic equation: x = 1± 5 2. The positive root: φ = (1 + 5)/ The negative root: ˆφ = (1 5)/2 = 1 φ Amotz Bar-Noy (CUNY) Algorithms: Background 58 / 66

65 k as a Function of the Fibonacci Number F k F k = (φ k ˆφ k )/ 5. F k+1 = φf k + ˆφ k. ˆφ < 1 F k = φk 5 rounded to the nearest integer. Corollary: log φ (F k ) + 1 k log φ (F k ) + 2 Corollary: k = Θ(log(F k )). Amotz Bar-Noy (CUNY) Algorithms: Background 59 / 66

66 Interesting Facts F k 1 F k+1 F 2 k = ( 1)k for k 1. F 5 F 7 F 2 6 = = 1. F 6 F 8 F 2 7 = = 1. F mk is a multiple of F m and F k for m, k 1. F 15 = 610 is a multiple of F 5 = 5 and F 3 = 2. gcd(f m, F k ) = F gcd(m,k). gcd(f 12, F 18 ) = gcd(144, 2584) = 8 = F 6 = F gcd(18,12). Amotz Bar-Noy (CUNY) Algorithms: Background 60 / 66

67 A Paradox? The area of the left rectangle is 8 8 = 64. The area of the right rectangle is 5 13 = 65. But both rectangles are composed of the same 4 shapes! Animation: Amotz Bar-Noy (CUNY) Algorithms: Background 61 / 66

68 A Paradox? The area of the left rectangle is 8 8 = 64. The area of the right rectangle is 5 13 = 65. But both rectangles are composed of the same 4 shapes! Animation: Hint: F k 1 F k+1 F 2 k = ( 1)k. Amotz Bar-Noy (CUNY) Algorithms: Background 61 / 66

69 A Paradox? The area of the left rectangle is 8 8 = 64. The area of the right rectangle is 5 13 = 65. But both rectangles are composed of the same 4 shapes! Animation: Hint: F k 1 F k+1 F 2 k = ( 1)k. Solution: Amotz Bar-Noy (CUNY) Algorithms: Background 61 / 66

70 A Paradox? The area of the left rectangle is 8 8 = 64. The area of the right rectangle is 5 13 = 65. But both rectangles are composed of the same 4 shapes! Animation: Hint: F k 1 F k+1 F 2 k = ( 1)k. Solution: The missing square puzzle: Amotz Bar-Noy (CUNY) Algorithms: Background 61 / 66

71 Kilometers and Miles One mile is approximately φ kilometers. F k1 + F k2 + + F kh kilometers are approximately F k1 1 + F k F kh 1 miles. 32 = = F 8 + F 6 + F 4 kilometers are approximately F 7 + F 5 + F 3 = = 20 miles. 32 = = F 8 + F 6 + F 4 miles are approximately F 9 + F 7 + F 5 = = 52 kilometers. Amotz Bar-Noy (CUNY) Algorithms: Background 62 / 66

72 Combinatorics Number of permutations of an n-element set: n! Number of k-combinations of an n-element set: ( ) n k = n! k!(n k)! Number of subsets of an n-element set: 2 n Number of binary strings of length n: 2 n Number of k-ary strings of length n: k n Amotz Bar-Noy (CUNY) Algorithms: Background 63 / 66

73 Binomial Coefficients C(n, k) = ( n k) : The number of size k subsets from the set {1, 2,..., n}. The coefficient of x k in the expansion of (1 + x) n : (1 + x) n = ( ( n 0) + n ( 1) x + n ) 2 x ( ) n n x n Recursive Definition: C(n, k) = ( ) n k = 1 for k = 0 1 for k = n ( n 1 ) ( k 1 + n 1 ) k for 0 < k < n 0 otherwise Amotz Bar-Noy (CUNY) Algorithms: Background 64 / 66

74 The Pascal Triangle Amotz Bar-Noy (CUNY) Algorithms: Background 65 / 66

75 Binomial Coefficients Some Facts ( n ) k = n! k!(n k)! = n(n 1) (n k+1) k(k 1) 1 ( n ( k) = n ) n k ( n k ) k n k n 1 k 1 n k+1 1 (n k + 1) k ( n ) k = Θ(n k ) for a fixed k Amotz Bar-Noy (CUNY) Algorithms: Background 66 / 66

Binomial Coefficient Identities/Complements

Binomial Coefficient Identities/Complements Binomial Coefficient Identities/Complements CSE21 Fall 2017, Day 4 Oct 6, 2017 https://sites.google.com/a/eng.ucsd.edu/cse21-fall-2017-miles-jones/ permutation P(n,r) = n(n-1) (n-2) (n-r+1) = Terminology

More information

MATH 402 : 2017 page 1 of 6

MATH 402 : 2017 page 1 of 6 ADMINISTRATION What? Math 40: Enumerative Combinatorics Who? Me: Professor Greg Smith You: students interested in combinatorics When and Where? lectures: slot 00 office hours: Tuesdays at :30 6:30 and

More information

Definition: Let S and T be sets. A binary relation on SxT is any subset of SxT. A binary relation on S is any subset of SxS.

Definition: Let S and T be sets. A binary relation on SxT is any subset of SxT. A binary relation on S is any subset of SxS. 4 Functions Before studying functions we will first quickly define a more general idea, namely the notion of a relation. A function turns out to be a special type of relation. Definition: Let S and T be

More information

Introduction to Decision Sciences Lecture 10

Introduction to Decision Sciences Lecture 10 Introduction to Decision Sciences Lecture 10 Andrew Nobel October 17, 2017 Mathematical Induction Given: Propositional function P (n) with domain N + Basis step: Show that P (1) is true Inductive step:

More information

Compare the growth rate of functions

Compare the growth rate of functions Compare the growth rate of functions We have two algorithms A 1 and A 2 for solving the same problem, with runtime functions T 1 (n) and T 2 (n), respectively. Which algorithm is more efficient? We compare

More information

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction Math 4 Summer 01 Elementary Number Theory Notes on Mathematical Induction Principle of Mathematical Induction Recall the following axiom for the set of integers. Well-Ordering Axiom for the Integers If

More information

Notation Index. gcd(a, b) (greatest common divisor) NT-16

Notation Index. gcd(a, b) (greatest common divisor) NT-16 Notation Index (for all) B A (all functions) B A = B A (all functions) SF-18 (n) k (falling factorial) SF-9 a R b (binary relation) C(n,k) = n! k! (n k)! (binomial coefficient) SF-9 n! (n factorial) SF-9

More information

Pigeonhole Principle and Ramsey Theory

Pigeonhole Principle and Ramsey Theory Pigeonhole Principle and Ramsey Theory The Pigeonhole Principle (PP) has often been termed as one of the most fundamental principles in combinatorics. The familiar statement is that if we have n pigeonholes

More information

Counting Methods. CSE 191, Class Note 05: Counting Methods Computer Sci & Eng Dept SUNY Buffalo

Counting Methods. CSE 191, Class Note 05: Counting Methods Computer Sci & Eng Dept SUNY Buffalo Counting Methods CSE 191, Class Note 05: Counting Methods Computer Sci & Eng Dept SUNY Buffalo c Xin He (University at Buffalo) CSE 191 Discrete Structures 1 / 48 Need for Counting The problem of counting

More information

What you learned in Math 28. Rosa C. Orellana

What you learned in Math 28. Rosa C. Orellana What you learned in Math 28 Rosa C. Orellana Chapter 1 - Basic Counting Techniques Sum Principle If we have a partition of a finite set S, then the size of S is the sum of the sizes of the blocks of the

More information

Chapter 1 : The language of mathematics.

Chapter 1 : The language of mathematics. MAT 200, Logic, Language and Proof, Fall 2015 Summary Chapter 1 : The language of mathematics. Definition. A proposition is a sentence which is either true or false. Truth table for the connective or :

More information

Fibonacci numbers. Chapter The Fibonacci sequence. The Fibonacci numbers F n are defined recursively by

Fibonacci numbers. Chapter The Fibonacci sequence. The Fibonacci numbers F n are defined recursively by Chapter Fibonacci numbers The Fibonacci sequence The Fibonacci numbers F n are defined recursively by F n+ = F n + F n, F 0 = 0, F = The first few Fibonacci numbers are n 0 5 6 7 8 9 0 F n 0 5 8 55 89

More information

{ 0! = 1 n! = n(n 1)!, n 1. n! =

{ 0! = 1 n! = n(n 1)!, n 1. n! = Summations Question? What is the sum of the first 100 positive integers? Counting Question? In how many ways may the first three horses in a 10 horse race finish? Multiplication Principle: If an event

More information

MATH 215 Final. M4. For all a, b in Z, a b = b a.

MATH 215 Final. M4. For all a, b in Z, a b = b a. MATH 215 Final We will assume the existence of a set Z, whose elements are called integers, along with a well-defined binary operation + on Z (called addition), a second well-defined binary operation on

More information

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr.

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr. Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr. Chapter : Logic Topics:. Statements, Negation, and Compound Statements.2 Truth Tables and Logical Equivalences.3

More information

Introduction to Number Theory

Introduction to Number Theory INTRODUCTION Definition: Natural Numbers, Integers Natural numbers: N={0,1,, }. Integers: Z={0,±1,±, }. Definition: Divisor If a Z can be writeen as a=bc where b, c Z, then we say a is divisible by b or,

More information

Introduction to Decision Sciences Lecture 11

Introduction to Decision Sciences Lecture 11 Introduction to Decision Sciences Lecture 11 Andrew Nobel October 24, 2017 Basics of Counting Product Rule Product Rule: Suppose that the elements of a collection S can be specified by a sequence of k

More information

Advanced Counting Techniques

Advanced Counting Techniques . All rights reserved. Authorized only for instructor use in the classroom. No reproduction or further distribution permitted without the prior written consent of McGraw-Hill Education. Advanced Counting

More information

Advanced Counting Techniques. Chapter 8

Advanced Counting Techniques. Chapter 8 Advanced Counting Techniques Chapter 8 Chapter Summary Applications of Recurrence Relations Solving Linear Recurrence Relations Homogeneous Recurrence Relations Nonhomogeneous Recurrence Relations Divide-and-Conquer

More information

Review 3. Andreas Klappenecker

Review 3. Andreas Klappenecker Review 3 Andreas Klappenecker Final Exam Friday, May 4, 2012, starting at 12:30pm, usual classroom Topics Topic Reading Algorithms and their Complexity Chapter 3 Logic and Proofs Chapter 1 Logic and Proofs

More information

1 The distributive law

1 The distributive law THINGS TO KNOW BEFORE GOING INTO DISCRETE MATHEMATICS The distributive law The distributive law is this: a(b + c) = ab + bc This can be generalized to any number of terms between parenthesis; for instance:

More information

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime. PUTNAM TRAINING NUMBER THEORY (Last updated: December 11, 2017) Remark. This is a list of exercises on Number Theory. Miguel A. Lerma Exercises 1. Show that the sum of two consecutive primes is never twice

More information

Putnam Pigeonhole Principle October 25, 2005

Putnam Pigeonhole Principle October 25, 2005 Putnam Pigeonhole Principle October 5, 005 Introduction 1. If n > m pigeons are placed into m boxes, then there exists (at least) one box with at least two pigeons.. If n > m, then any function f : [n]

More information

MATH 324 Summer 2011 Elementary Number Theory. Notes on Mathematical Induction. Recall the following axiom for the set of integers.

MATH 324 Summer 2011 Elementary Number Theory. Notes on Mathematical Induction. Recall the following axiom for the set of integers. MATH 4 Summer 011 Elementary Number Theory Notes on Mathematical Induction Principle of Mathematical Induction Recall the following axiom for the set of integers. Well-Ordering Axiom for the Integers If

More information

Final Exam Review. 2. Let A = {, { }}. What is the cardinality of A? Is

Final Exam Review. 2. Let A = {, { }}. What is the cardinality of A? Is 1. Describe the elements of the set (Z Q) R N. Is this set countable or uncountable? Solution: The set is equal to {(x, y) x Z, y N} = Z N. Since the Cartesian product of two denumerable sets is denumerable,

More information

Solutions to Practice Final

Solutions to Practice Final s to Practice Final 1. (a) What is φ(0 100 ) where φ is Euler s φ-function? (b) Find an integer x such that 140x 1 (mod 01). Hint: gcd(140, 01) = 7. (a) φ(0 100 ) = φ(4 100 5 100 ) = φ( 00 5 100 ) = (

More information

PRIME NUMBERS YANKI LEKILI

PRIME NUMBERS YANKI LEKILI PRIME NUMBERS YANKI LEKILI We denote by N the set of natural numbers: 1,2,..., These are constructed using Peano axioms. We will not get into the philosophical questions related to this and simply assume

More information

Discrete Structures for Computer Science: Counting, Recursion, and Probability

Discrete Structures for Computer Science: Counting, Recursion, and Probability Discrete Structures for Computer Science: Counting, Recursion, and Probability Michiel Smid School of Computer Science Carleton University Ottawa, Ontario Canada michiel@scs.carleton.ca December 18, 2017

More information

8. Given a rational number r, prove that there exist coprime integers p and q, with q 0, so that r = p q. . For all n N, f n = an b n 2

8. Given a rational number r, prove that there exist coprime integers p and q, with q 0, so that r = p q. . For all n N, f n = an b n 2 MATH 135: Randomized Exam Practice Problems These are the warm-up exercises and recommended problems taken from all the extra practice sets presented in random order. The challenge problems have not been

More information

1 Basic Combinatorics

1 Basic Combinatorics 1 Basic Combinatorics 1.1 Sets and sequences Sets. A set is an unordered collection of distinct objects. The objects are called elements of the set. We use braces to denote a set, for example, the set

More information

CSE 1400 Applied Discrete Mathematics Proofs

CSE 1400 Applied Discrete Mathematics Proofs CSE 1400 Applied Discrete Mathematics Proofs Department of Computer Sciences College of Engineering Florida Tech Fall 2011 Axioms 1 Logical Axioms 2 Models 2 Number Theory 3 Graph Theory 4 Set Theory 4

More information

The Pigeonhole Principle

The Pigeonhole Principle The Pigeonhole Principle 2 2.1 The Pigeonhole Principle The pigeonhole principle is one of the most used tools in combinatorics, and one of the simplest ones. It is applied frequently in graph theory,

More information

Notes on Continued Fractions for Math 4400

Notes on Continued Fractions for Math 4400 . Continued fractions. Notes on Continued Fractions for Math 4400 The continued fraction expansion converts a positive real number α into a sequence of natural numbers. Conversely, a sequence of natural

More information

Fall 2017 Test II review problems

Fall 2017 Test II review problems Fall 2017 Test II review problems Dr. Holmes October 18, 2017 This is a quite miscellaneous grab bag of relevant problems from old tests. Some are certainly repeated. 1. Give the complete addition and

More information

MATH FINAL EXAM REVIEW HINTS

MATH FINAL EXAM REVIEW HINTS MATH 109 - FINAL EXAM REVIEW HINTS Answer: Answer: 1. Cardinality (1) Let a < b be two real numbers and define f : (0, 1) (a, b) by f(t) = (1 t)a + tb. (a) Prove that f is a bijection. (b) Prove that any

More information

MATH 363: Discrete Mathematics

MATH 363: Discrete Mathematics MATH 363: Discrete Mathematics Learning Objectives by topic The levels of learning for this class are classified as follows. 1. Basic Knowledge: To recall and memorize - Assess by direct questions. The

More information

Mathematics 228(Q1), Assignment 2 Solutions

Mathematics 228(Q1), Assignment 2 Solutions Mathematics 228(Q1), Assignment 2 Solutions Exercise 1.(10 marks) A natural number n > 1 is said to be square free if d N with d 2 n implies d = 1. Show that n is square free if and only if n = p 1 p k

More information

0.Axioms for the Integers 1

0.Axioms for the Integers 1 0.Axioms for the Integers 1 Number theory is the study of the arithmetical properties of the integers. You have been doing arithmetic with integers since you were a young child, but these mathematical

More information

Week 2: Sequences and Series

Week 2: Sequences and Series QF0: Quantitative Finance August 29, 207 Week 2: Sequences and Series Facilitator: Christopher Ting AY 207/208 Mathematicians have tried in vain to this day to discover some order in the sequence of prime

More information

COMP Intro to Logic for Computer Scientists. Lecture 15

COMP Intro to Logic for Computer Scientists. Lecture 15 COMP 1002 Intro to Logic for Computer Scientists Lecture 15 B 5 2 J Types of proofs Direct proof of x F x Show that F x holds for arbitrary x, then use universal generalization. Often, F x is of the form

More information

Propositional Logic, Predicates, and Equivalence

Propositional Logic, Predicates, and Equivalence Chapter 1 Propositional Logic, Predicates, and Equivalence A statement or a proposition is a sentence that is true (T) or false (F) but not both. The symbol denotes not, denotes and, and denotes or. If

More information

Section 11.1 Sequences

Section 11.1 Sequences Math 152 c Lynch 1 of 8 Section 11.1 Sequences A sequence is a list of numbers written in a definite order: a 1, a 2, a 3,..., a n,... Notation. The sequence {a 1, a 2, a 3,...} can also be written {a

More information

Simplification by Truth Table and without Truth Table

Simplification by Truth Table and without Truth Table SUBJECT NAME SUBJECT CODE : MA 6566 MATERIAL NAME REGULATION : Discrete Mathematics : University Questions : R2013 UPDATED ON : April-May 2018 BOOK FOR REFERENCE To buy the book visit : Sri Hariganesh

More information

Counting. Math 301. November 24, Dr. Nahid Sultana

Counting. Math 301. November 24, Dr. Nahid Sultana Basic Principles Dr. Nahid Sultana November 24, 2012 Basic Principles Basic Principles The Sum Rule The Product Rule Distinguishable Pascal s Triangle Binomial Theorem Basic Principles Combinatorics: The

More information

Test Codes : MIA (Objective Type) and MIB (Short Answer Type) 2007

Test Codes : MIA (Objective Type) and MIB (Short Answer Type) 2007 Test Codes : MIA (Objective Type) and MIB (Short Answer Type) 007 Questions will be set on the following and related topics. Algebra: Sets, operations on sets. Prime numbers, factorisation of integers

More information

CSCE 222 Discrete Structures for Computing. Review for the Final. Hyunyoung Lee

CSCE 222 Discrete Structures for Computing. Review for the Final. Hyunyoung Lee CSCE 222 Discrete Structures for Computing Review for the Final! Hyunyoung Lee! 1 Final Exam Section 501 (regular class time 8:00am) Friday, May 8, starting at 1:00pm in our classroom!! Section 502 (regular

More information

Recurrence Relations

Recurrence Relations Recurrence Relations Winter 2017 Recurrence Relations Recurrence Relations A recurrence relation for the sequence {a n } is an equation that expresses a n in terms of one or more of the previous terms

More information

CIS Spring 2018 (instructor Val Tannen)

CIS Spring 2018 (instructor Val Tannen) CIS 160 - Spring 2018 (instructor Val Tannen) Lecture 09 Tuesday, February 13 PROOFS and COUNTING Figure 1: Too Many Pigeons Theorem 9.1 (The Pigeonhole Principle (PHP)) If k + 1 or more pigeons fly to

More information

Recursive Definitions

Recursive Definitions Recursive Definitions Example: Give a recursive definition of a n. a R and n N. Basis: n = 0, a 0 = 1. Recursion: a n+1 = a a n. Example: Give a recursive definition of n i=0 a i. Let S n = n i=0 a i,

More information

3 Finite continued fractions

3 Finite continued fractions MTH628 Number Theory Notes 3 Spring 209 3 Finite continued fractions 3. Introduction Let us return to the calculation of gcd(225, 57) from the preceding chapter. 225 = 57 + 68 57 = 68 2 + 2 68 = 2 3 +

More information

Simplification by Truth Table and without Truth Table

Simplification by Truth Table and without Truth Table SUBJECT NAME SUBJECT CODE : MA 6566 MATERIAL NAME REGULATION : Discrete Mathematics : University Questions : R2013 UPDATED ON : June 2017 (Scan the above Q.R code for the direct download of this material)

More information

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Lecture Notes 1 Basic Concepts of Mathematics MATH 352 Lecture Notes 1 Basic Concepts of Mathematics MATH 352 Ivan Avramidi New Mexico Institute of Mining and Technology Socorro, NM 87801 June 3, 2004 Author: Ivan Avramidi; File: absmath.tex; Date: June 11,

More information

CHAPTER 8: EXPLORING R

CHAPTER 8: EXPLORING R CHAPTER 8: EXPLORING R LECTURE NOTES FOR MATH 378 (CSUSM, SPRING 2009). WAYNE AITKEN In the previous chapter we discussed the need for a complete ordered field. The field Q is not complete, so we constructed

More information

MATH 310 Course Objectives

MATH 310 Course Objectives MATH 310 Course Objectives Upon successful completion of MATH 310, the student should be able to: Apply the addition, subtraction, multiplication, and division principles to solve counting problems. Apply

More information

Theoretical Cryptography, Lecture 10

Theoretical Cryptography, Lecture 10 Theoretical Cryptography, Lecture 0 Instructor: Manuel Blum Scribe: Ryan Williams Feb 20, 2006 Introduction Today we will look at: The String Equality problem, revisited What does a random permutation

More information

International Competition in Mathematics for Universtiy Students in Plovdiv, Bulgaria 1994

International Competition in Mathematics for Universtiy Students in Plovdiv, Bulgaria 1994 International Competition in Mathematics for Universtiy Students in Plovdiv, Bulgaria 1994 1 PROBLEMS AND SOLUTIONS First day July 29, 1994 Problem 1. 13 points a Let A be a n n, n 2, symmetric, invertible

More information

Mathematical Reasoning & Proofs

Mathematical Reasoning & Proofs Mathematical Reasoning & Proofs MAT 1362 Fall 2018 Alistair Savage Department of Mathematics and Statistics University of Ottawa This work is licensed under a Creative Commons Attribution-ShareAlike 4.0

More information

Week 15-16: Combinatorial Design

Week 15-16: Combinatorial Design Week 15-16: Combinatorial Design May 8, 2017 A combinatorial design, or simply a design, is an arrangement of the objects of a set into subsets satisfying certain prescribed properties. The area of combinatorial

More information

The Real Number System

The Real Number System MATH 337 The Real Number System Sets of Numbers Dr. Neal, WKU A set S is a well-defined collection of objects, with well-defined meaning that there is a specific description from which we can tell precisely

More information

What can you prove by induction?

What can you prove by induction? MEI CONFERENCE 013 What can you prove by induction? Martyn Parker M.J.Parker@keele.ac.uk Contents Contents iii 1 Splitting Coins.................................................. 1 Convex Polygons................................................

More information

1. The positive zero of y = x 2 + 2x 3/5 is, to the nearest tenth, equal to

1. The positive zero of y = x 2 + 2x 3/5 is, to the nearest tenth, equal to SAT II - Math Level Test #0 Solution SAT II - Math Level Test No. 1. The positive zero of y = x + x 3/5 is, to the nearest tenth, equal to (A) 0.8 (B) 0.7 + 1.1i (C) 0.7 (D) 0.3 (E). 3 b b 4ac Using Quadratic

More information

MATH 117 LECTURE NOTES

MATH 117 LECTURE NOTES MATH 117 LECTURE NOTES XIN ZHOU Abstract. This is the set of lecture notes for Math 117 during Fall quarter of 2017 at UC Santa Barbara. The lectures follow closely the textbook [1]. Contents 1. The set

More information

Numbers and their divisors

Numbers and their divisors Chapter 1 Numbers and their divisors 1.1 Some number theoretic functions Theorem 1.1 (Fundamental Theorem of Arithmetic). Every positive integer > 1 is uniquely the product of distinct prime powers: n

More information

Notes for Finite Mathematics (WUSTL, Math 220, Summer 2017)

Notes for Finite Mathematics (WUSTL, Math 220, Summer 2017) Notes for Finite Mathematics (WUSTL, Math 220, Summer 2017) Mohammad Jabbari April 22, 2018 Contents 0 Prologue 4 1 Counting 7 1.1 Some Notions and Definitions: Sets, Functions, Sequences, One-to-One Correspondences,

More information

Mathematical Fundamentals

Mathematical Fundamentals Mathematical Fundamentals Sets Factorials, Logarithms Recursion Summations, Recurrences Proof Techniques: By Contradiction, Induction Estimation Techniques Data Structures 1 Mathematical Fundamentals Sets

More information

Applications. More Counting Problems. Complexity of Algorithms

Applications. More Counting Problems. Complexity of Algorithms Recurrences Applications More Counting Problems Complexity of Algorithms Part I Recurrences and Binomial Coefficients Paths in a Triangle P(0, 0) P(1, 0) P(1,1) P(2, 0) P(2,1) P(2, 2) P(3, 0) P(3,1) P(3,

More information

MAT115A-21 COMPLETE LECTURE NOTES

MAT115A-21 COMPLETE LECTURE NOTES MAT115A-21 COMPLETE LECTURE NOTES NATHANIEL GALLUP 1. Introduction Number theory begins as the study of the natural numbers the integers N = {1, 2, 3,...}, Z = { 3, 2, 1, 0, 1, 2, 3,...}, and sometimes

More information

Groups. 3.1 Definition of a Group. Introduction. Definition 3.1 Group

Groups. 3.1 Definition of a Group. Introduction. Definition 3.1 Group C H A P T E R t h r e E Groups Introduction Some of the standard topics in elementary group theory are treated in this chapter: subgroups, cyclic groups, isomorphisms, and homomorphisms. In the development

More information

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics Undergraduate Notes in Mathematics Arkansas Tech University Department of Mathematics An Introductory Single Variable Real Analysis: A Learning Approach through Problem Solving Marcel B. Finan c All Rights

More information

THE TEACHER UNDERSTANDS THE REAL NUMBER SYSTEM AND ITS STRUCTURE, OPERATIONS, ALGORITHMS, AND REPRESENTATIONS

THE TEACHER UNDERSTANDS THE REAL NUMBER SYSTEM AND ITS STRUCTURE, OPERATIONS, ALGORITHMS, AND REPRESENTATIONS THE REAL NUMBER SYSTEM C O M P E T E N C Y 1 THE TEACHER UNDERSTANDS THE REAL NUMBER SYSTEM AND ITS STRUCTURE, OPERATIONS, ALGORITHMS, AND REPRESENTATIONS This competency section reviews some of the fundamental

More information

1. Given the public RSA encryption key (e, n) = (5, 35), find the corresponding decryption key (d, n).

1. Given the public RSA encryption key (e, n) = (5, 35), find the corresponding decryption key (d, n). MATH 135: Randomized Exam Practice Problems These are the warm-up exercises and recommended problems taken from all the extra practice sets presented in random order. The challenge problems have not been

More information

Homework #2 Solutions Due: September 5, for all n N n 3 = n2 (n + 1) 2 4

Homework #2 Solutions Due: September 5, for all n N n 3 = n2 (n + 1) 2 4 Do the following exercises from the text: Chapter (Section 3):, 1, 17(a)-(b), 3 Prove that 1 3 + 3 + + n 3 n (n + 1) for all n N Proof The proof is by induction on n For n N, let S(n) be the statement

More information

1 Sequences and Summation

1 Sequences and Summation 1 Sequences and Summation A sequence is a function whose domain is either all the integers between two given integers or all the integers greater than or equal to a given integer. For example, a m, a m+1,...,

More information

CMSC Discrete Mathematics SOLUTIONS TO FIRST MIDTERM EXAM October 18, 2005 posted Nov 2, 2005

CMSC Discrete Mathematics SOLUTIONS TO FIRST MIDTERM EXAM October 18, 2005 posted Nov 2, 2005 CMSC-37110 Discrete Mathematics SOLUTIONS TO FIRST MIDTERM EXAM October 18, 2005 posted Nov 2, 2005 Instructor: László Babai Ryerson 164 e-mail: laci@cs This exam contributes 20% to your course grade.

More information

Induction and Recursion

Induction and Recursion . All rights reserved. Authorized only for instructor use in the classroom. No reproduction or further distribution permitted without the prior written consent of McGraw-Hill Education. Induction and Recursion

More information

Mathathon Round 1 (2 points each)

Mathathon Round 1 (2 points each) Mathathon Round ( points each). A circle is inscribed inside a square such that the cube of the radius of the circle is numerically equal to the perimeter of the square. What is the area of the circle?

More information

Hence, the sequence of triangular numbers is given by., the. n th square number, is the sum of the first. S n

Hence, the sequence of triangular numbers is given by., the. n th square number, is the sum of the first. S n Appendix A: The Principle of Mathematical Induction We now present an important deductive method widely used in mathematics: the principle of mathematical induction. First, we provide some historical context

More information

Logic. Facts (with proofs) CHAPTER 1. Definitions

Logic. Facts (with proofs) CHAPTER 1. Definitions CHAPTER 1 Logic Definitions D1. Statements (propositions), compound statements. D2. Truth values for compound statements p q, p q, p q, p q. Truth tables. D3. Converse and contrapositive. D4. Tautologies

More information

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2. Chapter 1 LINEAR EQUATIONS 11 Introduction to linear equations A linear equation in n unknowns x 1, x,, x n is an equation of the form a 1 x 1 + a x + + a n x n = b, where a 1, a,, a n, b are given real

More information

Chapter 5.1: Induction

Chapter 5.1: Induction Chapter.1: Induction Monday, July 1 Fermat s Little Theorem Evaluate the following: 1. 1 (mod ) 1 ( ) 1 1 (mod ). (mod 7) ( ) 8 ) 1 8 1 (mod ). 77 (mod 19). 18 (mod 1) 77 ( 18 ) 1 1 (mod 19) 18 1 (mod

More information

Fundamentals of Pure Mathematics - Problem Sheet

Fundamentals of Pure Mathematics - Problem Sheet Fundamentals of Pure Mathematics - Problem Sheet ( ) = Straightforward but illustrates a basic idea (*) = Harder Note: R, Z denote the real numbers, integers, etc. assumed to be real numbers. In questions

More information

MATH 145 LECTURE NOTES. Zhongwei Zhao. My Lecture Notes for MATH Fall

MATH 145 LECTURE NOTES. Zhongwei Zhao. My Lecture Notes for MATH Fall MATH 145 LECTURE NOTES Zhongwei Zhao My Lecture Notes for MATH 145 2016 Fall December 2016 Lecture 1, Sept. 9 Course Orientation and Organization About the Professor Stephen New MC 5419 Ext 35554 Email:

More information

1. (16 points) Circle T if the corresponding statement is True or F if it is False.

1. (16 points) Circle T if the corresponding statement is True or F if it is False. Name Solution Key Show All Work!!! Page 1 1. (16 points) Circle T if the corresponding statement is True or F if it is False. T F The sequence {1, 1, 1, 1, 1, 1...} is an example of an Alternating sequence.

More information

CMSC Discrete Mathematics SOLUTIONS TO SECOND MIDTERM EXAM November, 2005

CMSC Discrete Mathematics SOLUTIONS TO SECOND MIDTERM EXAM November, 2005 CMSC-37110 Discrete Mathematics SOLUTIONS TO SECOND MIDTERM EXAM November, 2005 Instructor: László Babai Ryerson 164 e-mail: laci@cs This exam contributes 20% to your course grade. 1. (6 points) Let a

More information

Contribution of Problems

Contribution of Problems Exam topics 1. Basic structures: sets, lists, functions (a) Sets { }: write all elements, or define by condition (b) Set operations: A B, A B, A\B, A c (c) Lists ( ): Cartesian product A B (d) Functions

More information

Discrete Mathematics. Kishore Kothapalli

Discrete Mathematics. Kishore Kothapalli Discrete Mathematics Kishore Kothapalli 2 Chapter 4 Advanced Counting Techniques In the previous chapter we studied various techniques for counting and enumeration. However, there are several interesting

More information

Series of Error Terms for Rational Approximations of Irrational Numbers

Series of Error Terms for Rational Approximations of Irrational Numbers 2 3 47 6 23 Journal of Integer Sequences, Vol. 4 20, Article..4 Series of Error Terms for Rational Approximations of Irrational Numbers Carsten Elsner Fachhochschule für die Wirtschaft Hannover Freundallee

More information

CHAPTER 4: EXPLORING Z

CHAPTER 4: EXPLORING Z CHAPTER 4: EXPLORING Z MATH 378, CSUSM. SPRING 2009. AITKEN 1. Introduction In this chapter we continue the study of the ring Z. We begin with absolute values. The absolute value function Z N is the identity

More information

Teaching with a Smile

Teaching with a Smile Teaching with a Smile Igor Minevich Boston College AMS - MAA Joint Mathematics Meetings January 11, 2015 Outline 1 Introduction 2 Puzzles and Other Fun Stuff 3 Projects Yin-Yang of Mathematics Yang Logic

More information

MATH 201 Solutions: TEST 3-A (in class)

MATH 201 Solutions: TEST 3-A (in class) MATH 201 Solutions: TEST 3-A (in class) (revised) God created infinity, and man, unable to understand infinity, had to invent finite sets. - Gian Carlo Rota Part I [5 pts each] 1. Let X be a set. Define

More information

Proofs. Chapter 2 P P Q Q

Proofs. Chapter 2 P P Q Q Chapter Proofs In this chapter we develop three methods for proving a statement. To start let s suppose the statement is of the form P Q or if P, then Q. Direct: This method typically starts with P. Then,

More information

0 Sets and Induction. Sets

0 Sets and Induction. Sets 0 Sets and Induction Sets A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a A to denote that a is an element of the set

More information

Mathematical Background

Mathematical Background Chapter 1 Mathematical Background When we analyze various algorithms in terms of the time and the space it takes them to run, we often need to work with math. That is why we ask you to take MA 2250 Math

More information

THE TEACHER UNDERSTANDS THE REAL NUMBER SYSTEM AND ITS STRUCTURE, OPERATIONS, ALGORITHMS, AND REPRESENTATIONS

THE TEACHER UNDERSTANDS THE REAL NUMBER SYSTEM AND ITS STRUCTURE, OPERATIONS, ALGORITHMS, AND REPRESENTATIONS The real number SySTeM C O M P E T E N C Y 1 THE TEACHER UNDERSTANDS THE REAL NUMBER SYSTEM AND ITS STRUCTURE, OPERATIONS, ALGORITHMS, AND REPRESENTATIONS This competency section reviews some of the fundamental

More information

5. Sequences & Recursion

5. Sequences & Recursion 5. Sequences & Recursion Terence Sim 1 / 42 A mathematician, like a painter or poet, is a maker of patterns. Reading Sections 5.1 5.4, 5.6 5.8 of Epp. Section 2.10 of Campbell. Godfrey Harold Hardy, 1877

More information

IVA S STUDY GUIDE FOR THE DISCRETE FINAL EXAM - SELECTED SOLUTIONS. 1. Combinatorics

IVA S STUDY GUIDE FOR THE DISCRETE FINAL EXAM - SELECTED SOLUTIONS. 1. Combinatorics IVA S STUDY GUIDE FOR THE DISCRETE FINAL EXAM - SELECTED SOLUTIONS Combinatorics Go over combinatorics examples in the text Review all the combinatorics problems from homewor Do at least a couple of extra

More information

Every subset of {1, 2,...,n 1} can be extended to a subset of {1, 2, 3,...,n} by either adding or not adding the element n.

Every subset of {1, 2,...,n 1} can be extended to a subset of {1, 2, 3,...,n} by either adding or not adding the element n. 11 Recurrences A recurrence equation or recurrence counts things using recursion. 11.1 Recurrence Equations We start with an example. Example 11.1. Find a recurrence for S(n), the number of subsets of

More information

Solutions to Practice Final 3

Solutions to Practice Final 3 s to Practice Final 1. The Fibonacci sequence is the sequence of numbers F (1), F (2),... defined by the following recurrence relations: F (1) = 1, F (2) = 1, F (n) = F (n 1) + F (n 2) for all n > 2. For

More information

ELEMENTARY LINEAR ALGEBRA

ELEMENTARY LINEAR ALGEBRA ELEMENTARY LINEAR ALGEBRA K. R. MATTHEWS DEPARTMENT OF MATHEMATICS UNIVERSITY OF QUEENSLAND Second Online Version, December 1998 Comments to the author at krm@maths.uq.edu.au Contents 1 LINEAR EQUATIONS

More information

Math 109 September 1, 2016

Math 109 September 1, 2016 Math 109 September 1, 2016 Question 1 Given that the proposition P Q is true. Which of the following must also be true? A. (not P ) or Q. B. (not Q) implies (not P ). C. Q implies P. D. A and B E. A, B,

More information