Introduction to Algorithms
Introduction to Algorithms
3rd Edition
ISBN: 9780262033848
Author: Thomas H. Cormen, Ronald L. Rivest, Charles E. Leiserson, Clifford Stein
Publisher: MIT Press
bartleby

Concept explainers

Question
Book Icon
Chapter 31.1, Problem 10E
Program Plan Intro

To prove that for all the integers a,bandc,

  gcd(a,gcd(b,c))=gcd(gcd(a,b),c) and hence to show that the gcd operator is associative.

Expert Solution & Answer
Check Mark

Explanation of Solution

Assume

  d=gcd(a,b,c),a=dp,b=dpandc=dr.

Claim gcd(a,gcd(b,c))=d

Let e=gcd(b,c)

  b=es,c=et

Since d|bandd|c,thusd|e.

Let e=dm, thus

  b=(dm)s=sq,c=(dm)t=dr.

Assume k=gcd(p,m),

  k|p,k|m,dk|dp,dk|dm,dk|dp,dk|(dm)s,dk|(dm)t,dk|a,dk|b,dk|c.

Since d=gcd(a,b,c),thusk=1.

  gcd(a,gcd(b,c))=gcd(a,e)=gcd(dp,dm)=d*gcd(p,m)=d*k=d

Hence,

  gcd(a,gcd(b,c))=d=gcd(gcd(a,b),c).

Want to see more full solutions like this?

Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
For f(a, b) = (a | b) | b (a) Simplify f(a, b). (b) Find DNF for f(a, b). (c) Is f(a, b) satisfiable?
Determine P(A x B) – (A x B) where A = {a} and B = {1, 2}.
Prove that f(x) = x is O(x3).
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education