Complexity of the Euclidean Algorithm (2/7) The complexity of an algorithm is the approximate number of steps necessary for the algorithm to finish as.

Slides:



Advertisements
Similar presentations
Rules of Matrix Arithmetic
Advertisements

Euclidean Algorithm Applied Symbolic Computation CS 567 Jeremy Johnson.
Study Guides Quantitative - Arithmetic - Numbers, Divisibility Test, HCF and LCM Mycatstudy.com.
February 19, 2015Applied Discrete Mathematics Week 4: Number Theory 1 The Growth of Functions Question: If f(x) is O(x 2 ), is it also O(x 3 )? Yes. x.
Copyright © 2013, 2010, and 2007, Pearson Education, Inc.
April 9, 2015Applied Discrete Mathematics Week 9: Relations 1 Solving Recurrence Relations Another Example: Give an explicit formula for the Fibonacci.
Essential Question: What are some of the similarities and differences between natural and common logarithms.
CSC 2300 Data Structures & Algorithms January 30, 2007 Chapter 2. Algorithm Analysis.
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
Properties of Logarithms
Table of Contents Solving Logarithmic Equations A logarithmic equation is an equation with an expression that contains the log of a variable expression.
4.4 Notes The Rational Root Theorem. 4.4 Notes To solve a polynomial equation, begin by getting the equation in standard form set equal to zero. Then.
If m and n are positive integers and a and b are real numbers (b0 when it is a denominator), then: Let’s review some properties of exponents where the.
Imaginary and Complex Numbers. Complex Number System The basic algebraic property of i is the following: i² = −1 Let us begin with i 0, which is 1. Each.
For a geometric sequence, , for every positive integer k.
Essential Question: Give examples of equations that can be solved using the properties of exponents and logarithms.
BY MISS FARAH ADIBAH ADNAN IMK
Quiz 2 key.
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
CSCI 1900 Discrete Structures
Chapter 2 The Fundamentals: Algorithms, the Integers, and Matrices
Ch 8.1 Numerical Methods: The Euler or Tangent Line Method
Mathematics of Cryptography Part I: Modular Arithmetic
Section 6.4 Exponential and Logarithmic Equations
Rational Exponents, Radicals, and Complex Numbers
Section 4.1 Logarithms and their Properties. Suppose you have $100 in an account paying 5% compounded annually. –Create an equation for the balance B.
Section 3.4 Exponential and Logarithmic Equations.
Algebra 1 Review Chapter 1 Real Numbers, Algebra and Problem Solving (no exponents) Algebra 2 Name:____________________ Date:_______________.
Continued Fractions, Euclidean Algorithm and Lehmer’s Algorithm Applied Symbolic Computation CS 567 Jeremy Johnson TexPoint fonts used in EMF. Read the.
Math 409/409G History of Mathematics
Nattee Niparnan. Recall  Complexity Analysis  Comparison of Two Algos  Big O  Simplification  From source code  Recursive.
Section 7.1 – Solving Quadratic Equations. We already know how to solve quadratic equations. What if we can’t factor? Maybe we can use the Square Root.
WIKIPEDIA HAS MANY MORE DIVISIBILITY RULES. EXAMPLE Since 52=13(4) is divisible by 4, is divisible by 4 Since 452=56(8)+4 is not divisible.
The Integers. The Division Algorithms A high-school question: Compute 58/17. We can write 58 as 58 = 3 (17) + 7 This forms illustrates the answer: “3.
Properties of Logarithms Product, Quotient and Power Properties of Logarithms Solving Logarithmic Equations Using Properties of Logarithms Practice.
Rational Numbers and Fields
MAT 320 Spring 2008 Section 1.2.  Start with two integers for which you want to find the GCD. Apply the division algorithm, dividing the smaller number.
Zeros of Polynomials 2.5.
More on Logarithmic Functions 9.6
5.4 Properties of Logarithms 3/1/2013
Partial Quotients.
Section 5.5 The Real Zeros of a Polynomial Function.
7.4 Solving Polynomial Equations
Computing k th Roots Quickly (4/4) Via the Fast Exp algorithm, we know we can quickly compute large powers of large numbers modulo large numbers. What.
8 th Grade Study Guide System of Equations - Pythagorean Theorem - Laws of Exponents Scientific Notation - Solving Equations.
Solve each equation and check the solution. 08 September 2015 Warm-Up.
Application: Algorithms Lecture 20 Section 3.8 Wed, Feb 21, 2007.
Copyright © 2015, 2008, 2011 Pearson Education, Inc. Section 4.4, Slide 1 Chapter 4 Exponential Functions.
Exponential and Logarithmic Equations
By Dr. Julia Arnold. Concept 1 The Exponential Function.
Start Up Day What is the logarithmic form of 144 = 122?
Chapter 3 Limits and the Derivative Section 1 Introduction to Limits.
Property of Logarithms If x > 0, y > 0, a > 0, and a ≠ 1, then x = y if and only if log a x = log a y.
Application: Algorithms Lecture 19 Section 3.8 Tue, Feb 20, 2007.
Remarks on Fast Exp (4/2) How do we measure how fast any algorithm is? Definition. The complexity of an algorithm is a measure of the approximate number.
Chapter 4 With Question/Answer Animations 1. Chapter Summary Divisibility and Modular Arithmetic - Sec 4.1 – Lecture 16 Integer Representations and Algorithms.
Slide Copyright © 2009 Pearson Education, Inc. Slide Copyright © 2009 Pearson Education, Inc. Chapter 1 Number Theory and the Real Number System.
Advanced Algorithms Analysis and Design By Dr. Nazir Ahmad Zafar Dr Nazir A. Zafar Advanced Algorithms Analysis and Design.
LOGARITHMIC AND EXPONENTIAL EQUATIONS Intro to logarithms and solving exponential equations.
Agenda Review:  Relation Properties Lecture Content:  Divisor and Prime Number  Binary, Octal, Hexadecimal Review & Exercise.
WECHS – 13 December  Given that log 2.72 = , approximate the following without a calculator: log 0.272, log 272, and log  How would.
Exponents and Radicals
Change of Base.
Exponential and Logarithmic Functions
Properties of Logarithms
5.5 Properties and Laws of Logarithms
Math 083 Bianco Warm Up! List all the perfect squares you know.
Rational Exponents, Radicals, and Complex Numbers
Application: Algorithms
Algebra 1 Section 2.6.
Presentation transcript:

Complexity of the Euclidean Algorithm (2/7) The complexity of an algorithm is the approximate number of steps necessary for the algorithm to finish as a function of the size of the input. Most commonly we are interested in either average case complexity or worst case complexity. These mean exactly what they sound like. We shall now analyze the worst case complexity of the Euclidean Algorithm (EA).

EA Worst Case The EA will take the longest if each remainder is not much smaller than the previous remainder. Said another way, EA will take the longest if the quotients q k are relatively small. In particular, the worst case is going to occur when every quotient is 1 ! So, what does the EA sequence look like if every quotient is 1: (Recall: r -1 = a and r 0 = b.) r -1 = r 0 + r 1 r 0 = r 1 + r 2 r 1 = r 2 + r r n-2 = r n-1 + r n

EA Worst Case Continued For simplicity, let’s assume n is even (easy to adjust if odd), where r n is the last non-zero remainder. From above we have then: b = r 1 + r 2 > 2r 2, r 2 = r 3 + r 4 > 2r 4, r 4 = r 5 + r 6 > 2r 6, etc., and finally r n-2 = r n-1 + r n > 2r n. Combining all these, we get b > 2 n/2 r n  2 n/2. Now solve this equation for n. (How do you solve equations for things in the exponent?) Finally, change the base-2 log to a base-10 log, since base10 logs reveal the number of decimal digits. (Discuss.)

Conclusion: Theorem. The worst case complexity for the Euclidean Algorithm is that it will complete in a number of steps which is at most about 6.7 times the number of decimal digits in b. Finally, are there pairs of numbers which have the property that this worst case occurs when you apply the EA to them to get their GCD? Answer: Yes! Consider the Fibonacci Numbers. For Monday, absorb these ideas!!