greatest common divisor



Similar documents
We are now ready to answer the question: What are the possible cardinalities for finite fields?

n + d + q = 24 and.05n +.1d +.25q = 2 { n + d + q = 24 (3) n + 2d + 5q = 40 (2)

8.5 UNITARY AND HERMITIAN MATRICES. The conjugate transpose of a complex matrix A, denoted by A*, is given by

v a 1 b 1 i, a 2 b 2 i,..., a n b n i.

1 Example 1: Axis-aligned rectangles

BERNSTEIN POLYNOMIALS

Ring structure of splines on triangulations

Recurrence. 1 Definitions and main statements

This circuit than can be reduced to a planar circuit

Matrix Multiplication I

SIMPLE LINEAR CORRELATION

Compiling for Parallelism & Locality. Dependence Testing in General. Algorithms for Solving the Dependence Problem. Dependence Testing

PERRON FROBENIUS THEOREM

Generalizing the degree sequence problem

Series Solutions of ODEs 2 the Frobenius method. The basic idea of the Frobenius method is to look for solutions of the form 3

An Alternative Way to Measure Private Equity Performance

Question 2: What is the variance and standard deviation of a dataset?

Solution: Let i = 10% and d = 5%. By definition, the respective forces of interest on funds A and B are. i 1 + it. S A (t) = d (1 dt) 2 1. = d 1 dt.

THE METHOD OF LEAST SQUARES THE METHOD OF LEAST SQUARES

The Greedy Method. Introduction. 0/1 Knapsack Problem

Linear Circuits Analysis. Superposition, Thevenin /Norton Equivalent circuits

benefit is 2, paid if the policyholder dies within the year, and probability of death within the year is ).

Level Annuities with Payments Less Frequent than Each Interest Period

Luby s Alg. for Maximal Independent Sets using Pairwise Independence

What is Candidate Sampling

where the coordinates are related to those in the old frame as follows.

Finite Math Chapter 10: Study Guide and Solution to Problems

Extending Probabilistic Dynamic Epistemic Logic

Fast degree elevation and knot insertion for B-spline curves

Support Vector Machines

Implementation of Deutsch's Algorithm Using Mathcad

Simple Interest Loans (Section 5.1) :

HÜCKEL MOLECULAR ORBITAL THEORY

Time Value of Money Module

NMT EE 589 & UNM ME 482/582 ROBOT ENGINEERING. Dr. Stephen Bruder NMT EE 589 & UNM ME 482/582

Lecture 2 Sequence Alignment. Burr Settles IBS Summer Research Program 2008 bsettles@cs.wisc.edu

The Mathematical Derivation of Least Squares

PSYCHOLOGICAL RESEARCH (PYC 304-C) Lecture 12

Description of the Force Method Procedure. Indeterminate Analysis Force Method 1. Force Method con t. Force Method con t

How To Calculate The Accountng Perod Of Nequalty

Answer: A). There is a flatter IS curve in the high MPC economy. Original LM LM after increase in M. IS curve for low MPC economy

NON-CONSTANT SUM RED-AND-BLACK GAMES WITH BET-DEPENDENT WIN PROBABILITY FUNCTION LAURA PONTIGGIA, University of the Sciences in Philadelphia

DEFINING %COMPLETE IN MICROSOFT PROJECT

Project Networks With Mixed-Time Constraints

Rotation Kinematics, Moment of Inertia, and Torque

1. Math 210 Finite Mathematics

Texas Instruments 30X IIS Calculator

Section 5.4 Annuities, Present Value, and Amortization

Performance attribution for multi-layered investment decisions

OPTIMAL INVESTMENT POLICIES FOR THE HORSE RACE MODEL. Thomas S. Ferguson and C. Zachary Gilstein UCLA and Bell Communications May 1985, revised 2004

Thursday, December 10, 2009 Noon - 1:50 pm Faraday 143

Minimal Coding Network With Combinatorial Structure For Instantaneous Recovery From Edge Failures

Logical Development Of Vogel s Approximation Method (LD-VAM): An Approach To Find Basic Feasible Solution Of Transportation Problem

Nonbinary Quantum Error-Correcting Codes from Algebraic Curves

Calculation of Sampling Weights

NPAR TESTS. One-Sample Chi-Square Test. Cell Specification. Observed Frequencies 1O i 6. Expected Frequencies 1EXP i 6

Logistic Regression. Lecture 4: More classifiers and classes. Logistic regression. Adaboost. Optimization. Multiple class classification

Face Verification Problem. Face Recognition Problem. Application: Access Control. Biometric Authentication. Face Verification (1:1 matching)

The descriptive complexity of the family of Banach spaces with the π-property

Chapter 4 ECONOMIC DISPATCH AND UNIT COMMITMENT

A Novel Methodology of Working Capital Management for Large. Public Constructions by Using Fuzzy S-curve Regression

On the Optimal Control of a Cascade of Hydro-Electric Power Stations

"Research Note" APPLICATION OF CHARGE SIMULATION METHOD TO ELECTRIC FIELD CALCULATION IN THE POWER CABLES *

EXAMPLE PROBLEMS SOLVED USING THE SHARP EL-733A CALCULATOR

1. Measuring association using correlation and regression

J. Parallel Distrib. Comput.

On some special nonlevel annuities and yield rates for annuities

Production. 2. Y is closed A set is closed if it contains its boundary. We need this for the solution existence in the profit maximization problem.

INTERPRETING TRUE ARITHMETIC IN THE LOCAL STRUCTURE OF THE ENUMERATION DEGREES.

Fisher Markets and Convex Programs

Consider a 1-D stationary state diffusion-type equation, which we will call the generalized diffusion equation from now on:

Causal, Explanatory Forecasting. Analysis. Regression Analysis. Simple Linear Regression. Which is Independent? Forecasting

MATH 289 PROBLEM SET 4: NUMBER THEORY

On Lockett pairs and Lockett conjecture for π-soluble Fitting classes

A Performance Analysis of View Maintenance Techniques for Data Warehouses

Lecture 2: Single Layer Perceptrons Kevin Swingler

Stochastic Inventory Management for Tactical Process Planning under Uncertainties: MINLP Models and Algorithms

Alternate Approximation of Concave Cost Functions for

Module 2 LOSSLESS IMAGE COMPRESSION SYSTEMS. Version 2 ECE IIT, Kharagpur

1. Fundamentals of probability theory 2. Emergence of communication traffic 3. Stochastic & Markovian Processes (SP & MP)

ON CYCLOTOMIC POLYNOMIALS WITH ±1 COEFFICIENTS

Kevin James. MTHSC 412 Section 2.4 Prime Factors and Greatest Comm

FINANCIAL MATHEMATICS. A Practical Guide for Actuaries. and other Business Professionals

21 Vectors: The Cross Product & Torque

An MILP model for planning of batch plants operating in a campaign-mode

Risk-based Fatigue Estimate of Deep Water Risers -- Course Project for EM388F: Fracture Mechanics, Spring 2008

Least Squares Fitting of Data

8 Algorithm for Binary Searching in Trees

The Noether Theorems: from Noether to Ševera

The OC Curve of Attribute Acceptance Plans

INSTITUT FÜR INFORMATIK

8.4. Annuities: Future Value. INVESTIGATE the Math Annuities: Future Value

On Leonid Gurvits s proof for permanents

CHOLESTEROL REFERENCE METHOD LABORATORY NETWORK. Sample Stability Protocol

Implementation of Boolean Functions through Multiplexers with the Help of Shannon Expansion Theorem

Using Series to Analyze Financial Situations: Present Value

The circuit shown on Figure 1 is called the common emitter amplifier circuit. The important subsystems of this circuit are:

copyright 1997 Bruce A. McCarl and Thomas H. Spreen.

Lecture 3: Annuity. Study annuities whose payments form a geometric progression or a arithmetic progression.

Product-Form Stationary Distributions for Deficiency Zero Chemical Reaction Networks

Transcription:

4. GCD 1 The greatest common dvsor of two ntegers a and b (not both zero) s the largest nteger whch s a common factor of both a and b. We denote ths number by gcd(a, b), or smply (a, b) when there s no confuson about the ntent of the notaton. Example: (13320, 22140) =?

4. GCD 2 Soluton #1: The dvsors of 13320 are 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 37, 40, 45, 60, 72, 74, 90, 111, 120, 148, 180, 185, 222, 296, 333, 360, 370, 444, 555, 666, 740, 888, 1110, 1332, 1480, 1665, 2220, 2664, 3330, 4440, 6660, 13320; the dvsors of 22140 are 1, 2, 3, 4, 5, 6, 9, 10, 12, 15, 18, 20, 27, 30, 36, 41, 45, 54, 60, 82, 90, 108, 123, 135, 164, 180, 205, 246, 270, 369, 410, 492, 540, 615, 738, 820, 1107, 1230, 1476, 1845, 2214, 2460, 3690, 4428, 5535, 7380, 11070, 22140 The common dvsors are hghlghted; the largest number n both sets s 180.

4. GCD 3 Soluton #2: The prme factorzatons of these numbers are 13320 = 2 3 3 2 5 37 and 22140 = 2 2 3 3 5 41. The gcd can be nferred from these factorzatons to be 2 2 3 2 5 = 180. Proposton Suppose that the ntegers m and n have prme factorzatons d p and both numbers.) Then (m, n) = e p, respectvely, where the d s and e s are nonnegatve exponents (thereby allowng us to use the same set of prmes for mn(d p,e ). // Corollary Every common dvsor of m and n s a dvsor of (m, n). // Porsm Suppose that the ntegers m and n have prme factorzatons [m, n] = d p and max(d p,e ). // e p, respectvely, where the d s and e s are nonnegatve exponents. Then the least common multple of m and n s gven by the formula Corollary (m, n) [m, n] = mn. //

4. GCD 4 Soluton #3: Usng the dvson algorthm, we fnd that 22140 = 1 13320 + 8820. Ths relaton mples that any common dvsor of 13320 and 22140 and n partcular ther gcd must also be a dvsor of 8820. Sgnfcantly, t also mples that any common dvsor of 8820 and 13320 and n partcular ther gcd s a common dvsor of of 13320 and 22140. It follows that (8820, 13320) (13320, 22140) and (13320, 22140) (8820, 13320). So (13320, 22140) = (8820, 13320). Ths prncple can be codfed n the followng Proposton If m n are postve ntegers and ntegers q, r satsfy m = qn + r, 0 r < n, by the Dvson Algorthm, then (m,n) = (n,r). Proof Easy. // Applyng ths proposton allows us to say that (8820, 13320) = (4500, 8820), snce 4500 s the remander of the dvson of 13320 by

4. GCD 5 8820. We may therefore reduce the sze of the orgnal numbers we are dealng wthout havng yet computed the gcd. Contnung: (13320,22140) = (8820,13320) = (4500,8820) = (4320,4500) = (180,4320) =180 22140 = 1 13320 + 8820 13320 = 1 8820 + 4500 8820 = 1 4500 + 4320 4500 = 1 4320 +180 4320 = 24 180 Note that at each stage, the prevous dvsor becomes the new dvdend and the prevous remander becomes the new dvsor, the dvsons endng when the remander reaches 0. The fnal nonzero remander s the desred gcd. Ths process s called the Eucldean algorthm. (It appears n a slghtly dfferent form Eucld s Elements.) It can be much abbrevated by layng out the computatons n a smple array:

4. GCD 6 22140 13320 1 8820 1 4500 1 4320 1 180 24 The second column holds the nteger quotents ( q ) for the dvsons obtaned when we dvde a number n the frst column ( r ) nto the number above t ( r 1 ). The remander of the dvson ( r +1 ) becomes the subsequent number n the frst column, and so on: r 1 r r +1 Note how much less computaton s requred to fnd the gcd by the Eucldean algorthm than be the frst two methods we consdered! Indeed, the Eucldean algorthm has long been revered for ts remarable smplcty. 0 q

4. GCD 7 Theorem The gcd of the (postve) ntegers m and n s representable as an nteger lnear combnaton of m and n. That s, there exst ntegers x and y so that (m,n) = xm + yn. In fact, (m, n) s the smallest postve nteger lnear combnaton of m and n. Proof We need only prove the fnal statement snce the frst asserton follows from t drectly. Let S be the set of all postve ntegers of the form xm + yn. Clearly, S s non-empty (consder x = 1, y = 0, or x = 0, y = 1), so t has a least element. Call ths number g = x 0 m + y 0 n. Now g s dvsble by every common factor of m and n; n partcular, (m, n) g. So (m, n) g. On the other hand, dvdng m by g yelds a quotent and remander: m = qg + r, 0 r < g. Subttutng for g n ths equaton we obtan m = q(x 0 m+ y 0 n)+ r, or r = (1 qx 0 )m+( qy 0 )n. But ths means ether that r s n S and s smaller than g, whch s mpossble, or that r = 0. Therefore, g m. An entrely smlar argument shows that g n, too. So g s a common dvsor of m and n, whence g (m, n), mplyng that g (m, n). We can then conclude that g = (m, n). // It s possble to extend the Eucldean algorthm slghtly so as to compute the values of x and y for whch (m,n) = xm + yn: Fnd x and y so that (22140, 13320) = 22140x + 13320y.

4. GCD 8 Consder solutons to the equaton r = 22140x + 13320y r x y q 22140 1 0 13320 0 1 1 8820 1 1 1 4500 1 2 1 4320 2 3 1 180 3 5 24 0 We place the trval solutons x = 1, y = 0, and x = 0, y = 1 n the frst two rows of the array (recognzable as the 2 2 dentty matrx), then use the same arthmetc from the nteger dvson of each value of r by the subsequent value to determne the subsequent values of x and y as well (thn elementary row operatons): f the ( 1)st and th rows of the array are determned by equatons r 1 = 22140x 1 +13320y 1 r = 22140x +13320y and r +1 = r 1 q r, then the (+1)st row s

4. GCD 9 determned by subtractng q tmes the th equaton from the ( 1)st: x +1 = x 1 q x, y +1 = y 1 q y. When the array produces the gcd as the last nonzero remander, the row of the array contanng ths gcd also contans the approprate coeffcents that represent t as a lnear combnaton of 22140 and 13320: for nstance, from the above array, we see that 180 = 3 22140+ 5 13320. If the numbers a, b have gcd = 1, we see that they share no common factors besdes 1. Such are numbers are sad to be relatvely prme to each other. Eucld s Lemma If a bc but (a, b) = 1, then a c. Proof Snce (a, b) = 1, we can fnd ntegers x and y so that ax +by = 1. Multplyng through by c gves cax + cby = c, and snce both terms on the left are dvsble by a (the second term because a bc), t follows that a c. //