To find gcd of negative numbers we can convert it to positive number and then find out the gcd. Will it make any difference?
Greatest common Divisor of negative numbers
15.8k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 3 best solutions below
On
No.
If $\langle a,b\rangle\in\mathbb Z\times\mathbb Z-\{\langle0,0\rangle\}$ then $\gcd\left(a,b\right)$ can be defined as the smallest positive element of set $\left\{ ra+sb\mid r,s\in\mathbb{Z}\right\} $.
Note that this set remains the same if $a$ is replaced by $-a$ and/or $b$ is replaced by $-b$.
On
In the general theory of greatest common divisor we can define an element $d$ to be a greatest common divisor of $a$ and $b$ if
- $d$ divides both $a$ and $b$
- for all $c$, if $c$ divides both $a$ and $b$, then $c$ divides $d$.
If we stick to the natural numbers, we see that a unique greatest common divisor exists for all pairs of numbers.
The situation is more complicated when we try to extend the theory to arbitrary integral domains.
If we go to the integers, there are generally two. For instance, if $a=4$ and $b=6$, both $2$ and $-2$ satisfy the conditions above.
It's even worse in the case of polynomials (say over the reals): if we consider $f(X)=X^2-3X+2$ and $g(X)=X^2-X$, then any polynomial of the form $a(X-1)$ (for a real $a\ne0$) satisfies the conditions for being a greatest common divisor.
What happens is that whenever $d$ is a greatest common divisor of $a$ and $b$ and $u$ is an invertible element, then also $ud$ is a greatest common divisor as well.
It's however easy to show that, in an integral domain, if a greatest common divisor $d$ of $a$ and $b$ exists, then any other is of the form $ud$ for $u$ an invertible element.
In some cases we are able to add a further condition to guarantee uniqueness. For instance, in the integers we can impose that a greatest common divisor should be nonnegative; in the ring of polynomials over the reals (or any field), uniqueness is usually guaranteed by choosing the monic greatest common divisor (with the exception of the greatest common divisor of $0$ and $0$, which is of course $0$).
In the ring of Gaussian integers $\mathbb{Z}[i]$ the invertible elements are $1$, $-1$, $i$ and $-i$ and there's no sensible way to define a greatest common divisor so as to get some uniqueness.
As you see, it's a matter of conventions. It's better if we can add a condition that gives uniqueness, so we can define a bona fide operation, but actually it doesn't really matter from the theoretical point of view.
It will not make any difference if $gcd(a,b) = d$ then $d \mid a$ and $d \mid b$ and if there exists another integer $c \mid a,b$ then $c \mid d$. Now , $d \mid -a,-b$ as well and if $c \mid -a,-b$ then $ c \mid d$ and so $$d = gcd(-a,-b) = gcd(-a,b) = gcd(a,-b) = gcd(a,b)$$