Discrete Structures: Sample Questions, Exam 2, SOLUTIONS
|
|
- Esmond Everett O’Brien’
- 5 years ago
- Views:
Transcription
1 Discrete Structures: Sample Questions, Exam, SOLUTIONS This is longer than the actual test.) 1. List all the strings over X = {a, b, c} of length or less. λ, a, b, c, aa, ab, ac, ba, bb, bc, ca, cb, cc.. Consider the Fibonacci sequence defined recursively by f 1 = f = 1, f n = f n 1 + f n for n 3. Use induction to prove that f n = φn ψ n, where φ = 1 +, ψ = 1. For the basis cases, compute φ 1 ψ 1 = ) = 1 = 1 = f 1, φ = = 1 + ) = ψ = = 1 ) = φ ψ = ) = 1 = 1 = f, = 3 +, = 3, Now we prove the inductive case. The form of the Fibonacci sequence means that we should show P n 1) P n ) P n) for all n 3 where P n) is the formula we are trying to prove for all n 1.) So we assume P n 1) and P n ). For P n), compute f n = f n 1 + f n
2 = 1 φ n 1 ψ n 1 ) + 1 φ n ψ n ) by P n 1), P n ) = 1 φ n 1 + φ n ) 1 ψ n 1 + ψ n ) = 1 φ n φ + 1) 1 ψ n ψ + 1) ) = φn 1 + = φn ) = φn φ ) ψn ψ ) = φn ψ n ψn 1 ψn 3 ) + 1 ) The second to last line follows from the formulas for φ, ψ computed above.) This proves the inductive case, and thus the formula holds for all n Show that n! = On n ). Compute n! = n and n n = n n n n n. Note they have the same number of terms in the product, and that all the terms in the product for n! are positive and are all the corresponding terms in n n i.e., 1 n, n,... n n.) Thus the product n! n n, for all n 1. Thus for constant C = 1, we have n! 1 n n for all n 1, and this shows n! = On n ). 4. Short answer. No partial credit. a) A relation R on X = {1,, 3} has matrix digraph Draw its
3 1 3 b) Write the relation in part a) as a subset of X X. R = {1, 1), 1, 3),, ),, 3)}. c) Compute the matrix of the relation R R. The matrix of a composition of two relations is computed using the product of their matrices in the opposite order. In this case, the two matrices are the same, and the product is = Typically we would then have to replace all nonzero numbers by 1, but in this case, all the nonzero entries are 1, and so this is not necessary. d) Consider Y = {1,, 3, 4,, 6} and the equivalence relation on Y given by xry if and only if x y is a multiple of 3. Write down the elements of the equivalence class [1]. [1] = {1, 4}, since 1R1 and 4R1, but 1 is not related to,3,,6. e) Write down the digraph of the equivalence relation from part d) f) Write down the matrix of the equivalence relation from part d).
4 g) On the set Z + of positive integers, consider the partial order mrn if m divides n. Write down an incomparable pair of elements of Z +., 3. doesn t divide 3 and 3 doesn t divide. h) For the partial order from part g), find an element k of Z + so that nkrn). Write down k divides n for all n Z +. i) For a i = 3 i, compute a i. i=0. a i = a 0 + a 1 + a = = = 13. i=0 j) For parts j)-n), choose a theta class for the function or number of times the line x = x+1 executes in the algorithm. The possible answers are Θ1), Θlg n), Θn), Θn lg n), Θn ), Θ n ), Θn!). What is the theta class of fn) = n ) 1 + lg n)? n fn) = Θn lg n), since fn) = 1 + n lg n n lg n, and the highest order term is n lg n. k) gn) = n gn) = Θn ), since 1++ +n = 1 n +n) = Θn ). l) j = n while j 1){ for i = 1 to n x = x + 1 j = j/ } Θn lg n). The inner loop always takes n steps note it does not depend on the outer loop index j). As we saw in class, the outer loop takes Θlg n). So all together, it takes Θn lg n) steps.
5 m) j = n while j 1){ for i = 1 to j x = x + 1 j = j/ } Θn), as we saw in class, and in Example in the book. n) for j = 1 to n for i = j to n x = x + 1 Θn ). The inner loop goes n j + 1 times which depends on j). So adding up this for all j from 1 to n, we have n + n 1) + n ) = 1 n + n) = Θn ). o) On X = {1,, 3, 4}, let the relation R be given by xry if x > y, and let the relation S be given by xsy if x divides y. List the elements, as ordered pairs, of the relation R S. R = {, 1), 3, 1), 3, ), 4, 1), 4, ), 4, 3)}, while S = {1, 1), 1, ), 1, 3), 1, 4),, ),, 4), 3, 3), 4, 4)}. So R S = and there are no elements in R S. p) List the elements of R S as ordered pairs, where R, S are from part o). R S = {1, 1), 1, ), 1, 3), 1, 4),, 1),, ),, 4), 3, 1), 3, ), 3, 3), 4, 1), 4, ), 4, 3), 4, 4)}.. Refer to tables in the book for this problem. Write a sequence of operations select, project, join) to answer the query. Also, provide the answer to the query. Find all buyers who bought a part from Yu s department. TEMP1 = DEPARTMENT [Dept=Dept] SUPPLIER TEMP = TEMP1 [Part No = Part No] BUYER TEMP3 = TEMP [Manager = Yu] selection) ANSWER = TEMP3 [Name] projection) join) join)
6 The answer is Name United Supplies ABC Unlimited Danny s 6. Write an algorithm which returns the index of the last occurrence of the smallest element in the sequence s 1,..., s n. So if the sequence is , the output would be 4. last occurrences, n){ smallest = s 1 last = 1 for i = to n if s i smallest){ smallest = s i last = i } return last }
7 7. True/False. Circle T or F. No explanation needed. a) T F There is a relation on the set {α, β, γ} which is both an equivalence relation and a partial order. T. The equality relation given by arb if a = b is both an equivalence relation and a partial order. To show this, check it s reflexive, symmetric, and transitive these are just the standard 3 properties of equality). To show it s also a partial order, we need to show it s also antisymmetric. In other words, we need to show a ba = b b = a) a = b). This is obviously true. b) T F On Z +, consider the relation R defined by mrn if there is an integer k so that m = k n. Then R is an equivalence relation. T. It s reflexive, since m = 0 m and so mrm for all m. It s symmetric since if mrn, then m = k n and so n = k m, which means that nrm. It s transitive since if mrn and nrp, then m = k n and n = l p, which implies m = k l p) = k+l p and so mrp. c) T F R from part b) is a partial order. F. R is not antisymmetric, since for example 1R and R1, but 1. d) T F The relation from problem 4a) is reflexive. F. 3 R3. e) T F The relation from problem 4a) is symmetric. F. For example, 1R3 but 3 R1. f) T F The relation from problem 4a) is antisymmetric. T. There is no pair of 1 s across the diagonal. g) T F The relation from problem 4a) is transitive. T. Compute the square of the matrix to be again. Since all of the 1 s in the square are also 1 s in the original matrix, the relation is transitive. h) T F n 3 + lg n = Θn 3 ). T. This is true since lg n is lower order of growth than n 3.
8 i) T F n n = Θn 3 ). F. 3 n exponential growth) has much higher order of growth than n 3, and so n n = Θ3 n ). j) T F If R is a relation ) from {1, } to {a, b, c} with matrix, and S is a relation from {a, b, c} to {1, } with matrix , then the relation R S has ma- ) 0 1 trix. 1 1 F. The matrix of R S is determined by the matrix product in the opposite order. So compute 0 0 ) 1 1 = is the matrix of R S. k) T F n = Θn 4 ). F. It is Θn 3 ). l) T F n = Θ n ). T. This geometric series has sum 1 n+1 1 = n+1 1 = n 1 has highest order term n, which is = Θ n ). m) T F Let X, Y be finite sets, and let R be a relation from X to Y. Then R = R 1. Here recall R is the cardinality of R as a subset of X Y.) T. If R 1 is defined by {y, x) : x, y) R}, and so clearly x, y) y, x) is an one-to-one correspondence from R to R 1. Therefore, the cardinalities must be the same. n) T F! = 70. F.! = = 10. o) T F For the Fibonacci sequence f n as in problem above, f =. T. f 1 = f = 1, f 3 = f + f 1 =, f 4 = f 3 + f = 3, f = f 4 + f 3 =.
Discrete Structures: Sample Questions, Exam 2, SOLUTIONS
Discrete Structures: Sample Questions, Exam 2, SOLUTIONS (This is longer than the actual test.) 1. Show that any postage of 8 cents or more can be achieved by using only -cent and 5-cent stamps. We proceed
More informationDiscrete Structures May 13, (40 points) Define each of the following terms:
Discrete Structures May 13, 2014 Prof Feighn Final Exam 1. (40 points) Define each of the following terms: (a) (binary) relation: A binary relation from a set X to a set Y is a subset of X Y. (b) function:
More informationDefinition: A binary relation R from a set A to a set B is a subset R A B. Example:
Chapter 9 1 Binary Relations Definition: A binary relation R from a set A to a set B is a subset R A B. Example: Let A = {0,1,2} and B = {a,b} {(0, a), (0, b), (1,a), (2, b)} is a relation from A to B.
More informationCHAPTER 1. Relations. 1. Relations and Their Properties. Discussion
CHAPTER 1 Relations 1. Relations and Their Properties 1.1. Definition of a Relation. Definition 1.1.1. A binary relation from a set A to a set B is a subset R A B. If (a, b) R we say a is Related to b
More informationCOMP 182 Algorithmic Thinking. Relations. Luay Nakhleh Computer Science Rice University
COMP 182 Algorithmic Thinking Relations Luay Nakhleh Computer Science Rice University Chapter 9, Section 1-6 Reading Material When we defined the Sorting Problem, we stated that to sort the list, the elements
More informationSection Summary. Relations and Functions Properties of Relations. Combining Relations
Chapter 9 Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations Closures of Relations (not currently included
More informationExam 2. Is g one-to-one? Is g onto? Why? Solution: g is not one-to-one, since for c A, g(b) = g(c) = c. g is not onto, since a / g(a).
Discrete Structures: Exam 2 Solutions to Sample Questions, 1. Let A = B = {a, b, c}. Consider the relation g = {(a, b), (b, c), (c, c)}. Is g one-to-one? Is g onto? Why? Solution: g is not one-to-one,
More informationDiscrete Structures: Solutions to Sample Questions, Exam 2
Discrete Structures: Solutions to Sample Questions, Exam 2 1. Let A = B = {a, b, c}. Consider the relation g = {(a, b), (b, c), (c, c)}. Is g one-to-one? Is g onto? Why? Solution: g is not one-to-one,
More informationWhat are relations? f: A B
What are relations? Ch 9.1 What are relations? Notation Informally, a relation is a set of pairs of objects (or in general, set of n-tuples) that are related to each other by some rule. We will focus first
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 informationDiscrete Structures, Final Exam
Discrete Structures, Final Exam Monday, May 11, 2009 SOLUTIONS 1. (40 pts) Short answer. Put your answer in the box. No partial credit. [ ] 0 1 (a) If A = and B = 1 0 [ ] 0 0 1. 0 1 1 [ 0 1 1 0 0 1 ],
More informationDepartment of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination I (Spring 2008)
Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination I (Spring 2008) Problem 1: Suppose A, B, C and D are arbitrary sets.
More informationCSC Discrete Math I, Spring Relations
CSC 125 - Discrete Math I, Spring 2017 Relations Binary Relations Definition: A binary relation R from a set A to a set B is a subset of A B Note that a relation is more general than a function Example:
More informationIs g one-to-one? Is g onto? Why? Solution: g is not one-to-one, since for c A, g(b) = g(c) = c. g is not onto, since a / g(a).
Discrete Structures: Exam 2 Solutions to Sample Questions, 1. Let A = B = {a, b, c}. Consider the relation g = {(a, b), (b, c), (c, c)}. Is g one-to-one? Is g onto? Why? Solution: g is not one-to-one,
More informationAnalysis of Algorithms
Analysis of Algorithms Section 4.3 Prof. Nathan Wodarz Math 209 - Fall 2008 Contents 1 Analysis of Algorithms 2 1.1 Analysis of Algorithms....................... 2 2 Complexity Analysis 4 2.1 Notation
More informationCIS 375 Intro to Discrete Mathematics Exam 3 (Section M004: Blue) 6 December Points Possible
Name: CIS 375 Intro to Discrete Mathematics Exam 3 (Section M004: Blue) 6 December 2016 Question Points Possible Points Received 1 12 2 14 3 14 4 12 5 16 6 16 7 16 Total 100 Instructions: 1. This exam
More informationRelations. Relations of Sets N-ary Relations Relational Databases Binary Relation Properties Equivalence Relations. Reading (Epp s textbook)
Relations Relations of Sets N-ary Relations Relational Databases Binary Relation Properties Equivalence Relations Reading (Epp s textbook) 8.-8.3. Cartesian Products The symbol (a, b) denotes the ordered
More informationLecture 4: Products of Matrices
Lecture 4: Products of Matrices Winfried Just, Ohio University January 22 24, 2018 Matrix multiplication has a few surprises up its sleeve Let A = [a ij ] m n, B = [b ij ] m n be two matrices. The sum
More informationMATH 532, 736I: MODERN GEOMETRY
MATH 532, 736I: MODERN GEOMETRY Test 2, Spring 2013 Show All Work Name Instructions: This test consists of 5 pages (one is an information page). Put your name at the top of this page and at the top of
More informationCIS 375 Intro to Discrete Mathematics Exam 3 (Section M001: Green) 6 December Points Possible
Name: CIS 375 Intro to Discrete Mathematics Exam 3 (Section M001: Green) 6 December 2016 Question Points Possible Points Received 1 12 2 14 3 14 4 12 5 16 6 16 7 16 Total 100 Instructions: 1. This exam
More informationChapter 9: Relations Relations
Chapter 9: Relations 9.1 - Relations Definition 1 (Relation). Let A and B be sets. A binary relation from A to B is a subset R A B, i.e., R is a set of ordered pairs where the first element from each pair
More informationData structures Exercise 1 solution. Question 1. Let s start by writing all the functions in big O notation:
Data structures Exercise 1 solution Question 1 Let s start by writing all the functions in big O notation: f 1 (n) = 2017 = O(1), f 2 (n) = 2 log 2 n = O(n 2 ), f 3 (n) = 2 n = O(2 n ), f 4 (n) = 1 = O
More informationJust the Factors, Ma am HAROLD B. REITER.
Just the Factors, Ma am HAROLD B REITER UNIVERSITY OF NORTH CAROLINA CHARLOTTE http://wwwmathunccedu/~hbreiter The purpose of this note is to find and study a method for determining and counting all the
More informationRelations, Functions, Binary Relations (Chapter 1, Sections 1.2, 1.3)
Relations, Functions, Binary Relations (Chapter 1, Sections 1.2, 1.3) CmSc 365 Theory of Computation 1. Relations Definition: Let A and B be two sets. A relation R from A to B is any set of ordered pairs
More information2 hours THE UNIVERSITY OF MANCHESTER. 6 June :45 11:45
2 hours THE UNIVERSITY OF MANCHESTER DISCRETE MATHEMATICS 6 June 2016 9:45 11:45 Answer ALL THREE questions in Section A (30 marks in total) and TWO of the THREE questions in Section B (50 marks in total).
More informationA Universal Turing Machine
A Universal Turing Machine A limitation of Turing Machines: Turing Machines are hardwired they execute only one program Real Computers are re-programmable Solution: Universal Turing Machine Attributes:
More informationName: MATH 3195 :: Fall 2011 :: Exam 2. No document, no calculator, 1h00. Explanations and justifications are expected for full credit.
Name: MATH 3195 :: Fall 2011 :: Exam 2 No document, no calculator, 1h00. Explanations and justifications are expected for full credit. 1. ( 4 pts) Say which matrix is in row echelon form and which is not.
More informationLecture 3: Matrix and Matrix Operations
Lecture 3: Matrix and Matrix Operations Representation, row vector, column vector, element of a matrix. Examples of matrix representations Tables and spreadsheets Scalar-Matrix operation: Scaling a matrix
More informationCSE 311: Foundations of Computing I Autumn 2014 Practice Final: Section X. Closed book, closed notes, no cell phones, no calculators.
CSE 311: Foundations of Computing I Autumn 014 Practice Final: Section X YY ZZ Name: UW ID: Instructions: Closed book, closed notes, no cell phones, no calculators. You have 110 minutes to complete the
More informationWhy do we need math in a data structures course?
Math Review 1 Why do we need math in a data structures course? To nalyze data structures and algorithms Deriving formulae for time and memory requirements Will the solution scale? Quantify the results
More informationMAD 3105 PRACTICE TEST 2 SOLUTIONS
MAD 3105 PRACTICE TEST 2 SOLUTIONS 1. Let R be the relation defined below. Determine which properties, reflexive, irreflexive, symmetric, antisymmetric, transitive, the relation satisfies. Prove each answer.
More informationSolutions to Assignment 3
Solutions to Assignment 3 Question 1. [Exercises 3.1 # 2] Let R = {0 e b c} with addition multiplication defined by the following tables. Assume associativity distributivity show that R is a ring with
More informationDivisor Problems HAROLD B. REITER.
Divisor Problems HAROLD B REITER UNIVERSITY OF NORTH CAROLINA CHARLOTTE http://wwwmathunccedu/~hbreiter The purpose of this note is to find and study a method for determining and counting all the positive
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 informationMultiple Choice Questions for Review
Equivalence and Order Multiple Choice Questions for Review In each case there is one correct answer (given at the end of the problem set). Try to work the problem first without looking at the answer. Understand
More informationThe number of ways to choose r elements (without replacement) from an n-element set is. = r r!(n r)!.
The first exam will be on Friday, September 23, 2011. The syllabus will be sections 0.1 through 0.4 and 0.6 in Nagpaul and Jain, and the corresponding parts of the number theory handout found on the class
More informationSpring, 2012 CIS 515. Fundamentals of Linear Algebra and Optimization Jean Gallier
Spring 0 CIS 55 Fundamentals of Linear Algebra and Optimization Jean Gallier Homework 5 & 6 + Project 3 & 4 Note: Problems B and B6 are for extra credit April 7 0; Due May 7 0 Problem B (0 pts) Let A be
More informationRecurrence Relations
Recurrence Relations Recurrence Relations Reading (Epp s textbook) 5.6 5.8 1 Recurrence Relations A recurrence relation for a sequence aa 0, aa 1, aa 2, ({a n }) is a formula that relates each term a k
More informationLinear algebra and differential equations (Math 54): Lecture 13
Linear algebra and differential equations (Math 54): Lecture 13 Vivek Shende March 3, 016 Hello and welcome to class! Last time We discussed change of basis. This time We will introduce the notions of
More informationSection 7.1 Relations and Their Properties. Definition: A binary relation R from a set A to a set B is a subset R A B.
Section 7.1 Relations and Their Properties Definition: A binary relation R from a set A to a set B is a subset R A B. Note: there are no constraints on relations as there are on functions. We have a common
More informationCS 4407 Algorithms Lecture 2: Iterative and Divide and Conquer Algorithms
CS 4407 Algorithms Lecture 2: Iterative and Divide and Conquer Algorithms Prof. Gregory Provan Department of Computer Science University College Cork 1 Lecture Outline CS 4407, Algorithms Growth Functions
More informationBASIC MATHEMATICAL TECHNIQUES
CHAPTER 1 ASIC MATHEMATICAL TECHNIQUES 1.1 Introduction To understand automata theory, one must have a strong foundation about discrete mathematics. Discrete mathematics is a branch of mathematics dealing
More informationWeek 4-5: Binary Relations
1 Binary Relations Week 4-5: Binary Relations The concept of relation is common in daily life and seems intuitively clear. For instance, let X be the set of all living human females and Y the set of all
More informationQuiz 1 Solutions. Problem 2. Asymptotics & Recurrences [20 points] (3 parts)
Introduction to Algorithms October 13, 2010 Massachusetts Institute of Technology 6.006 Fall 2010 Professors Konstantinos Daskalakis and Patrick Jaillet Quiz 1 Solutions Quiz 1 Solutions Problem 1. We
More informationPacket #5: Binary Relations. Applied Discrete Mathematics
Packet #5: Binary Relations Applied Discrete Mathematics Table of Contents Binary Relations Summary Page 1 Binary Relations Examples Page 2 Properties of Relations Page 3 Examples Pages 4-5 Representations
More informationCompare 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 informationA FIRST COURSE IN LINEAR ALGEBRA. An Open Text by Ken Kuttler. Matrix Arithmetic
A FIRST COURSE IN LINEAR ALGEBRA An Open Text by Ken Kuttler Matrix Arithmetic Lecture Notes by Karen Seyffarth Adapted by LYRYX SERVICE COURSE SOLUTION Attribution-NonCommercial-ShareAlike (CC BY-NC-SA)
More informationExam in Discrete Mathematics
Exam in Discrete Mathematics First Year at the Faculty of Engineering and Science and the Technical Faculty of IT and Design June 4th, 018, 9.00-1.00 This exam consists of 11 numbered pages with 14 problems.
More informationMath 230 Final Exam, Spring 2009
IIT Dept. Applied Mathematics, May 13, 2009 1 PRINT Last name: Signature: First name: Student ID: Math 230 Final Exam, Spring 2009 Conditions. 2 hours. No book, notes, calculator, cell phones, etc. Part
More informationMathematical Induction
Mathematical Induction MAT231 Transition to Higher Mathematics Fall 2014 MAT231 (Transition to Higher Math) Mathematical Induction Fall 2014 1 / 21 Outline 1 Mathematical Induction 2 Strong Mathematical
More informationDiscrete Mathematics. 2. Relations
Discrete Mathematics 2. Relations Binary Relations Let A, B be any two sets. A binary relation R from A to B is a subset of A B. E.g., Let < : N N : {(n,m) n < m} The notation a R b or arb means (a,b)îr.
More informationAnswers in blue. If you have questions or spot an error, let me know. 1. Find all matrices that commute with A =. 4 3
Answers in blue. If you have questions or spot an error, let me know. 3 4. Find all matrices that commute with A =. 4 3 a b If we set B = and set AB = BA, we see that 3a + 4b = 3a 4c, 4a + 3b = 3b 4d,
More informationwe have the following equation:
1 VMTS Homework #1 due Thursday, July 6 Exercise 1 In triangle ABC, let P be 2 3 of the way from A to B, let Q be 1 3 of the way from P to C, and let the line BQ intersect AC in R How far is R along the
More informationMatrices. Chapter Definitions and Notations
Chapter 3 Matrices 3. Definitions and Notations Matrices are yet another mathematical object. Learning about matrices means learning what they are, how they are represented, the types of operations which
More informationx + 2y + 3z = 8 x + 3y = 7 x + 2z = 3
Chapter 2: Solving Linear Equations 23 Elimination Using Matrices As we saw in the presentation, we can use elimination to make a system of linear equations into an upper triangular system that is easy
More informationA matrix over a field F is a rectangular array of elements from F. The symbol
Chapter MATRICES Matrix arithmetic A matrix over a field F is a rectangular array of elements from F The symbol M m n (F ) denotes the collection of all m n matrices over F Matrices will usually be denoted
More informationProblem # Max points possible Actual score Total 120
FINAL EXAMINATION - MATH 2121, FALL 2017. Name: ID#: Email: Lecture & Tutorial: Problem # Max points possible Actual score 1 15 2 15 3 10 4 15 5 15 6 15 7 10 8 10 9 15 Total 120 You have 180 minutes to
More informationUNIVERSITY OF MICHIGAN UNDERGRADUATE MATH COMPETITION 28 APRIL 7, 2011
UNIVERSITY OF MICHIGAN UNDERGRADUATE MATH COMPETITION 28 APRIL 7, 20 Instructions. Write on the front of your blue book your student ID number. Do not write your name anywhere on your blue book. Each question
More informationMergesort and Recurrences (CLRS 2.3, 4.4)
Mergesort and Recurrences (CLRS 2.3, 4.4) We saw a couple of O(n 2 ) algorithms for sorting. Today we ll see a different approach that runs in O(n lg n) and uses one of the most powerful techniques for
More informationMath 320, spring 2011 before the first midterm
Math 320, spring 2011 before the first midterm Typical Exam Problems 1 Consider the linear system of equations 2x 1 + 3x 2 2x 3 + x 4 = y 1 x 1 + 3x 2 2x 3 + 2x 4 = y 2 x 1 + 2x 3 x 4 = y 3 where x 1,,
More informationDepartment of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination II (Fall 2007)
Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination II (Fall 2007) Problem 1: Specify two different predicates P (x) and
More informationRelations Graphical View
Introduction Relations Computer Science & Engineering 235: Discrete Mathematics Christopher M. Bourke cbourke@cse.unl.edu Recall that a relation between elements of two sets is a subset of their Cartesian
More informationFundamentals 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 informationCh 01. Analysis of Algorithms
Ch 01. Analysis of Algorithms Input Algorithm Output Acknowledgement: Parts of slides in this presentation come from the materials accompanying the textbook Algorithm Design and Applications, by M. T.
More informationRelationships between elements of sets occur in many contexts. Every day we deal with
C H A P T E R 9 Relations 9.1 Relations and Their Properties 9.2 n-ary Relations and Their Applications 9.3 Representing Relations 9.4 Closures of Relations 9.5 Equivalence Relations 9.6 Partial Orderings
More informationDiscrete Mathematics Fall 2018 Midterm Exam Prof. Callahan. Section: NetID: Multiple Choice Question (30 questions in total, 4 points each)
Discrete Mathematics Fall 2018 Midterm Exam Prof. Callahan Section: NetID: Name: Multiple Choice Question (30 questions in total, 4 points each) 1 Consider the following propositions: f: The student got
More informationMath.3336: Discrete Mathematics. Chapter 9 Relations
Math.3336: Discrete Mathematics Chapter 9 Relations Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu Fall 2018
More informationFall Inverse of a matrix. Institute: UC San Diego. Authors: Alexander Knop
Fall 2017 Inverse of a matrix Authors: Alexander Knop Institute: UC San Diego Row-Column Rule If the product AB is defined, then the entry in row i and column j of AB is the sum of the products of corresponding
More informationCh01. Analysis of Algorithms
Ch01. Analysis of Algorithms Input Algorithm Output Acknowledgement: Parts of slides in this presentation come from the materials accompanying the textbook Algorithm Design and Applications, by M. T. Goodrich
More informationBinary Relation Review Questions
CSE 191 Discrete Structures Fall 2016 Recursive sets Binary Relation Review Questions 1. For each of the relations below, answer the following three questions: Is the relation reflexive? Is the relation
More informationWritten Homework #1: Analysis of Algorithms
Written Homework #1: Analysis of Algorithms CIS 121 Fall 2016 cis121-16fa-staff@googlegroups.com Due: Thursday, September 15th, 2015 before 10:30am (You must submit your homework online via Canvas. A paper
More informationNOTE: You have 2 hours, please plan your time. Problems are not ordered by difficulty.
EXAM 2 solutions (COT3100, Sitharam, Spring 2017) NAME:last first: UF-ID Section NOTE: You have 2 hours, please plan your time. Problems are not ordered by difficulty. (1) Are the following functions one-to-one
More informationNotes. Relations. Introduction. Notes. Relations. Notes. Definition. Example. Slides by Christopher M. Bourke Instructor: Berthe Y.
Relations Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Spring 2006 Computer Science & Engineering 235 Introduction to Discrete Mathematics Sections 7.1, 7.3 7.5 of Rosen cse235@cse.unl.edu
More information5 Group theory. 5.1 Binary operations
5 Group theory This section is an introduction to abstract algebra. This is a very useful and important subject for those of you who will continue to study pure mathematics. 5.1 Binary operations 5.1.1
More informationMidterm Exam. CS 3110: Design and Analysis of Algorithms. June 20, Group 1 Group 2 Group 3
Banner ID: Name: Midterm Exam CS 3110: Design and Analysis of Algorithms June 20, 2006 Group 1 Group 2 Group 3 Question 1.1 Question 2.1 Question 3.1 Question 1.2 Question 2.2 Question 3.2 Question 3.3
More informationRelations --- Binary Relations. Debdeep Mukhopadhyay IIT Madras
Relations --- Binary Relations Debdeep Mukhopadhyay IIT Madras What is a relation? The mathematical concept of relation is based on the common notion of relationships among objects: One box is heavier
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 informationWeek 4-5: Binary Relations
1 Binary Relations Week 4-5: Binary Relations The concept of relation is common in daily life and seems intuitively clear. For instance, let X be the set of all living human females and Y the set of all
More informationDISCRETE STRUCTURES AMIN WITNO
DISCRETE STRUCTURES AMIN WITNO p h i. w i t n o. c o m Discrete Structures Revision Notes and Problems Amin Witno Preface These notes were prepared for students as a revision workbook
More informationExam in Discrete Mathematics
Exam in Discrete Mathematics First Year at The TEK-NAT Faculty June 10th, 2016, 9.00-13.00 This exam consists of 11 numbered pages with 16 problems. All the problems are multiple choice problems. The answers
More informationNAME (1 pt): SID (1 pt): TA (1 pt): Name of Neighbor to your left (1 pt): Name of Neighbor to your right (1 pt):
CS 170 First Midterm 26 Feb 2010 NAME (1 pt): SID (1 pt): TA (1 pt): Name of Neighbor to your left (1 pt): Name of Neighbor to your right (1 pt): Instructions: This is a closed book, closed calculator,
More informationExample. How to Guess What to Prove
How to Guess What to Prove Example Sometimes formulating P (n) is straightforward; sometimes it s not. This is what to do: Compute the result in some specific cases Conjecture a generalization based on
More informationSection 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 informationAppendix A: Matrices
Appendix A: Matrices A matrix is a rectangular array of numbers Such arrays have rows and columns The numbers of rows and columns are referred to as the dimensions of a matrix A matrix with, say, 5 rows
More informationGroups. s t or s t or even st rather than f(s,t).
Groups Definition. A binary operation on a set S is a function which takes a pair of elements s,t S and produces another element f(s,t) S. That is, a binary operation is a function f : S S S. Binary operations
More informationMATRICES. a m,1 a m,n A =
MATRICES Matrices are rectangular arrays of real or complex numbers With them, we define arithmetic operations that are generalizations of those for real and complex numbers The general form a matrix of
More informationReading 10 : Asymptotic Analysis
CS/Math 240: Introduction to Discrete Mathematics Fall 201 Instructor: Beck Hasti and Gautam Prakriya Reading 10 : Asymptotic Analysis In the last reading, we analyzed the running times of various algorithms.
More informationChapter 20. Countability The rationals and the reals. This chapter covers infinite sets and countability.
Chapter 20 Countability This chapter covers infinite sets and countability. 20.1 The rationals and the reals You re familiar with three basic sets of numbers: the integers, the rationals, and the reals.
More information3. R = = on Z. R, S, A, T.
6 Relations Let R be a relation on a set A, i.e., a subset of AxA. Notation: xry iff (x, y) R AxA. Recall: A relation need not be a function. Example: The relation R 1 = {(x, y) RxR x 2 + y 2 = 1} is not
More informationAlgorithm efficiency analysis
Algorithm efficiency analysis Mădălina Răschip, Cristian Gaţu Faculty of Computer Science Alexandru Ioan Cuza University of Iaşi, Romania DS 2017/2018 Content Algorithm efficiency analysis Recursive function
More informationVariable Elimination (VE) Barak Sternberg
Variable Elimination (VE) Barak Sternberg Basic Ideas in VE Example 1: Let G be a Chain Bayesian Graph: X 1 X 2 X n 1 X n How would one compute P X n = k? Using the CPDs: P X 2 = x = x Val X1 P X 1 = x
More informationSequences are ordered lists of elements
Sequences are ordered lists of elements Definition: A sequence is a function from the set of integers, either set {0,1,2,3, } or set {1,2,3,4,..}, to a set S. We use the notation a n to denote the image
More informationRela%ons and Their Proper%es. Slides by A. Bloomfield
Rela%ons and Their Proper%es Slides by A. Bloomfield What is a rela%on Let A and B be sets. A binary rela%on R is a subset of A B Example Let A be the students in a the CS major A = {Alice, Bob, Claire,
More informationCS 4104 Data and Algorithm Analysis. Recurrence Relations. Modeling Recursive Function Cost. Solving Recurrences. Clifford A. Shaffer.
Department of Computer Science Virginia Tech Blacksburg, Virginia Copyright c 2010,2017 by Clifford A. Shaffer Data and Algorithm Analysis Title page Data and Algorithm Analysis Clifford A. Shaffer Spring
More informationRelations MATH Relations. Benjamin V.C. Collins, James A. Swenson MATH 2730
MATH 2730 Benjamin V.C. Collins James A. Swenson among integers equals a = b is true for some pairs (a, b) Z Z, but not for all pairs. is less than a < b is true for some pairs (a, b) Z Z, but not for
More informationChapter 1: Systems of linear equations and matrices. Section 1.1: Introduction to systems of linear equations
Chapter 1: Systems of linear equations and matrices Section 1.1: Introduction to systems of linear equations Definition: A linear equation in n variables can be expressed in the form a 1 x 1 + a 2 x 2
More informationMath 2534 Solution to Test 3A Spring 2010
Math 2534 Solution to Test 3A Spring 2010 Problem 1: (10pts) Prove that R is a transitive relation on Z when given that mrpiff m pmod d (ie. d ( m p) ) Solution: The relation R is transitive, if arb 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 informationChapter 2. Recurrence Relations. Divide and Conquer. Divide and Conquer Strategy. Another Example: Merge Sort. Merge Sort Example. Merge Sort Example
Recurrence Relations Chapter 2 Divide and Conquer Equation or an inequality that describes a function by its values on smaller inputs. Recurrence relations arise when we analyze the running time of iterative
More informationMATH 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