2

Okay I am weak in mathematics, I have no shame in saying that.

I am preparing for my internals and the concept of the GCD and LCM is quite confusing to me.

There is this question which is:

Find the largest 4 digit number that is exactly divisible by 12,15,18 and 27.

The solution is by finding out the LCM of these numbers. I mean why ?

Why is it not GCD? What is the difference between GCD and LCM?

I would really appreciate someone expalining it thoroughly. Please try to help me with this.

Thank you.

nban
  • 39
  • 2
    Any integer divisible by those four is divisible by their LCM, so that's a useful concept here. But you don't need to follow that route. You could just work from the prime factorization. Since $(12,15,18,27)=(2^2\times 3, 3\times 5, 2\times 3^2,3^3)$ you know that any number divisible by each is divisible by $2^2\times 3^3\times 5=540$ (this is the LCM, by the way). – lulu Sep 02 '17 at 21:05
  • 1
    then you find the largest four-digit number that is a multiple of 540. – Steven Alexis Gregory Sep 02 '17 at 21:07
  • But why dont we find the GCD ? I dont understand the concept – nban Sep 02 '17 at 21:08
  • Hint $\ ,a,b,c,d\mid n\iff {\rm lcm}(a,b,c,d)\mid n\ \ \ $ That is the "concept" of LCM. – Bill Dubuque Sep 02 '17 at 21:21
  • 2
    The greatest common denominator here is $3$. Knowing that something is divisible by $3$ however doesn't tell us anything about whether or not it is divisible by any or all of $12,15,18,27$. Knowing that something is divisible by $540$ on the other hand does tell us that it is divisible by all of $12,15,18,27$. – JMoravitz Sep 02 '17 at 22:09

2 Answers2

1

You want a number that is divisible by all of $( 12,15,18, 27)$, which means that your target number $N$ must be a multiple of each of those.

In order to be a multiple of all of those, it will also need to be a multiple of their least common multiple (which is perhaps less obvious). Basically the multiples align at zero, then align again each time another "LCM" has been accumulated. For this case, we need the greatest multiple of the LCM which is still less than $10000$, which is not hard once you have determined the LCM.

The greatest common divisor is less than (or equal to) all the numbers being considered, and to find other numbers that divide every one of a set of numbers you would need the divisors of the GCD.

The LCM and GCD are related when you are just referring to two numbers, $a,b$, by $\text{lcm}(a,b)\cdot \gcd(a,b) = ab$ - all the factors of the numbers which are excluded from the GCD must be included in the LCM.

Joffan
  • 39,627
  • 1
    So can I say that when I need a number that is divisible by a set of numbers I need to find LCM, and when I want to divide all the number in that set I need to find GCD ? – nban Sep 02 '17 at 21:27
  • 1
    @nban More precisely, this is what you should say (e.g. for a set of three integers) $$\begin{align} a,b,c\mid n&\iff {\rm lcm}(a,b,c)\mid n\[.2em] n\mid a,b,c &\iff n\mid \gcd(a,b,c) \end{align}$$ Those are actually the definition of lcm and gcd for more general number systems. – Bill Dubuque Sep 02 '17 at 21:29
  • So this is like, find a number that is divisible by three numbers (LCM) and find a number that divides all three numbers (GCD) ? – nban Sep 02 '17 at 21:35
  • @nban Compare to the following universal definitions of union and intersection of sets

    $$\begin{align} A,B,C \subset S &\iff A\cup B\cup C \subset S\ S \subset A,B,C &\iff S\subset A\cap B\cap C\end{align}$$

    – Bill Dubuque Sep 02 '17 at 21:37
  • @nban yes I think you understand it now. Bill's terminology is useful too; "$a\mid b$" means just "$a$ divides $b$", which is equivalent to "$b$ is a multiple of $a$". – Joffan Sep 02 '17 at 21:56
  • 1
    @nban Let's consider the above analogy with sets. The set union allows us to replace many common containments $,A\subset S,\ B\subset S,\ C\subset S,$ by one equivalent containment $ A\cup B\cup C\subset S.,$ Similarly, LCM replaces many common multiples $, a\mid n,\ b\mid n,\ c\mid n,$ by one equivalent multiple $,{\rm lcm}(a,b,c)\mid n,$ statement. You should commit the above equvalences to memory since they are ubiquitous. Then you can easily apply them as rewrite rules whenever need be. – Bill Dubuque Sep 02 '17 at 22:02
  • So if there be a question, find the largest 3 digit number that is divisible by say 12,15,18 and 27 the answer would be 865? – nban Sep 02 '17 at 22:06
  • @nban By above we know $,12,15,18,27\mid n\iff {\rm lcm}(12,15,18,27)\mid n$ is true for all $n$. So after computing the lcm we have simplified the original four "multiple* statements to one "multiple" statement. The rest follows easily. – Bill Dubuque Sep 02 '17 at 22:09
  • @nban 865 is not even and therefore is not divisible by $12$ or $18$. As mentioned earlier, the LCM of $12,15,18,27$ is $540$ so the set of numbers divisible by all of $12,15,18,27$ is ${540,1080,1620,2160,\dots}$, the only one of which that is a three digit number is $540$ – JMoravitz Sep 02 '17 at 22:15
  • Okay, there is this question that find the least number which can be divided by 20,25,35 and 40 that leaves a remainder 14,19,29,34 respectively. The solution is with LCM which i understand now, but in the later steps, it is: (20-14)=6, (25-19)=6,(35-29)=6,(40-34)=6. Therefore required number is LCM of(20,25,35,40)-6 = 1396. I dont understand this! Why did they take the difference and then why did the subtract it ? – nban Sep 02 '17 at 22:16
  • @nban $\ 20,25,35,40\mid x!+!6\iff 1400={\rm lcm}(20,25,35,40)\mid x!+!6$ or, equivalently $,x\equiv -6\equiv 1394\pmod{1400}\ \ $ – Bill Dubuque Sep 02 '17 at 22:19
  • @nban if you add $6$ to each of the remainders you get an exact division of each divisor. In general though that could be a modular arithmetic congruence problem requiring a lot more work to find out where in the LCM interval the correct answer sits (if anywhere) – Joffan Sep 02 '17 at 22:21
  • Please explain in some simple words, I mean like the number is 1394, now what it implies ? If i divide this number from any set then what should happen ? How will 1394 give a remainder of 6 when divided by 20? it gives 16 :( – nban Sep 02 '17 at 22:21
  • @nban The problem exploits a CRT optimization: note that each of the remainders is equivalent to $,-6,$ i.e. $,14\equiv -6\pmod{20},\ 19\equiv -6\pmod{25},\ldots$ so the system is equivalent to $,x\equiv -6$ for all moduli. This constant case CRT is easily solvable by LCM (follow the link to learn more). – Bill Dubuque Sep 02 '17 at 22:30
  • Okay, I understand now, again there is this question The traffic lights at three different road crossings change after every 48 sec, 72 sec, and 108 sec respectively. If they all change simultaneously at 8:20:00hours, then at what time will they change again simultaneously? okay seriously how would someone even guess we have to do this by LCM GCD method ? :( – nban Sep 02 '17 at 22:38
  • @nban If you are stuck then you should ask another question, after explaining what you tried and where the difficulty lies. Comments are not meant for new questions. – Bill Dubuque Sep 02 '17 at 22:40
  • Okay, I have posted it. https://math.stackexchange.com/questions/2414760/relevancy-to-gcd-and-lcm – nban Sep 02 '17 at 22:44
0

"Find the largest $4$ digit number that is exactly divisible by $12,15,18$ and $27$."

If all those number divide into that 4-digit number than that 4-digit number is a multiple of all those numbers.

So the 4-digit number is a common multiple of all of those.

"The solution is by finding out the LCM of these numbers. I mean why ?"

Well, we don't have to find the least common multiple but we have to find a common multiple. And if we can find the least common multiple that will give us all the infinite number of common multiples by multiply the least common multiple by every possible positive integer.

The question is asking us to find the greatest common multiple that is less than or equal to $9999$. We do that be finding the least common multiple and adding that and adding that until we get the largest possible value less than or equal to $9999$.

"Why is it not GCD? What is the difference between GCD and LCM?"

Because GCD is the "greatest common divisor". It is a number (in this case $3$) that divides into each of the $12,$15,$18$ and $27$. The least common multiple is a number that all the numbers that $12$, $15$, $18$, and $27$ themselves divide into; not what divides into them.

For example $12 $ divides into $24$, $36$, $48$ .etc. But $15$ divides into $30$, $45$ and $60$. The smallest number that both $12$ and $15$ divide into is $60$. But $18$ and $27$ do not divide into $60$. The all divide into $12*15*18*27 = 87480$ that that probably isn't the smallest number they all divide into. Do you know what is. (And if you can find the largest common multiple that is four digits, you have solved the question.)

On the other hand the GCD isn't a number they divide into; it is a number that divides into *them. $6$ divides into $12$ and $18$ but not $15$ or $27$. $9$ divides into $18$ and $27$ but not $12$ and $15$. But $3$ divides into all $4$. Is it the greatest common divisor? Well, yes it is.

====

Remember $12,15$

$n$= LCM = least common MULTIPLE. $12$ and $15$ go into $n$. So it is $60$ that they go into. $12$ and $15$ go into $60$.

$m$ = GCD = greatest common DIVISOR. $m$ goes into $12$ and $15$. So it is $3$ that goes into them. $3$ goes into $12$ and $15$.

fleablood
  • 124,253