Prev: Findroot
Next: Styling print output
From: Artur on 16 Mar 2010 05:49 Dear Mathematica Gurus. Who know how force simplification of polynomials (x^n - 1)/(x - 1)] by Mathematica Table[FullSimplify[(x^n - 1)/(x - 1)], {n, 1, 10}] Above eliminate denominator only in first 5 n Any idea ? Best wishes Artur
From: Bob Hanlon on 16 Mar 2010 07:02 The fractions are simpler for larger n so you cannot use only FullSimplify to eliminate the fractions. Table[ (x^n - 1)/(x - 1), {n, 1, 10}] {1, (x^2 - 1)/(x - 1), (x^3 - 1)/(x - 1), (x^4 - 1)/ (x - 1), (x^5 - 1)/(x - 1), (x^6 - 1)/(x - 1), (x^7 - 1)/ (x - 1), (x^8 - 1)/(x - 1), (x^9 - 1)/(x - 1), (x^10 - 1)/ (x - 1)} LeafCount /@ % {1,11,11,11,11,11,11,11,11,11} Table[ FullSimplify[ (x^n - 1)/(x - 1)], {n, 1, 10}] {1, x + 1, x^2 + x + 1, (x + 1)*(x^2 + 1), x^4 + x^3 + x^2 + x + 1, (x^6 - 1)/(x - 1), (x^7 - 1)/(x - 1), (x^8 - 1)/ (x - 1), (x^9 - 1)/(x - 1), (x^10 - 1)/(x - 1)} LeafCount /@ % {1,3,6,9,12,11,11,11,11,11} soln = Table[ FullSimplify[ Together[ (x^n - 1)/(x - 1)]], {n, 1, 10}] {1, x + 1, x^2 + x + 1, (x + 1)*(x^2 + 1), x^4 + x^3 + x^2 + x + 1, x^5 + x^4 + x^3 + x^2 + x + 1, x^6 + x^5 + x^4 + x^3 + x^2 + x + 1, (x + 1)*(x^2 + 1)*(x^4 + 1), (x^2 + x + 1)*(x^6 + x^3 + 1), x*(x^2 + x + 1)*(x^6 + x^3 + 1) + 1} LeafCount /@ % {1,3,6,9,12,15,18,14,15,18} Bob Hanlon ---- Artur <grafix(a)csl.pl> wrote: ============= Dear Mathematica Gurus. Who know how force simplification of polynomials (x^n - 1)/(x - 1)] by Mathematica Table[FullSimplify[(x^n - 1)/(x - 1)], {n, 1, 10}] Above eliminate denominator only in first 5 n Any idea ? Best wishes Artur
From: Murray Eisenberg on 17 Mar 2010 05:37 It depends on what form you want for the quotients. Two ways are: Table[Expand[Factor[(x^n - 1)/(x - 1)]], {n, 1, 10}] Table[Factor[(x^n - 1)/(x - 1)], {n, 1, 10}] On 3/16/2010 5:44 AM, Artur wrote: > Dear Mathematica Gurus. > Who know how force simplification of polynomials (x^n - 1)/(x - 1)] by > Mathematica > Table[FullSimplify[(x^n - 1)/(x - 1)], {n, 1, 10}] > Above eliminate denominator only in first 5 n > Any idea ? > Best wishes > Artur > -- Murray Eisenberg murray(a)math.umass.edu Mathematics & Statistics Dept. Lederle Graduate Research Tower phone 413 549-1020 (H) University of Massachusetts 413 545-2859 (W) 710 North Pleasant Street fax 413 545-1801 Amherst, MA 01003-9305
From: dh on 17 Mar 2010 05:39 Hi Arthur, it depends on what is considered "simplier". The main factor is the LeafCount as you may see from the following.: {FullSimplify[#], LeafCount[Table[x^i, {i, 0, n - 1}]], LeafCount[#]} & [(x^n - 1)/(x - 1)], {n, 1, 10}] // TableForm Other factors must be taken into account as n=5 shows. Daniel On 16.03.2010 10:49, Artur wrote: > Dear Mathematica Gurus. > Who know how force simplification of polynomials (x^n - 1)/(x - 1)] by > Mathematica > Table[FullSimplify[(x^n - 1)/(x - 1)], {n, 1, 10}] > Above eliminate denominator only in first 5 n > Any idea ? > Best wishes > Artur > -- Daniel Huber Metrohm Ltd. Oberdorfstr. 68 CH-9100 Herisau Tel. +41 71 353 8585, Fax +41 71 353 8907 E-Mail:<mailto:dh(a)metrohm.com> Internet:<http://www.metrohm.com>
From: Alexander Elkins on 17 Mar 2010 05:42
"Artur" <grafix(a)csl.pl> wrote in message news:hnnk72$ckb$1(a)smc.vnet.net... > Dear Mathematica Gurus. > Who know how force simplification of polynomials (x^n - 1)/(x - 1)] by > Mathematica > Table[FullSimplify[(x^n - 1)/(x - 1)], {n, 1, 10}] > Above eliminate denominator only in first 5 n > Any idea ? > Best wishes > Artur > Here is a general solution to what you appear to be seeking to obtain that does not use FullSimplify: In[1]:= Column[Table[PolynomialQuotient[#1,#2,#3]+PolynomialRemainder[#1,#2,#3]/#2,{ n,1,10}]&[x^n-1,x-1,x]] Out[1]= 1 1+x 1+x+x^2 1+x+x^2+x^3 1+x+x^2+x^3+x^4 1+x+x^2+x^3+x^4+x^5 1+x+x^2+x^3+x^4+x^5+x^6 1+x+x^2+x^3+x^4+x^5+x^6+x^7 1+x+x^2+x^3+x^4+x^5+x^6+x^7+x^8 1+x+x^2+x^3+x^4+x^5+x^6+x^7+x^8+x^9 Of course for x^n-1 with n > 1 && Element[n, Integers] the PolynomialRemainder[x^n-1,x-1,x] is always zero so you can also simplify your particular example just using Factor: In[2]:= Column[Table[Factor[x^n-1]/(x-1),{n,1,10}]] Out[2]= 1 1+x 1+x+x^2 (1+x) (1+x^2) 1+x+x^2+x^3+x^4 (1+x) (1-x+x^2) (1+x+x^2) 1+x+x^2+x^3+x^4+x^5+x^6 (1+x) (1+x^2) (1+x^4) (1+x+x^2) (1+x^3+x^6) (1+x) (1-x+x^2-x^3+x^4) (1+x+x^2+x^3+x^4) Perhaps you will also notice that the factors are the same as the cyclotomic polynomials of all of the factors on n, so that for x^n-1 with n > 1 && Element[n, Integers] the following is true: In[3]:= Table[Factor[x^n-1],{n,1,10}]==Table[Times@@Cyclotomic[Times@@@Tuples[Union[ #1^Range[0,#2]]&@@@FactorInteger[n]],x],{n,1,10}] Out[3]= True Union is used only to handle the special case of 1^Range[0,1] which produces {{1, 1}} instead of the desired {{1}} Note that x - 1 == Cyclotomic[1, x]. Hope this helps... |