C241 Homework Assignment 8

Size: px
Start display at page:

Download "C241 Homework Assignment 8"

Transcription

1 C241 Homework Assignment 8 1. Estimate the performance of the Bubble Sort program for i from 1 to N 1 by 1 do for j from 1 to i 1 by 1 do if A[j ] A[j + 1] then skip; else t := A[j ] ; A[j ] := A[j + 1] ; A[j + 1] := t 1. The conditional statement if A[j ] A[j + 1] then.... Performs two operations in its test and (a) no operations (or one if you like) to perform the skip statement in the then branch, or (b) three assignments and two additions on the else branch. So we must conservatively estimate that the conditional performs seven operations. 2. The inner loop initializes j, then runs the loop test j = i 1, the increment j :=j+1, and the conditional i 1 times. Putting these together, the inner loop runs i [7 + 2] = 1 + 9(i 1) operations. j=1 3. Similarly, the outer loop initializes i, then runs the test i = N 1, the increment i:=i + 1, and the inner loop N 1 times. So it performs operations. N [ (i 1)]

2 Simplifying, N [ (i 1)] = 1 + N 1 [3 + 9i 9] (arithmetic) N 1 = 1 + [9i 6] (arithmetic) = = = [ N 1 ] i [ N 1 [ N 1 6 ] ] i 6(N 1) = 9 N 2 N 2 (N 1)N 2 6N + 7) = 18N 2 30N (N 1) (splitting Σ) ( u l C = C(u l + 1)) ( m i = m(m+1) 2 ) (simplifying, combining like terms) (adding fractions) = 9N 2 15N + 7 (reducing to lowest terms)

3 2. Define two functions, f and g, for which f O(g) and g O(f). We need only define two function which never dominate each other. For example, define { { 0 if n is even n if n is odd f(n) = g(n) = n if n is odd 0 if n is even There are no N and C such that, for all n N, g(n) C f(n) or f(n) C g(n).

4 3. Prove: If f 1 O(g 1 ) and f 2 O(g 2 ) then f 1 (n) f 2 (n) O ( g 1 (n) g 2 (n) ) Proof. Since f 1 (n) O(g 1 (n)) and f 2 (n) O(g 2 (n)), by Definition 6.1Order Notation and Order Arithmeticdefinition.6.1, (a) there exist N 1 and C 1 such that for all n N 1, f(n) C 1 g 1 (n). (b) there exist N 2 and C 2 such that for all m N 2, f(m) C 2 g 2 (m). Let N be the larger of N 1 and N 2, and let C be the larger of C 1 and C 2. Now for any n N, 1. f 1 (n) C g 1 (n) by (a) and because n N N 1 and C C f 2 (n) C g 2 (n) by (b) and because n N N 2 and C C 2. Since these numbers are all positive, we can muliply the inequalities to get f 1 (n) f 2 (n) (C g 1 (n)) (C g 2 (n)) = C 2 (g 1 (n) g 2 (n)) By Definition 6.1Order Notation and Order Arithmeticdefinition.6.1, f 1 (n) f 2 (n) O(g 1 (n) g 2 (n)) with witnesses N and C 2.

5 4. Is 2 n O(n!) or is n! O(2 n )? Let s try a few values. The table below was generated by a Scheme program. n n! 2 n Evidently 2 n O(n!) with witnesses N = 4 and C = 1. We can prove this by induction: Proposition. For all n 4, n! 2 n. proof The proof is by induction with H[k] k 4 k! 2 k. base case. The base case, for k = 4 is shown in the table above. induction step. Assume k! 2 k. Then (k + 1)! = (k + 1) k! (expanding (k + 1)!) 2 k (k + 1) (I.H.) 2 k 2 (2 < 4 k) = 2 k+1 This completes the induction step.

6 5. Prove: If f(n) O(h(n)) and g(n) O(h(n)) then f(n) + g(n) O(h(n)). If f(n) O(h(n)) then there exist witnesses N f and C f such that For all n N f, f(n) C f h(n) And if g(n) O(h(n)) then there exist witnesses N g and C g such that For all n N g, g(n) C g h(n) Let N = max(n f, N g ) and C = max(c f, C g ). Then if n N, f(n) + g(n) C f h(n) + g(n) (f O(g) with witnesses N f, C f ) C f h(n) + C g h(n) (g O(g) with witnesses N g, C g ) C h(n) + C h(n) (C = max(c f, C g )) = 2C h(n) Thus f + g O(h) with witnesses N and 2C.

7 6. Consider the program to the right, which computes over values in N. Define the outer loop s invariant assertion I 1 to be: I 1 z x y = A B and the inner loop s invariant assertion I 2 to be: I 2 z x y = A B y 0 Since z is initialized to 1, I 1 is true when the program first reaches the outer loop; and since I 2 I 1 y 0, I 2 holds whenever the inner loop is reached. Assuming that I 1 and I 2 are loop invariants, by the Theorem on Loop Invariants we will have I 1 y = 0 when the program terminates and hence {x = A y = B} z := 1; while y 0 do {I 1 } while even?(y) do {I 2 } y := y/2 x := x x ; z := z x; y := y 1 {z = A B } z x y = z x 0 = z 1 = A B as desired. So it remains to be proved that I 1 and I 2 are invariants for their respective loops. Prove this. Hint. Start with the inner loop. Proposition 1. I 2 is an invariant for the inner loop, that is, if the body of the inner loop is executed with I 2 even?(y) then I 2 will again be true afterward. Proof Suppose that z x y = A B, and y 0 is an even number. The body of the inner loop computes new values x and y for the variables: x = x x y = y 2 z = z Since y 0 and y is even, y = 2k for some k and y 2 to show that z x y = A B and y 0. Thus, = k is still in N. We want z x y = z (x 2 ) 2k 2 (equations above) = z (x 2 ) k (algebraic simplifaction) = z x 2k (multiplying exponents) = z x y (since y = 2k for some k = A B (I 2 is assumed) as desired.

8 Proposition 2. I 1 is an invariant for the outer loop, that is, if the body of the loop is executed with I 1 y 0, then I 1 will again be true afterward. Proof Suppose that z x y = A B and y 0. Then the inner loop exectutes and, by the Theorem on Loop Invariants, at the point where the inner loop terminates. 1. y is an odd number (even?(y) is false), hence it also remains the case the y I 2 is true, that is x y = A B and y 0 The remainder of the outer loop body computes values z = z x y = y 1 (since y 0, y N) x = x (x s value has not changed) We need to show that I 1 is true, that is, z x y = A B : z ( x ) (y ) = z x ( y ) (x = x) = z x (y 1) (y = y 1) = (z x) (x) (y 1) (z = z x) = z [x (x) (y 1)] (associativity) = z x y (x x y 1 = x y ) = A B (assumption) as needed.

9 Supplemental Problem. (Hotel Paradox) [This problem appears in many forms in many places.] Three grad students go to a conference and decide to save money by sharing a hotel room. On checking in, the desk clerk says the charge for a room containing two beds and a cot is $30. After the students have paid, the desk clerk realizes that the charge should have been only $25. She gives the doorkeeper a $5 bill and asks that it be refunded to the students. On the way to the room the doorkeeper realizes that he cannot divide $5 by 3 evenly, so he decides to refund the students $1 each and keeps $2 for himself. The students are happy that they paid only $9 each for the room. The doorkeeper is happy that he gets a $2 tip. But 3 $9 + $2 = $29. Where did the other $1 go? The question is deceptively worded. There is no reason to add the net payment of $27 to the doorkeeper s $2 tip. Since the room costs $25, the students have already, unkowingly, paid the tip. Their net cost is $30 minus the $5 refund plus the $2 tip, totaling $27.

C241 Homework Assignment 7

C241 Homework Assignment 7 C24 Homework Assignment 7. Prove that for all whole numbers n, n i 2 = n(n + (2n + The proof is by induction on k with hypothesis H(k i 2 = k(k + (2k + base case: To prove H(, i 2 = = = 2 3 = ( + (2 +

More information

C241 Homework Assignment 9

C241 Homework Assignment 9 C41 Homework Assignment 9 1. The language L and functions R, A, and T defined below are the same as in Section 7.6. L {a, b, } + 1. L a. u L au L b. u L bu L 3. n. e. A: L L R: L L T : L L 1. A(, v) =

More information

Mid-term Exam Answers and Final Exam Study Guide CIS 675 Summer 2010

Mid-term Exam Answers and Final Exam Study Guide CIS 675 Summer 2010 Mid-term Exam Answers and Final Exam Study Guide CIS 675 Summer 2010 Midterm Problem 1: Recall that for two functions g : N N + and h : N N +, h = Θ(g) iff for some positive integer N and positive real

More information

Unit 1 Lesson 6: Seeing Structure in Expressions

Unit 1 Lesson 6: Seeing Structure in Expressions Unit 1 Lesson 6: Seeing Structure in Expressions Objective: Students will be able to use inductive reasoning to try to solve problems that are puzzle like in nature. CCSS: A.SSE.1.b, A.SSE.2 Example Problems

More information

Math Circle: Recursion and Induction

Math 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 information

Matrix Multiplication

Matrix 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 information

Lesson 14: Solving Inequalities

Lesson 14: Solving Inequalities : Solving Inequalities Exercise 1 Consider the inequality x 2 + 4x 5. a. Sift through some possible values to assign to x that make this inequality a true statement. Find at least two positive values that

More information

Homework 1 Solutions

Homework 1 Solutions CS3510 Design & Analysis of Algorithms Section A Homework 1 Solutions Released 4pm Friday Sep 8, 2017 This homework has a total of 4 problems on 4 pages. Solutions should be submitted to GradeScope before

More information

Mathematical Induction

Mathematical 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 information

Please give details of your answer. A direct answer without explanation is not counted.

Please give details of your answer. A direct answer without explanation is not counted. Please give details of your answer. A direct answer without explanation is not counted. Your answers must be in English. Please carefully read problem statements. During the exam you are not allowed to

More information

Problem Set 1 Solutions

Problem Set 1 Solutions Introduction to Algorithms September 24, 2004 Massachusetts Institute of Technology 6.046J/18.410J Professors Piotr Indyk and Charles E. Leiserson Handout 7 Problem Set 1 Solutions Exercise 1-1. Do Exercise

More information

UNIT 2: REASONING WITH LINEAR EQUATIONS AND INEQUALITIES. Solving Equations and Inequalities in One Variable

UNIT 2: REASONING WITH LINEAR EQUATIONS AND INEQUALITIES. Solving Equations and Inequalities in One Variable UNIT 2: REASONING WITH LINEAR EQUATIONS AND INEQUALITIES This unit investigates linear equations and inequalities. Students create linear equations and inequalities and use them to solve problems. They

More information

LECTURE NOTES ON DESIGN AND ANALYSIS OF ALGORITHMS

LECTURE NOTES ON DESIGN AND ANALYSIS OF ALGORITHMS G.PULLAIAH COLLEGE OF ENGINEERING AND TECHNOLOGY LECTURE NOTES ON DESIGN AND ANALYSIS OF ALGORITHMS Department of Computer Science and Engineering 1 UNIT 1 Basic Concepts Algorithm An Algorithm is a finite

More information

Data Structures and Algorithms Chapter 2

Data Structures and Algorithms Chapter 2 1 Data Structures and Algorithms Chapter 2 Werner Nutt 2 Acknowledgments The course follows the book Introduction to Algorithms, by Cormen, Leiserson, Rivest and Stein, MIT Press [CLRST]. Many examples

More information

Finding the Median. 1 The problem of finding the median. 2 A good strategy? lecture notes September 2, Lecturer: Michel Goemans

Finding the Median. 1 The problem of finding the median. 2 A good strategy? lecture notes September 2, Lecturer: Michel Goemans 18.310 lecture notes September 2, 2013 Finding the Median Lecturer: Michel Goemans 1 The problem of finding the median Suppose we have a list of n keys that are completely unsorted. If we want to find

More information

REVIEW Chapter 1 The Real Number System

REVIEW 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 information

1617 GSE Alg. I Reasoning w/linear Equalities & Inequalities Touchstone

1617 GSE Alg. I Reasoning w/linear Equalities & Inequalities Touchstone High School HS Algebra 1 1617 GSE Alg. I Reasoning w/linear Equalities & Inequalities Touchstone 1. A number of apples were shared evenly among 4 students. Each student was also given 2 pears. Each student

More information

Algebra 1. Standard 1: Operations With Real Numbers Students simplify and compare expressions. They use rational exponents and simplify square roots.

Algebra 1. Standard 1: Operations With Real Numbers Students simplify and compare expressions. They use rational exponents and simplify square roots. Standard 1: Operations With Real Numbers Students simplify and compare expressions. They use rational exponents and simplify square roots. A1.1.1 Compare real number expressions. A1.1.2 Simplify square

More information

Solutions to Homework Assignment 2

Solutions to Homework Assignment 2 Solutions to Homework Assignment Real Analysis I February, 03 Notes: (a) Be aware that there maybe some typos in the solutions. If you find any, please let me know. (b) As is usual in proofs, most problems

More information

Lecture 10: Big-Oh. Doina Precup With many thanks to Prakash Panagaden and Mathieu Blanchette. January 27, 2014

Lecture 10: Big-Oh. Doina Precup With many thanks to Prakash Panagaden and Mathieu Blanchette. January 27, 2014 Lecture 10: Big-Oh Doina Precup With many thanks to Prakash Panagaden and Mathieu Blanchette January 27, 2014 So far we have talked about O() informally, as a way of capturing the worst-case computation

More information

CSE20: Discrete Mathematics

CSE20: Discrete Mathematics Spring 2018 Summary Today: Induction, Program Correctness Reading: Chap. 5 Division Theorem Theorem: For every integer a and positive integer d 1, there exist integers q, r such that a = qd + r and 0 r

More information

O5C1: Graphing Exponential Functions

O5C1: Graphing Exponential Functions Name: Class Period: Date: Algebra 2 Honors O5C1-4 REVIEW O5C1: Graphing Exponential Functions Graph the exponential function and fill in the table to the right. You will need to draw in the x- and y- axis.

More information

Input Decidable Language -- Program Halts on all Input Encoding of Input -- Natural Numbers Encoded in Binary or Decimal, Not Unary

Input Decidable Language -- Program Halts on all Input Encoding of Input -- Natural Numbers Encoded in Binary or Decimal, Not Unary Complexity Analysis Complexity Theory Input Decidable Language -- Program Halts on all Input Encoding of Input -- Natural Numbers Encoded in Binary or Decimal, Not Unary Output TRUE or FALSE Time and Space

More information

Algebra 1 Unit 6: Linear Inequalities and Absolute Value Guided Notes

Algebra 1 Unit 6: Linear Inequalities and Absolute Value Guided Notes Section 6.1: Solving Inequalities by Addition and Subtraction How do we solve the equation: x 12 = 65? How do we solve the equation: x 12 < 65? Graph the solution: Example 1: 12 y 9 Example 2: q + 23

More information

Section 3.2 Quadratic Functions & Their Graphs

Section 3.2 Quadratic Functions & Their Graphs Week 2 Handout MAC 1140 Professor Niraj Wagh J Section 3.2 Quadratic Functions & Their Graphs Quadratic Function: Standard Form A quadratic function is a function that can be written in the form: f (x)

More information

Study Guide for Math 095

Study Guide for Math 095 Study Guide for Math 095 David G. Radcliffe November 7, 1994 1 The Real Number System Writing a fraction in lowest terms. 1. Find the largest number that will divide into both the numerator and the denominator.

More information

Another Proof By Contradiction: 2 is Irrational

Another 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 information

Decision Procedures. Jochen Hoenicke. Software Engineering Albert-Ludwigs-University Freiburg. Winter Term 2016/17

Decision Procedures. Jochen Hoenicke. Software Engineering Albert-Ludwigs-University Freiburg. Winter Term 2016/17 Decision Procedures Jochen Hoenicke Software Engineering Albert-Ludwigs-University Freiburg Winter Term 2016/17 Jochen Hoenicke (Software Engineering) Decision Procedures Winter Term 2016/17 1 / 436 Program

More information

CISC-102 Fall 2017 Week 3. Principle of Mathematical Induction

CISC-102 Fall 2017 Week 3. Principle of Mathematical Induction Week 3 1 of 17 CISC-102 Fall 2017 Week 3 Principle of Mathematical Induction A proposition is defined as a statement that is either true or false. We will at times make a declarative statement as a proposition

More information

If we square the square root of something (that s not negative), we get the something : ( 34) ( ) 34

If we square the square root of something (that s not negative), we get the something : ( 34) ( ) 34 CH 60 MORE PYTHAGOREAN THEOREM AND MORE RADICALS Introduction T he last time we studied the Pythagorean Theorem we may have used our calculator to round square roots that didn t come out whole numbers.

More information

ASSIGNMENT 1 SOLUTIONS

ASSIGNMENT 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 information

Lesson 14. Classwork. Exercise 1. Consider the inequality 4 5.

Lesson 14. Classwork. Exercise 1. Consider the inequality 4 5. Classwork Exercise 1 Consider the inequality 45. a. Sift through some possible values to assign to that make this inequality a true statement. Find at least two positive values that work and at least two

More information

Lecture 2. More Algorithm Analysis, Math and MCSS By: Sarah Buchanan

Lecture 2. More Algorithm Analysis, Math and MCSS By: Sarah Buchanan Lecture 2 More Algorithm Analysis, Math and MCSS By: Sarah Buchanan Announcements Assignment #1 is posted online It is directly related to MCSS which we will be talking about today or Monday. There are

More information

CS 161 Summer 2009 Homework #2 Sample Solutions

CS 161 Summer 2009 Homework #2 Sample Solutions CS 161 Summer 2009 Homework #2 Sample Solutions Regrade Policy: If you believe an error has been made in the grading of your homework, you may resubmit it for a regrade. If the error consists of more than

More information

Midterm Exam. CS 3110: Design and Analysis of Algorithms. June 20, Group 1 Group 2 Group 3

Midterm 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 information

Exact and Approximate Equilibria for Optimal Group Network Formation

Exact and Approximate Equilibria for Optimal Group Network Formation Exact and Approximate Equilibria for Optimal Group Network Formation Elliot Anshelevich and Bugra Caskurlu Computer Science Department, RPI, 110 8th Street, Troy, NY 12180 {eanshel,caskub}@cs.rpi.edu Abstract.

More information

NOTE: You have 2 hours, please plan your time. Problems are not ordered by difficulty.

NOTE: 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 information

5 + 9(10) + 3(100) + 0(1000) + 2(10000) =

5 + 9(10) + 3(100) + 0(1000) + 2(10000) = Chapter 5 Analyzing Algorithms So far we have been proving statements about databases, mathematics and arithmetic, or sequences of numbers. Though these types of statements are common in computer science,

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

LESSON 2.1 ALGEBRAIC EXPRESSIONS

LESSON 2.1 ALGEBRAIC EXPRESSIONS LESSON 2.1 ALGEBRAIC EXPRESSIONS LESSON 2.1 ALGEBRAIC EXPRESSIONS 83 OVERVIEW Here s what you ll learn in this lesson: Simplifying Expressions a. Constants and variables b. Terms and coefficients c. Combining

More information

Topic 17. Analysis of Algorithms

Topic 17. Analysis of Algorithms Topic 17 Analysis of Algorithms Analysis of Algorithms- Review Efficiency of an algorithm can be measured in terms of : Time complexity: a measure of the amount of time required to execute an algorithm

More information

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element.

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element. The first exam will be on Monday, June 8, 202. The syllabus will be sections. and.2 in Lax, and the number theory handout found on the class web site, plus the handout on the method of successive squaring

More information

Solving Equations with Variables on Both Sides

Solving Equations with Variables on Both Sides 2-4 Warm Up Lesson Presentation Lesson Quiz Bell Quiz 2-4 2 pts Simplify. 1. 4x 10x 2 pts 2. -7(x 3) 3 pts 3. 15 (x 2) 10 pts possible 3 pts Solve the equation. 4. 3x + 2 = 8 Questions on 2-3 Objective

More information

7.12 The student will represent relationships with tables, graphs, rules, and words.

7.12 The student will represent relationships with tables, graphs, rules, and words. 7.12 The student will represent relationships with tables, graphs, rules, and words. HINTS & NOTES Relation- is a set of ordered pairs. Remember to always start from the origin. Origin is (0,0) Move horizontally

More information

2.1 Simplifying Algebraic Expressions

2.1 Simplifying Algebraic Expressions .1 Simplifying Algebraic Expressions A term is a number or the product of a number and variables raised to powers. The numerical coefficient of a term is the numerical factor. The numerical coefficient

More information

Math 90 Lecture Notes Chapter 1

Math 90 Lecture Notes Chapter 1 Math 90 Lecture Notes Chapter 1 Section 1.1: Introduction to Algebra This textbook stresses Problem Solving! Solving problems is one of the main goals of mathematics. Think of mathematics as a language,

More information

Heaps Induction. Heaps. Heaps. Tirgul 6

Heaps Induction. Heaps. Heaps. Tirgul 6 Tirgul 6 Induction A binary heap is a nearly complete binary tree stored in an array object In a max heap, the value of each node that of its children (In a min heap, the value of each node that of its

More information

COMP Analysis of Algorithms & Data Structures

COMP Analysis of Algorithms & Data Structures COMP 3170 - Analysis of Algorithms & Data Structures Shahin Kamali Lecture 4 - Jan. 10, 2018 CLRS 1.1, 1.2, 2.2, 3.1, 4.3, 4.5 University of Manitoba Picture is from the cover of the textbook CLRS. 1 /

More information

Reading and Writing. Mathematical Proofs. Slides by Arthur van Goetham

Reading 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 information

LESSON 6.3 POLYNOMIAL OPERATIONS II

LESSON 6.3 POLYNOMIAL OPERATIONS II LESSON 6.3 POLYNOMIAL OPERATIONS II LESSON 6.3 POLYNOMIALS OPERATIONS II 277 OVERVIEW Here's what you'll learn in this lesson: Multiplying Binomials a. Multiplying binomials by the FOIL method b. Perfect

More information

ACCUPLACER MATH 0310

ACCUPLACER MATH 0310 The University of Teas at El Paso Tutoring and Learning Center ACCUPLACER MATH 00 http://www.academics.utep.edu/tlc MATH 00 Page Linear Equations Linear Equations Eercises 5 Linear Equations Answer to

More information

Computational Complexity - Pseudocode and Recursions

Computational Complexity - Pseudocode and Recursions Computational Complexity - Pseudocode and Recursions Nicholas Mainardi 1 Dipartimento di Elettronica e Informazione Politecnico di Milano nicholas.mainardi@polimi.it June 6, 2018 1 Partly Based on Alessandro

More information

Exact and Approximate Equilibria for Optimal Group Network Formation

Exact and Approximate Equilibria for Optimal Group Network Formation Noname manuscript No. will be inserted by the editor) Exact and Approximate Equilibria for Optimal Group Network Formation Elliot Anshelevich Bugra Caskurlu Received: December 2009 / Accepted: Abstract

More information

Midterm 1. Your Exam Room: Name of Person Sitting on Your Left: Name of Person Sitting on Your Right: Name of Person Sitting in Front of You:

Midterm 1. Your Exam Room: Name of Person Sitting on Your Left: Name of Person Sitting on Your Right: Name of Person Sitting in Front of You: CS70 Discrete Mathematics and Probability Theory, Fall 2018 Midterm 1 8:00-10:00pm, 24 September Your First Name: SIGN Your Name: Your Last Name: Your Exam Room: Name of Person Sitting on Your Left: Name

More information

University of Colorado at Colorado Springs Math 090 Fundamentals of College Algebra

University of Colorado at Colorado Springs Math 090 Fundamentals of College Algebra University of Colorado at Colorado Springs Math 090 Fundamentals of College Algebra Table of Contents Chapter The Algebra of Polynomials Chapter Factoring 7 Chapter 3 Fractions Chapter 4 Eponents and Radicals

More information

COMP Analysis of Algorithms & Data Structures

COMP Analysis of Algorithms & Data Structures COMP 3170 - Analysis of Algorithms & Data Structures Shahin Kamali Lecture 4 - Jan. 14, 2019 CLRS 1.1, 1.2, 2.2, 3.1, 4.3, 4.5 University of Manitoba Picture is from the cover of the textbook CLRS. COMP

More information

tiple Choice tify the letter of the choice that best completes the statement or answers the question.

tiple Choice tify the letter of the choice that best completes the statement or answers the question. T PREP tiple Choice tify the letter of the choice that best completes the statement or answers the question. 1. The owner of a small business makes $76,000 per year. His business manager makes $49,000.

More information

CAHSEE on Target UC Davis, School and University Partnerships

CAHSEE on Target UC Davis, School and University Partnerships UC Davis, School and University Partnerships CAHSEE on Target Mathematics Curriculum Published by The University of California, Davis, School/University Partnerships Program 2006 Director Sarah R. Martinez,

More information

Solving Equations. A: Solving One-Variable Equations. One Step x + 6 = 9-3y = 15. Two Step 2a 3 6. Algebra 2 Chapter 1 Notes 1.4 Solving Equations

Solving Equations. A: Solving One-Variable Equations. One Step x + 6 = 9-3y = 15. Two Step 2a 3 6. Algebra 2 Chapter 1 Notes 1.4 Solving Equations Algebra 2 Chapter 1 Notes 1.4 Solving Equations 1.4 Solving Equations Topics: Solving Equations Translating Words into Algebra Solving Word Problems A: Solving One-Variable Equations The equations below

More information

Algebra II. A2.1.1 Recognize and graph various types of functions, including polynomial, rational, and algebraic functions.

Algebra II. A2.1.1 Recognize and graph various types of functions, including polynomial, rational, and algebraic functions. Standard 1: Relations and Functions Students graph relations and functions and find zeros. They use function notation and combine functions by composition. They interpret functions in given situations.

More information

CH 73 THE QUADRATIC FORMULA, PART II

CH 73 THE QUADRATIC FORMULA, PART II 1 CH THE QUADRATIC FORMULA, PART II INTRODUCTION W ay back in Chapter 55 we used the Quadratic Formula to solve quadratic equations like 6x + 1x + 0 0, whose solutions are 5 and 8. In fact, all of the

More information

Big-oh stuff. You should know this definition by heart and be able to give it,

Big-oh stuff. You should know this definition by heart and be able to give it, Big-oh stuff Definition. if asked. You should know this definition by heart and be able to give it, Let f and g both be functions from R + to R +. Then f is O(g) (pronounced big-oh ) if and only if there

More information

PRODUCTS THAT ARE POWERS. A mathematical vignette Ed Barbeau, University of Toronto

PRODUCTS THAT ARE POWERS. A mathematical vignette Ed Barbeau, University of Toronto PRODUCTS THAT ARE POWERS. A mathematical vignette Ed Barbeau, University of Toronto This investigation was originally designed for school students to gain fluency with the factoring of positive integers

More information

Review for Final Exam, MATH , Fall 2010

Review for Final Exam, MATH , Fall 2010 Review for Final Exam, MATH 170-002, Fall 2010 The test will be on Wednesday December 15 in ILC 404 (usual class room), 8:00 a.m - 10:00 a.m. Please bring a non-graphing calculator for the test. No other

More information

Lesson 14: Solving Inequalities

Lesson 14: Solving Inequalities Hart Interactive Algebra 1 Lesson 14 Classwork 1. Consider the inequality xx 2 + 4xx 5. a. Think about some possible values to assign to xx that make this inequality a true statement. Find at least two

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

Discrete Mathematics CS October 17, 2006

Discrete Mathematics CS October 17, 2006 Discrete Mathematics CS 2610 October 17, 2006 Uncountable sets Theorem: The set of real numbers is uncountable. If a subset of a set is uncountable, then the set is uncountable. The cardinality of a subset

More information

Lesson #33 Solving Incomplete Quadratics

Lesson #33 Solving Incomplete Quadratics Lesson # Solving Incomplete Quadratics A.A.4 Know and apply the technique of completing the square ~ 1 ~ We can also set up any quadratic to solve it in this way by completing the square, the technique

More information

Chapter 1: Fundamentals of Algebra Lecture notes Math 1010

Chapter 1: Fundamentals of Algebra Lecture notes Math 1010 Section 1.1: The Real Number System Definition of set and subset A set is a collection of objects and its objects are called members. If all the members of a set A are also members of a set B, then A is

More information

Algebra Review C H A P T E R. To solve an algebraic equation with one variable, find the value of the unknown variable.

Algebra Review C H A P T E R. To solve an algebraic equation with one variable, find the value of the unknown variable. C H A P T E R 6 Algebra Review This chapter reviews key skills and concepts of algebra that you need to know for the SAT. Throughout the chapter are sample questions in the style of SAT questions. Each

More information

Algorithmic number theory. Questions/Complaints About Homework? The division algorithm. Division

Algorithmic number theory. Questions/Complaints About Homework? The division algorithm. Division Questions/Complaints About Homework? Here s the procedure for homework questions/complaints: 1. Read the solutions first. 2. Talk to the person who graded it (check initials) 3. If (1) and (2) don t work,

More information

CPSC 320 Sample Final Examination December 2013

CPSC 320 Sample Final Examination December 2013 CPSC 320 Sample Final Examination December 2013 [10] 1. Answer each of the following questions with true or false. Give a short justification for each of your answers. [5] a. 6 n O(5 n ) lim n + This is

More information

Advanced Analysis of Algorithms - Homework I (Solutions)

Advanced Analysis of Algorithms - Homework I (Solutions) Advanced Analysis of Algorithms - Homework I (Solutions) K. Subramani LCSEE, West Virginia University, Morgantown, WV {ksmani@csee.wvu.edu} 1 Problems 1. Given an array A of n integer elements, how would

More information

Mat Week 6. Fall Mat Week 6. Algorithms. Properties. Examples. Searching. Sorting. Time Complexity. Example. Properties.

Mat Week 6. Fall Mat Week 6. Algorithms. Properties. Examples. Searching. Sorting. Time Complexity. Example. Properties. Fall 2013 Student Responsibilities Reading: Textbook, Section 3.1 3.2 Assignments: 1. for sections 3.1 and 3.2 2. Worksheet #4 on Execution s 3. Worksheet #5 on Growth Rates Attendance: Strongly Encouraged

More information

APPENDIX B: Review of Basic Arithmetic

APPENDIX B: Review of Basic Arithmetic APPENDIX B: Review of Basic Arithmetic Personal Trainer Algebra Click Algebra in the Personal Trainer for an interactive review of these concepts. Equality = Is equal to 3 = 3 Three equals three. 3 = +3

More information

Algorithms and Their Complexity

Algorithms and Their Complexity CSCE 222 Discrete Structures for Computing David Kebo Houngninou Algorithms and Their Complexity Chapter 3 Algorithm An algorithm is a finite sequence of steps that solves a problem. Computational complexity

More information

Student Responsibilities Week 6. Mat Properties of Algorithms. 3.1 Algorithms. Finding the Maximum Value in a Finite Sequence Pseudocode

Student Responsibilities Week 6. Mat Properties of Algorithms. 3.1 Algorithms. Finding the Maximum Value in a Finite Sequence Pseudocode Student Responsibilities Week 6 Mat 345 Week 6 Reading: Textbook, Section 3.1 3. Assignments: 1. for sections 3.1 and 3.. Worksheet #4 on Execution Times 3. Worksheet #5 on Growth Rates Attendance: Strongly

More information

(2) Generalize De Morgan s laws for n sets and prove the laws by induction. 1

(2) Generalize De Morgan s laws for n sets and prove the laws by induction. 1 ARS DIGITA UNIVERSITY MONTH 2: DISCRETE MATHEMATICS PROFESSOR SHAI SIMONSON PROBLEM SET 2 SOLUTIONS SET, FUNCTIONS, BIG-O, RATES OF GROWTH (1) Prove by formal logic: (a) The complement of the union of

More information

A New Paradigm for the Computational Complexity Analysis of Algorithms and Functions

A New Paradigm for the Computational Complexity Analysis of Algorithms and Functions Issue 1, Volume 1, 2007 5 A New Paradigm for the Computational Complexity Analysis of Algorithms and Functions Ahmed Tare Abstract There exists a variety of techniques for the computational complexity

More information

In this episode of The Verification Corner, Rustan Leino talks about Loop Invariants. He gives a brief summary of the theoretical foundations and

In this episode of The Verification Corner, Rustan Leino talks about Loop Invariants. He gives a brief summary of the theoretical foundations and In this episode of The Verification Corner, Rustan Leino talks about Loop Invariants. He gives a brief summary of the theoretical foundations and shows how a program can sometimes be systematically constructed

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

Algebra 1 S1 Lesson Summaries. Lesson Goal: Mastery 70% or higher

Algebra 1 S1 Lesson Summaries. Lesson Goal: Mastery 70% or higher Algebra 1 S1 Lesson Summaries For every lesson, you need to: Read through the LESSON REVIEW which is located below or on the last page of the lesson and 3-hole punch into your MATH BINDER. Read and work

More information

Introduction to Algorithms and Asymptotic analysis

Introduction to Algorithms and Asymptotic analysis Indian Institute of Information Technology Design and Manufacturing, Kancheepuram Chennai 600 127, India An Autonomous Institute under MHRD, Govt of India An Institute of National Importance COM 501 Advanced

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

Lecture 2: Asymptotic Notation CSCI Algorithms I

Lecture 2: Asymptotic Notation CSCI Algorithms I Lecture 2: Asymptotic Notation CSCI 700 - Algorithms I Andrew Rosenberg September 2, 2010 Last Time Review Insertion Sort Analysis of Runtime Proof of Correctness Today Asymptotic Notation Its use in analyzing

More information

1.1 Inductive Reasoning filled in.notebook August 20, 2015

1.1 Inductive Reasoning filled in.notebook August 20, 2015 1.1 Inductive Reasoning 1 Vocabulary Natural or Counting Numbers Ellipsis Scientific Method Hypothesis or Conjecture Counterexample 2 Vocabulary Natural or Counting Numbers 1, 2, 3, 4, 5... positive whole

More information

Use mathematical induction in Exercises 3 17 to prove summation formulae. Be sure to identify where you use the inductive hypothesis.

Use 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 information

Egyptian Fractions: Part II

Egyptian Fractions: Part II Egyptian Fractions: Part II Prepared y: Eli Jaffe Octoer 15, 2017 1 Will It End 1. Consider the following algorithm for eating some initial amount of cake. Step 1: Eat 1 of the remaining amount of cake.

More information

ALGEBRA CLAST MATHEMATICS COMPETENCIES

ALGEBRA CLAST MATHEMATICS COMPETENCIES 2 ALGEBRA CLAST MATHEMATICS COMPETENCIES IC1a: IClb: IC2: IC3: IC4a: IC4b: IC: IC6: IC7: IC8: IC9: IIC1: IIC2: IIC3: IIC4: IIIC2: IVC1: IVC2: Add and subtract real numbers Multiply and divide real numbers

More information

Time Complexity (1) CSCI Spring Original Slides were written by Dr. Frederick W Maier. CSCI 2670 Time Complexity (1)

Time Complexity (1) CSCI Spring Original Slides were written by Dr. Frederick W Maier. CSCI 2670 Time Complexity (1) Time Complexity (1) CSCI 2670 Original Slides were written by Dr. Frederick W Maier Spring 2014 Time Complexity So far we ve dealt with determining whether or not a problem is decidable. But even if it

More information

Complete Week 18 Package

Complete Week 18 Package Complete Week 18 Package Jeanette Stein Table of Contents Unit 4 Pacing Chart -------------------------------------------------------------------------------------------- 1 Day 86 Bellringer --------------------------------------------------------------------------------------------

More information

MATH CSE20 Homework 5 Due Monday November 4

MATH 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 information

Module 1: Analyzing the Efficiency of Algorithms

Module 1: Analyzing the Efficiency of Algorithms Module 1: Analyzing the Efficiency of Algorithms Dr. Natarajan Meghanathan Professor of Computer Science Jackson State University Jackson, MS 39217 E-mail: natarajan.meghanathan@jsums.edu What is an Algorithm?

More information

Price of Stability in Survivable Network Design

Price of Stability in Survivable Network Design Noname manuscript No. (will be inserted by the editor) Price of Stability in Survivable Network Design Elliot Anshelevich Bugra Caskurlu Received: January 2010 / Accepted: Abstract We study the survivable

More information

Running Time Evaluation

Running Time Evaluation Running Time Evaluation Quadratic Vs. Linear Time Lecturer: Georgy Gimel farb COMPSCI 220 Algorithms and Data Structures 1 / 19 1 Running time 2 Examples 3 Big-Oh, Big-Omega, and Big-Theta Tools 4 Time

More information

Hoare Logic I. Introduction to Deductive Program Verification. Simple Imperative Programming Language. Hoare Logic. Meaning of Hoare Triples

Hoare Logic I. Introduction to Deductive Program Verification. Simple Imperative Programming Language. Hoare Logic. Meaning of Hoare Triples Hoare Logic I Introduction to Deductive Program Verification Işıl Dillig Program Spec Deductive verifier FOL formula Theorem prover valid contingent Example specs: safety (no crashes), absence of arithmetic

More information

CCGPS Coordinate Algebra. EOCT Review Units 1 and 2

CCGPS Coordinate Algebra. EOCT Review Units 1 and 2 CCGPS Coordinate Algebra EOCT Review Units 1 and 2 Unit 1: Relationships Among Quantities Key Ideas Unit Conversions A quantity is a an exact amount or measurement. A quantity can be exact or approximate

More information

Herndon High School Geometry Honors Summer Assignment

Herndon High School Geometry Honors Summer Assignment Welcome to Geometry! This summer packet is for all students enrolled in Geometry Honors at Herndon High School for Fall 07. The packet contains prerequisite skills that you will need to be successful in

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

2D1431 Machine Learning. Bagging & Boosting

2D1431 Machine Learning. Bagging & Boosting 2D1431 Machine Learning Bagging & Boosting Outline Bagging and Boosting Evaluating Hypotheses Feature Subset Selection Model Selection Question of the Day Three salesmen arrive at a hotel one night and

More information