Skip to content
← All questions

Why can gcd⁡(a,b)\gcd(a,b) be written as gcd⁡(∣a∣,∣b∣)\gcd(|a|,|b|)?

The greatest common divisor is defined as the maximum of the common positive divisors. Changing the sign of the inputs does not alter the set of their common positive divisors, so taking the absolute values preserves the greatest common divisor. This allows the computation to be reduced to the non-negative case.

Conditions

  • Integers aa and bb are not both zero.
  • The greatest common divisor is treated as a positive integer.

Reasoning, step by step

  1. Recall that gcd⁡(a,b)\gcd(a,b) is the maximum positive integer dividing both aa and bb.
  2. Observe that if kk divides aa, it also divides −a-a.
  3. Conclude that the set of common positive divisors of aa and bb is identical to that of ∣a∣|a| and ∣b∣|b|.
  4. Therefore, gcd⁡(a,b)=gcd⁡(∣a∣,∣b∣)\gcd(a,b) = \gcd(|a|,|b|).

Example

The video states gcd⁡(a,b)=gcd⁡(a,−b)=gcd⁡(−a,b)=gcd⁡(−a,−b)=gcd⁡(∣a∣,∣b∣)\gcd(a,b) = \gcd(a,-b) = \gcd(-a,b) = \gcd(-a,-b) = \gcd(|a|,|b|), showing that signs do not affect the greatest common divisor.

Common misconceptions

  • Believing that negative inputs change the value of the greatest common divisor.
  • Confusing the greatest common divisor with the least common multiple, which also handles signs differently.

Watch the explanation

Connected concepts

Explore next

Related questions

Meet the concept

↗
Find a method

↗
Find a method

↗
Find a method

↗
Meet the concept

↗

Answers are generated from source material and independently checked. Consult the original video or creator if something is unclear.