Least common multiple (LCM)


We normally learned this for real in primary school which is remember in the name of ค.ร.น. . For polynomial mathematic, Maple provides one function called ‘lcm’. To see how it work see the following example.

2x^2-yx-y^2 = (x-y)(y+2x)
2x^2+3yx+y^2 = (y+x)(y+2x)

In Maple you can say

f1:= 2*x^2-y*x-y^2:
f2:= 2*x^2+3*y*x+y^2:
factor(f1);
                (x-y)(y+2x)
factor(f2);
                (y+x)(y+2x)

to get the answer.

Find the LCM

f3:=lcm(f1,f2);
                (x-y)(2x^2+3yx+y^2)

You can see that the second part is just  f2 and you can see now why f3 is the LCM.

In OrePolynomial case the thing is more difficult, since

\dfrac{b}{a}\cdot\dfrac{d}{c} = \dfrac{\alpha_1d}{\beta_2a}

In this case \alpha_1 = LCM(b,c)/b and \beta_2 = LCM(b,c)/c. The Maple code is shown below.

with(OreTools):

SS:=SetOreRing(t,'defferential'):
f1:= [OrePoly(b),OrePoly(a)]:
f2:= [OrePoly(d),OrePoly(c)]:
beta := LCM['left'](f1[1],f2[2],SS);
beta2:= Quotient['right'](beta,f1[1],SS);
alpha1:= Quotient['right'](beta,f2[2],SS);
[Multiply(alpha1,f2[1],SS),Multiply(beta2,f1[2],SS)];
Advertisements

6 comments on “Least common multiple (LCM)

  1. Nice post. I was checking constantly this weblog and I’m impressed! Very helpful info particularly the final part 🙂 I handle such info a lot. I was seeking this certain information for a very lengthy time. Thank you and good luck.

  2. I do not know if it’s just me or if perhaps everybody else encountering issues with your blog. It seems like some of the written text within your content are running off the screen. Can someone else please provide feedback and let me know if this is happening to them too? This could be a issue with my web browser because I’ve had this happen before.
    Appreciate it

  3. Excellent post. I was checking constantly this blog and I’m impressed! Extremely helpful info specifically the last part 🙂 I care for such information a lot. I was looking for this certain information for a very long time. Thank you and best of luck.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s