GCD and Optimization Problem

Slides:



Advertisements
Similar presentations
Computer Science CSC 474Dr. Peng Ning1 CSC 474 Information Systems Security Topic 2.3 Basic Number Theory.
Advertisements

Section 4.1: Primes, Factorization, and the Euclidean Algorithm Practice HW (not to hand in) From Barr Text p. 160 # 6, 7, 8, 11, 12, 13.
Sets, Combinatorics, Probability, and Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides.
Quotient-Remainder Theory, Div and Mod
Introductory Lecture. What is Discrete Mathematics? Discrete mathematics is the part of mathematics devoted to the study of discrete (as opposed to continuous)
Chapter II. THE INTEGERS
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
Proofs, Recursion, and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProofs,
Cyclic Groups. Definition G is a cyclic group if G = for some a in G.
TK3043 Analysis and Design of Algorithms Introduction to Algorithms.
Peter Lam Discrete Math CS.  Sometimes Referred to Clock Arithmetic  Remainder is Used as Part of Value ◦ i.e Clocks  24 Hours in a Day However, Time.
BY MISS FARAH ADIBAH ADNAN IMK
Introduction Dr. Ying Lu RAIK 283: Data Structures & Algorithms.
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
Chapter 2 The Fundamentals: Algorithms, the Integers, and Matrices
1 Properties of Integers Objectives At the end of this unit, students should be able to: State the division algorithm Apply the division algorithm Find.
Section 2.2: Affine Ciphers; More Modular Arithmetic Practice HW (not to hand in) From Barr Textbook p. 80 # 2a, 3e, 3f, 4, 5a, 7, 8 9, 10 (Use affinecipherbreaker.
Mathematics of Cryptography Part I: Modular Arithmetic
Mathematics of Cryptography Modular Arithmetic, Congruence,
Mathematics in OI Prepared by Ivan Li. Mathematics in OI Greatest Common Divisor Finding Primes High Precision Arithmetic Partial Sum and Differencing.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CompSci 102 Discrete Math for Computer Science
1 Lecture 3.3: Recursion CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda Heeren, Zeph Grunschlag.
Homework Complete Worksheet #3 Test on Real Analysis next time.
Information Security Lab. Dept. of Computer Engineering 87/121 PART I Symmetric Ciphers CHAPTER 4 Finite Fields 4.1 Groups, Rings, and Fields 4.2 Modular.
A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3 rd ed., Ch. 1 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
CS404 Design and Analysis of Algorithms BBy DDr. M V S Peri Sastry BB.E, PhD(BITS-Pilani)
Ref: Pfleeger96, Ch.31 Properties of Arithmetic Reference: Pfleeger, Charles P., Security in Computing, 2nd Edition, Prentice Hall, 1996.
Discrete Mathematics
CS480 Cryptography and Information Security
CS480 Cryptography and Information Security Huiping Guo Department of Computer Science California State University, Los Angeles 3. Mathematics of Cryptography.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Discrete Math II Howon Kim
Mathematical Background for Cryptography: Modular arithmetic and gcd
Mathematics of Cryptography
TK3043 Analysis and Design of Algorithms
Introduction to Cryptography
Chapter 1 Introduction Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
What is an algorithm? An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate.
What is an algorithm? An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate.
What is an algorithm? An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate.
Quick reviews / corrections
What is an algorithm? An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate.
Cryptology Design Fundamentals
Cryptology Design Fundamentals
MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana Dr. Nahid Sultana Chapter 4: Number Theory and Cryptography.
Number Theory and Modular Arithmetic
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Applied Discrete Mathematics Week 4: Number Theory
What is an algorithm? An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate.
What is an algorithm? An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate.
Mathematical Background: Prime Numbers
Lecture 20 Guest lecturer: Neal Gupta
Discrete Math for CS CMPSC 360 LECTURE 12 Last time: Stable matching
The Extended Euclidean Algorithm (2/10)
CS 250, Discrete Structures, Fall 2011 Nitesh Saxena
CS 250, Discrete Structures, Fall 2015 Nitesh Saxena
CS 250, Discrete Structures, Fall 2014 Nitesh Saxena
Euclidean Algorithm for GCD
Application: Algorithms
Application: Algorithms
Miniconference on the Mathematics of Computation
Applied Discrete Mathematics Week 10: Introduction to Counting
GCD CSCI 284/162 Spring 2009 GW.
Introduction to Algorithms
Number Theory.
Cryptography Lecture 16.
Chapter 1 Introduction Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Sets, Combinatorics, Probability, and Number Theory
What is an algorithm? An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate.
Presentation transcript:

GCD and Optimization Problem

Euclidean Algorithm m , n gcd(m,n) integer euclid(pos. integer m, pos. integer n) x = m, y = n while(y > 0) r = x mod y x = y y = r return x L11

Euclidean Algorithm. Example gcd(33,77): Step r = x mod y x y - 33 77 L11

Euclidean Algorithm. Example gcd(33,77): Step r = x mod y x y - 33 77 1 33 mod 77 = 33 L11

Euclidean Algorithm. Example gcd(33,77): Step r = x mod y x y - 33 77 1 33 mod 77 = 33 2 77 mod 33 = 11 11 L11

Euclidean Algorithm. Example gcd(33,77): Step r = x mod y x y - 33 77 1 33 mod 77 = 33 2 77 mod 33 = 11 11 3 33 mod 11 = 0 L11

Euclidean Algorithm. Example gcd(244,117): Step r = x mod y x y - 244 117 L11

Euclidean Algorithm. Example gcd(244,117): Step r = x mod y x y - 244 117 1 244 mod 117 = 10 10 L11

Euclidean Algorithm. Example gcd(244,117): Step r = x mod y x y - 244 117 1 244 mod 117 = 10 10 2 117 mod 10 = 7 7 L11

Euclidean Algorithm. Example gcd(244,117): Step r = x mod y x y - 244 117 1 244 mod 117 = 10 10 2 117 mod 10 = 7 7 3 10 mod 7 = 3 L11

Euclidean Algorithm. Example gcd(244,117): Step r = x mod y x y - 244 117 1 244 mod 117 = 10 10 2 117 mod 10 = 7 7 3 10 mod 7 = 3 4 7 mod 3 = 1 L11

Euclidean Algorithm. Example gcd(244,117): By definition  244 and 117 are rel. prime. Step r = x mod y x y - 244 117 1 244 mod 117 = 10 10 2 117 mod 10 = 7 7 3 10 mod 7 = 3 4 7 mod 3 = 1 5 3 mod 1=0 L11

Euclidean Algorithm Correctness The reason that Euclidean algorithm works is gcd(x,y ) is not changed from line to line. If x’, y’ denote the next values of x , y then: gcd(x’,y’) = gcd(y, x mod y) = gcd(y, x + qy) (the useful fact) = gcd(y, x ) (subtract y -multiple) = gcd(x,y) L11

Optimization Problem In mathematics and computer science, an optimization problem is the problem of finding the best solution from all feasible solutions. Optimization problems can be divided into two categories depending on whether the variables are continuous or discrete. An optimization problem with discrete variables is known as a combinatorial optimization problem. In a combinatorial optimization problem, we are looking for an object such as an integer, permutation or graph from a finite (or possibly countable infinite) set.

Thank You !!!