Page 1 sur 1
lcm(a,b) = (a*b)/gcd(a,b)
Publié : mer. nov. 21, 2018 1:00 am
par compsystems
Hi, BP,
at XCAS
lcm(a,b) ↲ a*b
and the books
lcm(a, b) = (a*b)/gcd(a, b)
Why?
Re: lcm(a,b) = (a*b)/gcd(a,b)
Publié : mer. nov. 21, 2018 6:56 am
par parisse
lcm(a,b) does not return a*b.
Try lcm(6,4) for example
Re: lcm(a,b) = (a*b)/gcd(a,b)
Publié : mer. nov. 21, 2018 1:22 pm
par compsystems
numerically if it returns the correct value, symbolically not.
assume(a, symbol):; assume(b, symbol):; [↲]
gcd(a, b) [↲] 1 ↦ (a* b)/lcm(a, b)
Re: lcm(a,b) = (a*b)/gcd(a,b)
Publié : mer. nov. 21, 2018 2:37 pm
par parisse
a and b are considered as polynomials, since they are prime together lcm(a,b) is a*b.
Re: lcm(a,b) = (a*b)/gcd(a,b)
Publié : mer. nov. 21, 2018 3:44 pm
par compsystems
ok ^
lcm(a*x^0,b*x^0) [↲] a*b
but, you can add a new rule, if the user defines the following
assume(a,integer);additionally(a>0); assume(b,integer);additionally(b>0);
lcm(a,b) [↲] '(a* b)/gcd(a, b)'
Just remember the "formula" of this function. similarly to
abs(a+b*i) [↲] sqrt(a^2+b^2)
unitV(a+b*i) [↲] (a+b*i)/(sqrt(a^2+b^2))
Re: lcm(a,b) = (a*b)/gcd(a,b)
Publié : mer. nov. 21, 2018 6:04 pm
par parisse
a and b are considered as multivariate polynomials (with respect to variables [a,b]).
There is no "rule" in lcm, lcm is a polynomial instruction (like gcd).