- #1
s3a
- 818
- 8
Homework Statement
PROBLEM STATEMENT:
http://dpaste.com/0GN9MQ2
BOOK'S SOLUTION:
http://dpaste.com/0ZQ0YQM
Homework Equations
- m ⋅ u + n ⋅ v = 2ab
- GCD(a,b) ⋅ LCM(a,b) = ab
- z = 2 * LCM(a,b)
- z ?=? (m ⋅ u + n ⋅ v) / GCD(a,b)
The Attempt at a Solution
How does the author go from m ⋅ u + n ⋅ v = 2ab and GCD(a,b) ⋅ LCM(a,b) = ab to z = 2 * LCM(a,b)?
All I can think of is (m ⋅ u + n ⋅ v)/2 = GCD(a,b) ⋅ LCM(a,b) ⇒ (m ⋅ u + n ⋅ v) / GCD(a,b) = 2 ⋅ LCM(a,b). Is z = (m ⋅ u + n ⋅ v) / GCD(a,b)? If so, could someone please elaborate on the book's solution for that part? I don't see how one would go from it either being the case that z = u or that z = v (from the Pascal-style pseudo-code) to it being the case that z = (m ⋅ u + n ⋅ v) / GCD(a,b). Otherwise, if I'm completely off, could someone please just generally clarify how to solve this problem?
I would GREATLY appreciate it if someone could help me fully understand the solution to this problem!
P.S.
Also, what's the significance of all this? In other words, in addition to the solving of the problem itself, what's the big-picture takeaway from all this? Like, in simple terms, what was E. Dijkstra's motivation for doing this?