Mathematical Background
|
|
- Joseph Dwain Lester
- 5 years ago
- Views:
Transcription
1 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 for CS. For example, when the following algorithm runs a two-layer for loop with loop variable k going from 1 through j, and another, j, going from 1 to n, for (j=1; j<=n; j++) for (; k<=j; k++) print k; we might want to know how many prints it has to do... 1
2 Let s find out For j [1, n] and k [1, j], the inner loop does one print, the total print statements the whole segment will carry out is j j=1 1 = j=1 j = n? = n(n + 1). 2 Assume each print takes a time unit, it takes n(n+1) 2 units to complete the above segment. In general, if such a general step takes f(j) steps, for j [1,n], the total time is j=1 f(j). Since we are still using the sequential platform a lot, the summation related analysis is quite useful. 2
3 More about summation Given a sequence a 1, a 2,..., a n, their finite sum a 1 + a 2 + +a n, n 0, can be written as the following: a k. When n = 0, the sum is defined to be 0. Another special case is the following: a k = lim n n a k. The sum operation has the linearity property, i.e., for any real number c and any finite sequences a 1, a 2,..., a n, and b 1, b 2,..., b n, (ca k + b k )? = c a k + b k. 3
4 Arithmetic series The arithmetic series is simply the following summation: k = n. We have already seen that k = n(n + 1). 2 We also have the following: and k 2 = n(n + 1)(2n + 1), 6 k 3 = n2 (n + 1) 2. 4 Question: Is there a pattern for n k m? Answer: n 1, n k m? = Θ(n m+1 ). 4
5 Harmonic series and more... The Harmonic series is also pretty useful in algorithm analysis, particularly in analyzing the Quicksort algorithm. For positive integers n ( 1), the n th harmonic number is H n = 1 k = n = ln n + O(1). The k th harmonic produced by a violin string is the fundamental tune produced by a string 1/k times as long. More generally, let ζ(z) = k 1 1 k z = k 1 k z, it is immediate that ζ(1) > H n. It is also well known that ζ(2) = k 1 1 k 2 = = π2 6. 5
6 We also have ζ(4) = k 1 ζ(6) = k 1 Just for fun... 1 k 4 = = π k 6 = = π The pattern continues with ζ(k), k is even, i.e., such a ζ(k), when k is even, equals a product of a rational number and π k, although itself is not since π is not rational. No such results hold for ζ(k), where k is odd, thus they can t be proved irrational by the same token. But, it has been established that ζ(3) is indeed irrational, and one of ζ(5), ζ(7), ζ(9), and ζ(11), is irrational as well, although it is uncertain which one is. 6
7 Geometric series By the geometric series, we mean the following: k=0 x k = 1 + x + + x n. When x = 1, we have that k=0 x k = n + 1. In general, when x 1, it is also easy to see that k=0 Finally, when x < 1, k=0 x k = lim n = 1 x 1 lim n x k? = x n+1 1 x 1. n k=0 ( x n+1 1 x k x n+1 1 = lim n x 1 ) = 1 1 x. 7
8 Telescoping series For any sequence a k0 1, a k0,..., a n, we have n 0 k=k 0 (a k a k 1 )? = a n0 a k0 1. Below is an example following the same reasoning. = n 1 n 1 1? ( 1 = k(k + 1) k 1 ) k + 1 ( ) ( ) ( n 1 1 ) n = 1 1 n. Question: How does the above telescope? Again, we will use the above result in analyzing the Quicksort algorithm. 8
9 A little about products Similarly, the product of a 1, a 2,..., a n can be represented as the following Π n a k. Again, if n = 0, we define the product to be 1. A quite useful case is the following: for any positive c, log c (a b) = log c a + log c b. In general, we have the following: log c Π n a k = log c a k. Log of the product is the sum of log. 9
10 Summation evaluation It is not always easy to evaluate summations. Thus, we are often happy with an upper bound of the summation. This is often all we need in estimating the running time of an algorithm: Find out an upper bound of an algorithm, then see if our system can handle it.... In particular, the upper bound of a sum of a series can be found by bounding each item of the series with, e.g., the largest item in the series. For example, k n = n 2. In general, if we let a max = max k [1,n] a k, then n a k na max. 10
11 A bit deeper... Given the summation n k=0 a k, if 0 < a k+1 /a k r < 1 for all k 0, then a k a 0 r k. Notice that the above really says that none of the a k equals 0. If some of the a k equals 0, we take them out. We then have the following k=0 a k? k=0 a 0 r k = a 0 using a result we got earlier. k=0 r k = a 0 1 r, 11
12 An example Given k 3 k = , we want to find out a simple upper bound of this sum. To apply the previous result, which starts with 0, we rewrite the above as the following: k 3 k = k 1 k 3 k = k+1 1 k k+1 = k=0 k k+1. Take a k = k+1 3 k+1, we have a 0 =
13 Moreover, for all k 0, the ratio of the two consecutive terms is r = ak+1 a k = (k + 2)3k+1 (k + 1)3 k+2 = 1 3 k + 2 k Thus, we immediately have that k 3 k = = a 0 1 r = 1 3 k=0 k k+1 a /3 = 1. r k k=0 Thus, this complicated sum is no more than 1. We note that computer programs, such as Maple or MATLAB, have been developed to find out closed-form solutions for summations if they exist. 13
14 Rules of sum and product You must have learned this in, e.g., MA2250 or MA3200. The rule of sum states that the number of ways to choose an element from one of two disjoint sets is the sum of the sizes of both. For example, if each position on a car s license place contains either a digit or a letter, there are 36 choices for that position. The rule of product states that the number of ways to choose an ordered pair is the number of ways to choose the first times the number of ways to choose the second. To continue the previous example, if there are four positions in a license, there will be 36 4 (= 1,679,616) different plates. Question: How about three letters followed by three digits, or seven digits? 14
15 Permutation In many cases, recursion provides a powerful problem solving tool. The generation of permutation provides a demonstrating example. The permutations of three items, e.g., a, b, and c are abc, acb, bac, bca, cab, and cba. Given n distinguishable objects: e 1, e 2,..., e n, we want to know 1) how many ways are there to line them up, i.e., the number of permutations, and 2) how to construct all these permutations. Question: If there are three burgers, four soft drinks, and two side orders, how many value meals can you make out of them? 15
16 Number of permutations There are n! permutations for n distinguishable objects. Clearly, there are n choices for the first position, n 1 for the second,..., and 1 for the last. Hence, by the rule of product, there are n (n 1) 1 = n! ways. Recursively, let M(n) be the number of permutations for n distinguishable objects, again, by applying the rule of the product, we have that M(1) = 1 M(n) = n M(n 1),n > 1. Solving the above, we have that M(n) = n!. Question: How? 16
17 A bunch of notations Let E = {e 1,..., e n } denote the set of n objects, and let E i be the set obtained by removing e i from E. For example, if E = {a, b,c}, i.e., e 1 = a, e 2 = b and e 3 = c, then E 1 = {b, c}, and E 2 = {a,c}, and E 3 = {a,b}. Let perm(x) be the collection of all the permutations based on X, and let e i perm(x) be all the permutations of X {e i } obtained by prefixing each and every permutation in X with e i, where stands for concatenation and is often omitted when it is clear. Thus, perm(e 1 ) = {bc, cb}, e 1 perm(e 1 ) = {abc,acb}, e 2 perm(e 2 ) = {bac,bca}, and e 3 perm(e 3 ) = {cab,cba}. 17
18 Permutation construction We will do it recursively. For the base case, when n = 1, E = {e 1 }, the only permutation is just e 1. In general, perm(e) = e 1 perm(e 1 ) e n perm(e n ). For example, if E = {a,b, c}, then perm(e) is a perm(e 1 ) plus those in b perm(e 2 ), and those in c perm(e 3 ). In other words, perm(e) = {abc,acb,bac, bca,cab, cba}. Question: How do we implement the above idea with a computer algorithm? 18
19 An algorithm Assume we store (a 0,..., a n 1 ) in list[n]. //The following generates all permutations where //list[0] through list[k-1] are fixed. void Perm(T list[], int k, int m){ int i; if (k == m) { //With only one choice for a[k], //we are done. Just print it out. for (i = 0; i <= m; i++) System.out.print(list[i]); System.out.println();} else for (i = k; i <= m; i++) { //Fix list[k] with something as well. //The first k+1 items are fixed. Swap(list[k], list[i]); //Generate the permutations //with this many items fixed. Perm(list, k+1, m); //Put it back and try next. Swap(list[k], list[i]); } } 19
20 What is going on? Let s check out an example of applying the procedure to (a, b, c). In general, when calling Perm(list, k, m) on an array a[0, m], what we want to get is all the permutations of the elements stored within a[0, m], where the prefix a[0, k-1] is fixed. In particular, Perm(a, 0, n-1) is to generate all the permutations of the elements of a[0, n-1] with nothing fixed. Notice that a[0, -1] is an empty segment. When k=m, there is only one choice of a[k] (=a[m]), we just print out the completed permutation. Otherwise, we extend the prefix with each and every one in a[k, m], then recursively generate all the permutations with this newly augmented prefix. Homework: Generate all the permutations of {a,b, c} by following the algorithm. 20
21 An example Let n = 4, let the four elements be {a,b, c, d}, and let k = 2. 1.a. We first fix the first two elements, position 0 and ( 1, by choosing two out of four elements in 4 2) = 6 ways: {a,b}, {a,c}, {a, d}, {b,c}, {b,d}, and {c, d}. 1.b. For each of these six choices, we arrange the two chosen elements in two (=2!) ways, e.g., ab and ba. 2. For position 2, there are two choices of placing an element there. For example, if we choose a and b in Step 1.a, we can place either c or d in position We finally have just one symbol left, e.g., if we choose a, b and c in Steps 1.a, 1.b, and 2, we have just d left for position 4. In total, we have = 24 = 4! permutations, which agrees with an earlier result. 21
22 How many in general? ( n k) 1. We choose k ( [1,n]) elements in ways, and then form a permutation using these many elements. Thus, there are ( ) n k k! ways to make this segment of k elements fixed. 2. We then have n k ways to select one out of n k elements to place it in position k Finally, there are (n k 1)! ways to arrange the remaining n k 1 elements. Thus, the total number of permutations we generate with the above Perm(a, 0, n-1) procedure is, by the rule of product, ( n) k! (n k) (n k 1)! = n!. k So, the algorithm works. 22
23 k Permutation Step 1 in the previous process is to form a list of k elements chosen from n, often called k- permutation. More generally, a k permutation of a finite set S, containing n elements, is an ordered sequence (Step 1.b) of k elements taken from S (Step 1.a). For example, if S is {a,b, c, d}, there are twelve 2-permutations of S, {ab,ac, ad,..., cd}. The number of the k permutations of S, containing n elements, P(n, k), is thus n(n 1) (n k + 1) = n! (n k)!. For example, when = 4 and k = 2, P(4,2) = 4! 2! = 24 2 =
24 Combination Notice that k-permutation is associated with an order, which sometimes we can do without. For example, a group, or a set, of things do not come with an order. This latter concept is captured with the notion of combination. Mathematically speaking, a k-combination of an n-set S is simply a subset of S. Question: With ten students, how many project teams of four can we form? As a start, there are twelve 2-permutations out of four symbols, including both ab and ba, both of which refer to the same subset {a,b}. Thus, the answer should be 6. On the other hand, there are indeed exactly six 2-combination of the 4-set {a,b, c, d} : {a, b}, {a, c} {a,d}, {b, d}, {b,c}, and {c, d}. 24
25 Combination formula Given an n set, to find out P(n, k), the number of all the k permutations, we start with C(n,k), the number of all the k combination. For each such k-combination, a set with k elements, we can generate k! k permutations. For example, {a, b}, a combination of a and b, corresponds to two different permutations: ab and ba. Thus, P(n, k) = C(n, k) k!, in other words, C(n, k) ( = ( n) ) = k P(n, k) k! = n! (n k)!k!. To find out how many project teams we can get out of ten people if each team contains four people, we have C(10,4) = P(10,4) 4! = 10! 4!6! = =
26 What about proofs? Besides doing calculations, we often need to prove statements, namely, providing mathematically solid arguments to show that something must be correct beyond any doubt. There are several proof techniques, including proof by induction, proof by contradiction, and proof by construction because of the mechanical nature of a computer. You must have done a bunch in MA2250. Each technique has its place in our study of algorithms. We will talk about the first two here, and deal with the constructive approach later. All such techniques, particularly the last one, will play a crucial role in CS
27 Proof by induction When a statement is involved with a natural number argument, n, we have infinite number of instances to prove. Proof by mathematical induction turns out to be quite effective in this case. The general approach is as follows: 1.Show that some statement, P(n), is true for a base case n 0, i.e., P(n 0 ). 2. Assume that P(n) is true for n, prove that P(n) is true for n + 1, i.e., n n 0, P(n) P(n + 1). We can then conclude that P(n) holds for all n n 0, i.e., n n 0, P(n). We also often use the following equivalent strong induction: Assume that P(k) holds for all k < n, and prove P(n) holds for n, then, n P(n). 27
28 An example For all n 1, n i=1 i 2 = n(n+1)(2n+1) 6. Proof by induction: When n = 1, clearly, LHS = 1 i=1 i 2 = 1 = = RHS. Assume that, for n 1, n i=1 i 2 = n(n+1)(2n+1) 6. LHS = n+1 i=1 i 2 = i=1 i 2 + (n + 1) 2 n(n + 1)(2n + 1) = + (n + 1) 2 6 (n + 1) = [n(2n + 1) + 6(n + 1)] 6 (n + 1) = (2n 2 + 7n + 6) 6 (n + 1) = (n + 2)(2n + 3) 6 (n + 1) = [(n + 1) + 1)[(2(n + 1) + 1)] 6 = RHS. 28
29 A stronger example Given the following Fibonacci series: F 0 = 1, F 1 = 1, F n = F n 1 + F n 2, n 2. Then, for all n 1, F n < ( 5 3 ) n. Proof: Assume that, for all k < n, F k < then we have ( ) 5 n 1 F n = F n 1 + F n 2 < + ( ) 3 5 n [ 3 = ] = 24 ( ) 5 n < ( ) 5 n. 3 ( 5 3) n 2 ( 53 ) k, Question: Where and how did we use the inductive assumption? 29
30 Happy Valentine s Day! Claim: The colors of all the flowers are the same. Proof: By induction on n, the number of flowers in a bouquet. The base case of n = 1 is trivial. Assume that the statement is true for n, and we now place n + 1 flowers into the bouquet. Take one, f 1, out. As there are only n flowers left, by the inductive assumption, they must be of the same color, say c. Now, take another one, f 2, out of the bouquet and put f 1 back. As the bouquet still has n flowers, those n flowers must also be of the same color, c. Particularly, the color of f 1 must also be c. Thus, the color of all of the n + 1 flowers is c. Therefore, by the inductive principle, the colors of all the flowers are the same. 30
31 What s wrong? When we have two flowers in the bouquet, i.e., n+1 = 2 (n 1 = 0), our implicit claim that the color of f 1 must be the same as that of those (n 1) flowers left in the bouquet does not hold up(?). Thus, F(1) F(2). As a result, the inductive part, for all n 1, F(n) F(n + 1), doesn t work. If we treat n = 2 as the base case, then, although we do have the inductive statement, for all n 2, F(n) F(n + 1), we can t prove the base case, i.e., the colors of any two flowers are the same. Thus, we still can t finish the whole proof. Lesson: To prove something inductively, both parts have to be checked out. 31
32 Proof by contradiction To prove some statement P is true, assume that it is false first, i.e., P is true. If this latter assumption leads to a contradiction to what has been known, or common sense, then that assumption, i.e., P is true, must be false. Thus, the original statement P must be true. For example, Either I am tired or sick. If I am sick, I go home. I am not going home. So, I am tired. Assume that I am not tired, then, it must be the case that I am sick. It follows that I go home. But, it is a contradiction to the given statement that I am not going home. Thus, the assumption is incorrect. As a result, I must be tired. 32
33 Another example It is easy (?) to prove that, for all x > 0, x + 4 x 4. Now let s assume that it is false, i.e., for some x > 0, x + 4 x < 4. (Notice that xp(x) x P(x). For example, It is not the case that I passed all the courses means that, for some course, I did not pass it. ) Since x > 0, we have that x + 4 x < 4 iff x2 + 4 < 4x iff x 2 4x + 4 < 0 iff (x 2) 2 < 0, which contradicts the fact that, for all x, (x 2) 2 0. Hence, it must be the case that, for all x > 0, x + 4 x 4. 33
34 Yet another example Let s prove that 2 is not a rational number. Just assume that 2 is a rational number, i.e., for some m and n, 2 = m /n. By dividing both m and n by all the factors common to both of them, we obtain 2 = m/n for some integers m and n, which share no common factors. Since 2 = m/n, m = n 2, i.e.,m 2 = 2n 2. Therefore, m 2 is even. Thus, m must be even,(?) i.e., for some k, m = 2k. Replace m with 2k, we have that 4k 2 = 2n 2, i.e., n 2 = 2k 2. By the same token, n is also even. Hence, both m and n has a common factor of 2. This is a contradiction. Hence, 2 must not be rational. 34
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 information1 Alphabets and Languages
1 Alphabets and Languages Look at handout 1 (inference rules for sets) and use the rules on some examples like {a} {{a}} {a} {a, b}, {a} {{a}}, {a} {{a}}, {a} {a, b}, a {{a}}, a {a, b}, a {{a}}, a {a,
More informationHomework 7 Solutions, Math 55
Homework 7 Solutions, Math 55 5..36. (a) Since a is a positive integer, a = a 1 + b 0 is a positive integer of the form as + bt for some integers s and t, so a S. Thus S is nonempty. (b) Since S is nonempty,
More informationDR.RUPNATHJI( DR.RUPAK NATH )
Contents 1 Sets 1 2 The Real Numbers 9 3 Sequences 29 4 Series 59 5 Functions 81 6 Power Series 105 7 The elementary functions 111 Chapter 1 Sets It is very convenient to introduce some notation and terminology
More informationCombinatorics. But there are some standard techniques. That s what we ll be studying.
Combinatorics Problem: How to count without counting. How do you figure out how many things there are with a certain property without actually enumerating all of them. Sometimes this requires a lot of
More informationCounting 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 informationExample: Use a direct argument to show that the sum of two even integers has to be even. Solution: Recall that an integer is even if it is a multiple
Use a direct argument to show that the sum of two even integers has to be even. Solution: Recall that an integer is even if it is a multiple of 2, that is, an integer x is even if x = 2y for some integer
More information. As the binomial coefficients are integers we have that. 2 n(n 1).
Math 580 Homework. 1. Divisibility. Definition 1. Let a, b be integers with a 0. Then b divides b iff there is an integer k such that b = ka. In the case we write a b. In this case we also say a is a factor
More informationAny Wizard of Oz fans? Discrete Math Basics. Outline. Sets. Set Operations. Sets. Dorothy: How does one get to the Emerald City?
Any Wizard of Oz fans? Discrete Math Basics Dorothy: How does one get to the Emerald City? Glynda: It is always best to start at the beginning Outline Sets Relations Proofs Sets A set is a collection of
More informationAn analogy from Calculus: limits
COMP 250 Fall 2018 35 - big O Nov. 30, 2018 We have seen several algorithms in the course, and we have loosely characterized their runtimes in terms of the size n of the input. We say that the algorithm
More informationInduction 1 = 1(1+1) = 2(2+1) = 3(3+1) 2
Induction 0-8-08 Induction is used to prove a sequence of statements P(), P(), P(3),... There may be finitely many statements, but often there are infinitely many. For example, consider the statement ++3+
More informationAlgorithms: Lecture 2
1 Algorithms: Lecture 2 Basic Structures: Sets, Functions, Sequences, and Sums Jinwoo Kim jwkim@jjay.cuny.edu 2.1 Sets 2 1 2.1 Sets 3 2.1 Sets 4 2 2.1 Sets 5 2.1 Sets 6 3 2.1 Sets 7 2.2 Set Operations
More informationCS1800: Mathematical Induction. Professor Kevin Gold
CS1800: Mathematical Induction Professor Kevin Gold Induction: Used to Prove Patterns Just Keep Going For an algorithm, we may want to prove that it just keeps working, no matter how big the input size
More informationMath Lecture 3 Notes
Math 1010 - Lecture 3 Notes Dylan Zwick Fall 2009 1 Operations with Real Numbers In our last lecture we covered some basic operations with real numbers like addition, subtraction and multiplication. This
More informationPROBLEM SET 3: PROOF TECHNIQUES
PROBLEM SET 3: PROOF TECHNIQUES CS 198-087: INTRODUCTION TO MATHEMATICAL THINKING UC BERKELEY EECS FALL 2018 This homework is due on Monday, September 24th, at 6:30PM, on Gradescope. As usual, this homework
More informationPUTNAM TRAINING PROBLEMS
PUTNAM TRAINING PROBLEMS (Last updated: December 3, 2003) Remark This is a list of Math problems for the NU Putnam team to be discussed during the training sessions Miguel A Lerma 1 Bag of candies In a
More informationMATH 135 Fall 2006 Proofs, Part IV
MATH 135 Fall 006 s, Part IV We ve spent a couple of days looking at one particular technique of proof: induction. Let s look at a few more. Direct Here we start with what we re given and proceed in a
More informationMathematics-I Prof. S.K. Ray Department of Mathematics and Statistics Indian Institute of Technology, Kanpur. Lecture 1 Real Numbers
Mathematics-I Prof. S.K. Ray Department of Mathematics and Statistics Indian Institute of Technology, Kanpur Lecture 1 Real Numbers In these lectures, we are going to study a branch of mathematics called
More informationMath /Foundations of Algebra/Fall 2017 Foundations of the Foundations: Proofs
Math 4030-001/Foundations of Algebra/Fall 017 Foundations of the Foundations: Proofs A proof is a demonstration of the truth of a mathematical statement. We already know what a mathematical statement is.
More informationPUTNAM 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 informationCSE 311: Foundations of Computing. Lecture 26: Cardinality
CSE 311: Foundations of Computing Lecture 26: Cardinality Cardinality and Computability Computers as we know them grew out of a desire to avoid bugs in mathematical reasoning A brief history of reasoning
More informationCHAPTER 1. REVIEW: NUMBERS
CHAPTER. REVIEW: NUMBERS Yes, mathematics deals with numbers. But doing math is not number crunching! Rather, it is a very complicated psychological process of learning and inventing. Just like listing
More informationReading and Writing. Mathematical Proofs. Slides by Arthur van Goetham
Reading and Writing Mathematical Proofs Slides by Arthur van Goetham What is a proof? Why explanations are not proofs What is a proof? A method for establishing truth What establishes truth depends on
More informationAlgorithms: Background
Algorithms: Background Amotz Bar-Noy CUNY Amotz Bar-Noy (CUNY) Algorithms: Background 1 / 66 What is a Proof? Definition I: The cogency of evidence that compels acceptance by the mind of a truth or a fact.
More informationLecture 4: Constructing the Integers, Rationals and Reals
Math/CS 20: Intro. to Math Professor: Padraic Bartlett Lecture 4: Constructing the Integers, Rationals and Reals Week 5 UCSB 204 The Integers Normally, using the natural numbers, you can easily define
More informationCSCE 222 Discrete Structures for Computing. Dr. Hyunyoung Lee
CSCE 222 Discrete Structures for Computing Sequences and Summations Dr. Hyunyoung Lee Based on slides by Andreas Klappenecker 1 Sequences 2 Sequences A sequence is a function from a subset of the set of
More informationMatrix Multiplication
Matrix Multiplication Given two vectors a = [a 1,..., a k ] and b = [b 1,..., b k ], their inner product (or dot product) is a b = k i=1 a ib i [1, 2, 3] [ 2, 4, 6] = (1 2) + (2 4) + (3 6) = 24. We can
More informationCIS 2033 Lecture 5, Fall
CIS 2033 Lecture 5, Fall 2016 1 Instructor: David Dobor September 13, 2016 1 Supplemental reading from Dekking s textbook: Chapter2, 3. We mentioned at the beginning of this class that calculus was a prerequisite
More informationCSE 20 DISCRETE MATH. Fall
CSE 20 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Today's learning goals Define and compute the cardinality of a set. Use functions to compare the sizes of sets. Classify sets
More information1 What is the area model for multiplication?
for multiplication represents a lovely way to view the distribution property the real number exhibit. This property is the link between addition and multiplication. 1 1 What is the area model for multiplication?
More informationCS1800: Sequences & Sums. Professor Kevin Gold
CS1800: Sequences & Sums Professor Kevin Gold Moving Toward Analysis of Algorithms Today s tools help in the analysis of algorithms. We ll cover tools for deciding what equation best fits a sequence of
More informationIntroduction to Series and Sequences Math 121 Calculus II Spring 2015
Introduction to Series and Sequences Math Calculus II Spring 05 The goal. The main purpose of our study of series and sequences is to understand power series. A power series is like a polynomial of infinite
More informationMathematical Induction
Mathematical Induction MAT30 Discrete Mathematics Fall 018 MAT30 (Discrete Math) Mathematical Induction Fall 018 1 / 19 Outline 1 Mathematical Induction Strong Mathematical Induction MAT30 (Discrete Math)
More informationUnit 8: Statistics. SOL Review & SOL Test * Test: Unit 8 Statistics
Name: Block: Unit 8: Statistics Day 1 Sequences Day 2 Series Day 3 Permutations & Combinations Day 4 Normal Distribution & Empirical Formula Day 5 Normal Distribution * Day 6 Standard Normal Distribution
More informationSome Basic Logic. Henry Liu, 25 October 2010
Some Basic Logic Henry Liu, 25 October 2010 In the solution to almost every olympiad style mathematical problem, a very important part is existence of accurate proofs. Therefore, the student should be
More informationSets are one of the basic building blocks for the types of objects considered in discrete mathematics.
Section 2.1 Introduction Sets are one of the basic building blocks for the types of objects considered in discrete mathematics. Important for counting. Programming languages have set operations. Set theory
More information1 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 informationMath 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 informationExercises. Template for Proofs by Mathematical Induction
5. Mathematical Induction 329 Template for Proofs by Mathematical Induction. Express the statement that is to be proved in the form for all n b, P (n) forafixed integer b. 2. Write out the words Basis
More information{ 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 informationDiscrete Mathematics, Spring 2004 Homework 4 Sample Solutions
Discrete Mathematics, Spring 2004 Homework 4 Sample Solutions 4.2 #77. Let s n,k denote the number of ways to seat n persons at k round tables, with at least one person at each table. (The numbers s n,k
More informationAlgorithms and Data Structures 2016 Week 5 solutions (Tues 9th - Fri 12th February)
Algorithms and Data Structures 016 Week 5 solutions (Tues 9th - Fri 1th February) 1. Draw the decision tree (under the assumption of all-distinct inputs) Quicksort for n = 3. answer: (of course you should
More informationMath Circle: Recursion and Induction
Math Circle: Recursion and Induction Prof. Wickerhauser 1 Recursion What can we compute, using only simple formulas and rules that everyone can understand? 1. Let us use N to denote the set of counting
More informationDiscrete Mathematics & Mathematical Reasoning Chapter 6: Counting
Discrete Mathematics & Mathematical Reasoning Chapter 6: Counting Kousha Etessami U. of Edinburgh, UK Kousha Etessami (U. of Edinburgh, UK) Discrete Mathematics (Chapter 6) 1 / 39 Chapter Summary The Basics
More informationAt the start of the term, we saw the following formula for computing the sum of the first n integers:
Chapter 11 Induction This chapter covers mathematical induction. 11.1 Introduction to induction At the start of the term, we saw the following formula for computing the sum of the first n integers: Claim
More informationPlaying with Numbers. introduction. numbers in general FOrM. remarks (i) The number ab does not mean a b. (ii) The number abc does not mean a b c.
5 Playing with Numbers introduction In earlier classes, you have learnt about natural numbers, whole numbers, integers and their properties. In this chapter, we shall understand 2-digit and 3-digit numbers
More informationGenerating Function Notes , Fall 2005, Prof. Peter Shor
Counting Change Generating Function Notes 80, Fall 00, Prof Peter Shor In this lecture, I m going to talk about generating functions We ve already seen an example of generating functions Recall when we
More information(x 1 +x 2 )(x 1 x 2 )+(x 2 +x 3 )(x 2 x 3 )+(x 3 +x 1 )(x 3 x 1 ).
CMPSCI611: Verifying Polynomial Identities Lecture 13 Here is a problem that has a polynomial-time randomized solution, but so far no poly-time deterministic solution. Let F be any field and let Q(x 1,...,
More informationWriting proofs for MATH 61CM, 61DM Week 1: basic logic, proof by contradiction, proof by induction
Writing proofs for MATH 61CM, 61DM Week 1: basic logic, proof by contradiction, proof by induction written by Sarah Peluse, revised by Evangelie Zachos and Lisa Sauermann September 27, 2016 1 Introduction
More informationMathematical 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 informationMath 230 Final Exam, Spring 2008
c IIT Dept. Applied Mathematics, May 15, 2008 1 PRINT Last name: Signature: First name: Student ID: Math 230 Final Exam, Spring 2008 Conditions. 2 hours. No book, notes, calculator, cell phones, etc. Part
More informationCSE 20 DISCRETE MATH SPRING
CSE 20 DISCRETE MATH SPRING 2016 http://cseweb.ucsd.edu/classes/sp16/cse20-ac/ Today's learning goals Describe computer representation of sets with bitstrings Define and compute the cardinality of finite
More informationInduction 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 informationMATH CSE20 Homework 5 Due Monday November 4
MATH CSE20 Homework 5 Due Monday November 4 Assigned reading: NT Section 1 (1) Prove the statement if true, otherwise find a counterexample. (a) For all natural numbers x and y, x + y is odd if one of
More informationCHAPTER 8 Advanced Counting Techniques
96 Chapter 8 Advanced Counting Techniques CHAPTER 8 Advanced Counting Techniques SECTION 8. Applications of Recurrence Relations 2. a) A permutation of a set with n elements consists of a choice of a first
More informationMath 3361-Modern Algebra Lecture 08 9/26/ Cardinality
Math 336-Modern Algebra Lecture 08 9/26/4. Cardinality I started talking about cardinality last time, and you did some stuff with it in the Homework, so let s continue. I said that two sets have the same
More informationWhat 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 informationMATH 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 informationMath 308 Midterm November 6, 2009
Math 308 Midterm November 6, 2009 We will write A 1,..., A n for the columns of an m n matrix A. If x R n, we will write x = (x 1,..., x n ). he null space and range of a matrix A are denoted by N (A)
More informationCMPSCI 240: Reasoning about Uncertainty
CMPSCI 240: Reasoning about Uncertainty Lecture 7: More Advanced Counting Andrew McGregor University of Massachusetts Last Compiled: February 21, 2017 Outline 1 Recap 2 Partitions 3 More Examples 4 Clicker
More informationCS 246 Review of Proof Techniques and Probability 01/14/19
Note: This document has been adapted from a similar review session for CS224W (Autumn 2018). It was originally compiled by Jessica Su, with minor edits by Jayadev Bhaskaran. 1 Proof techniques Here we
More informationUse mathematical induction in Exercises 3 17 to prove summation formulae. Be sure to identify where you use the inductive hypothesis.
Exercises Exercises 1. There are infinitely many stations on a train route. Suppose that the train stops at the first station and suppose that if the train stops at a station, then it stops at the next
More information1 Quick Sort LECTURE 7. OHSU/OGI (Winter 2009) ANALYSIS AND DESIGN OF ALGORITHMS
OHSU/OGI (Winter 2009) CS532 ANALYSIS AND DESIGN OF ALGORITHMS LECTURE 7 1 Quick Sort QuickSort 1 is a classic example of divide and conquer. The hard work is to rearrange the elements of the array A[1..n]
More informationBasic counting techniques. Periklis A. Papakonstantinou Rutgers Business School
Basic counting techniques Periklis A. Papakonstantinou Rutgers Business School i LECTURE NOTES IN Elementary counting methods Periklis A. Papakonstantinou MSIS, Rutgers Business School ALL RIGHTS RESERVED
More information4/17/2012. NE ( ) # of ways an event can happen NS ( ) # of events in the sample space
I. Vocabulary: A. Outcomes: the things that can happen in a probability experiment B. Sample Space (S): all possible outcomes C. Event (E): one outcome D. Probability of an Event (P(E)): the likelihood
More informationExecutive Assessment. Executive Assessment Math Review. Section 1.0, Arithmetic, includes the following topics:
Executive Assessment Math Review Although the following provides a review of some of the mathematical concepts of arithmetic and algebra, it is not intended to be a textbook. You should use this chapter
More informationChapter 4. Induction. 4.1 Chains of Implications
Chapter 4 Induction There is one additional method of proof, known as mathematical induction, that is especially important in discrete mathematics. Since it is rather more complicated than the proof techniques
More informationMathematics 220 Workshop Cardinality. Some harder problems on cardinality.
Some harder problems on cardinality. These are two series of problems with specific goals: the first goal is to prove that the cardinality of the set of irrational numbers is continuum, and the second
More informationCS 360, Winter Morphology of Proof: An introduction to rigorous proof techniques
CS 30, Winter 2011 Morphology of Proof: An introduction to rigorous proof techniques 1 Methodology of Proof An example Deep down, all theorems are of the form If A then B, though they may be expressed
More informationREVIEW Chapter 1 The Real Number System
REVIEW Chapter The Real Number System In class work: Complete all statements. Solve all exercises. (Section.4) A set is a collection of objects (elements). The Set of Natural Numbers N N = {,,, 4, 5, }
More informationAnother Proof By Contradiction: 2 is Irrational
Another Proof By Contradiction: 2 is Irrational Theorem: 2 is irrational. Proof: By contradiction. Suppose 2 is rational. Then 2 = a/b for some a, b N +. We can assume that a/b is in lowest terms. Therefore,
More informationInduction and recursion. Chapter 5
Induction and recursion Chapter 5 Chapter Summary Mathematical Induction Strong Induction Well-Ordering Recursive Definitions Structural Induction Recursive Algorithms Mathematical Induction Section 5.1
More informationWe are going to discuss what it means for a sequence to converge in three stages: First, we define what it means for a sequence to converge to zero
Chapter Limits of Sequences Calculus Student: lim s n = 0 means the s n are getting closer and closer to zero but never gets there. Instructor: ARGHHHHH! Exercise. Think of a better response for the instructor.
More informationQuick Sort Notes , Spring 2010
Quick Sort Notes 18.310, Spring 2010 0.1 Randomized Median Finding In a previous lecture, we discussed the problem of finding the median of a list of m elements, or more generally the element of rank m.
More informationChapter Summary. Mathematical Induction Strong Induction Well-Ordering Recursive Definitions Structural Induction Recursive Algorithms
1 Chapter Summary Mathematical Induction Strong Induction Well-Ordering Recursive Definitions Structural Induction Recursive Algorithms 2 Section 5.1 3 Section Summary Mathematical Induction Examples of
More informationThe natural numbers. The natural numbers come with an addition +, a multiplication and an order < p < q, q < p, p = q.
The natural numbers N = {0, 1,, 3, } The natural numbers come with an addition +, a multiplication and an order < p, q N, p + q N. p, q N, p q N. p, q N, exactly one of the following holds: p < q, q
More informationHOW TO WRITE PROOFS. Dr. Min Ru, University of Houston
HOW TO WRITE PROOFS Dr. Min Ru, University of Houston One of the most difficult things you will attempt in this course is to write proofs. A proof is to give a legal (logical) argument or justification
More informationASSIGNMENT 1 SOLUTIONS
MATH 271 ASSIGNMENT 1 SOLUTIONS 1. (a) Let S be the statement For all integers n, if n is even then 3n 11 is odd. Is S true? Give a proof or counterexample. (b) Write out the contrapositive of statement
More informationMATH 2200 Final LC Review
MATH 2200 Final LC Review Thomas Goller April 25, 2013 1 Final LC Format The final learning celebration will consist of 12-15 claims to be proven or disproven. It will take place on Wednesday, May 1, from
More informationComputer Science Foundation Exam
Computer Science Foundation Exam May 6, 2016 Section II A DISCRETE STRUCTURES NO books, notes, or calculators may be used, and you must work entirely on your own. SOLUTION Question Max Pts Category Passing
More informationFall 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 informationCountable and uncountable sets. Matrices.
CS 441 Discrete Mathematics for CS Lecture 11 Countable and uncountable sets. Matrices. Milos Hauskrecht milos@cs.pitt.edu 5329 Sennott Square Arithmetic series Definition: The sum of the terms of the
More informationProofs. 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 informationRecursive 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 informationCDM. Recurrences and Fibonacci
CDM Recurrences and Fibonacci Klaus Sutner Carnegie Mellon University 20-fibonacci 2017/12/15 23:16 1 Recurrence Equations Second Order The Fibonacci Monoid Recurrence Equations 3 We can define a sequence
More informationSection 3.1: Direct Proof and Counterexample 1
Section 3.1: Direct Proof and Counterexample 1 In this chapter, we introduce the notion of proof in mathematics. A mathematical proof is valid logical argument in mathematics which shows that a given conclusion
More informationSection Summary. Proof by Cases Existence Proofs
Section 1.8 1 Section Summary Proof by Cases Existence Proofs Constructive Nonconstructive Disproof by Counterexample Uniqueness Proofs Proving Universally Quantified Assertions Proof Strategies sum up
More informationCOM S 330 Lecture Notes Week of Feb 9 13
Monday, February 9. Rosen.4 Sequences Reading: Rosen.4. LLM 4.. Ducks 8., 8., Def: A sequence is a function from a (usually infinite) subset of the integers (usually N = {0,,, 3,... } or Z + = {,, 3, 4,...
More informationNotes on Inductive Sets and Induction
Notes on Inductive Sets and Induction Finite Automata Theory and Formal Languages TMV027/DIT21 Ana Bove, March 15th 2018 Contents 1 Induction over the Natural Numbers 2 1.1 Mathematical (Simple) Induction........................
More informationProblem Set 5 Solutions
Problem Set 5 Solutions Section 4.. Use mathematical induction to prove each of the following: a) For each natural number n with n, n > + n. Let P n) be the statement n > + n. The base case, P ), is true
More informationMATH 2200 Final Review
MATH 00 Final Review Thomas Goller December 7, 01 1 Exam Format The final exam will consist of 8-10 proofs It will take place on Tuesday, December 11, from 10:30 AM - 1:30 PM, in the usual room Topics
More informationIS 709/809: Computational Methods for IS Research. Math Review: Algorithm Analysis
IS 709/809: Computational Methods for IS Research Math Review: Algorithm Analysis Nirmalya Roy Department of Information Systems University of Maryland Baltimore County www.umbc.edu Topics Proof techniques
More informationDiscrete Math, Spring Solutions to Problems V
Discrete Math, Spring 202 - Solutions to Problems V Suppose we have statements P, P 2, P 3,, one for each natural number In other words, we have the collection or set of statements {P n n N} a Suppose
More informationDiscrete 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 informationProofs. 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 informationCDM. Recurrences and Fibonacci. 20-fibonacci 2017/12/15 23:16. Terminology 4. Recurrence Equations 3. Solution and Asymptotics 6.
CDM Recurrences and Fibonacci 1 Recurrence Equations Klaus Sutner Carnegie Mellon University Second Order 20-fibonacci 2017/12/15 23:16 The Fibonacci Monoid Recurrence Equations 3 Terminology 4 We can
More informationChapter 1. Sets and Numbers
Chapter 1. Sets and Numbers 1. Sets A set is considered to be a collection of objects (elements). If A is a set and x is an element of the set A, we say x is a member of A or x belongs to A, and we write
More information1 Take-home exam and final exam study guide
Math 215 - Introduction to Advanced Mathematics Fall 2013 1 Take-home exam and final exam study guide 1.1 Problems The following are some problems, some of which will appear on the final exam. 1.1.1 Number
More informationMidterm Exam Solution
Midterm Exam Solution Name PID Honor Code Pledge: I certify that I am aware of the Honor Code in effect in this course and observed the Honor Code in the completion of this exam. Signature Notes: 1. This
More informationSection Summary. Sequences. Recurrence Relations. Summations Special Integer Sequences (optional)
Section 2.4 Section Summary Sequences. o Examples: Geometric Progression, Arithmetic Progression Recurrence Relations o Example: Fibonacci Sequence Summations Special Integer Sequences (optional) Sequences
More information