Re: silly questions?
- To: mathgroup at smc.vnet.net
- Subject: [mg59090] Re: [mg59052] silly questions?
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Thu, 28 Jul 2005 02:27:51 -0400 (EDT)
- References: <200507270526.BAA20063@smc.vnet.net> <43FD46F5-2F57-4927-B593-E6F118A539A0@mimuw.edu.pl>
- Sender: owner-wri-mathgroup at wolfram.com
On 27 Jul 2005, at 20:37, Andrzej Kozlowski wrote:
>
>
> On 27 Jul 2005, at 07:26, Kent Holing wrote:
>
>
>> Why does not (x^5-32)/(x-2)//FullSimplify in Mathematica work?
>> Compare with Factor[x^5-32]//InputForm which returns (-2 + x)*(16
>> + 8*x + 4*x^2 + 2*x^3 + x^4).
>> So why does not the first command just return 16 + 8*x + 4*x^2 +
>> 2*x^3 + x^4?
>> As in a factorization above, how is the easiest way to pick
>> automatically (by a function) the factors of say degree >=2, if
>> any ?
>>
>> Kent Holing
>>
>>
>>
>
> Very "simple". What makes you think the cancelled out form is
> "simpler"?
>
>
> LeafCount[(x^5-32)/(x-2)]
>
>
> 11
>
> while
>
>
> LeafCount[Cancel[(x^5-32)/(x-2)]]
>
>
> 18
>
> The cancelled form is much more "complicated", at least as measured
> by LeafCount (and Mathematica's default complexity function).
>
> So if you want your answer it is better to make ask Mathematica to
> make the expression more "complex":
>
>
> Simplify[(x^5 - 32)/(x - 2), ComplexityFunction ->
> (1/LeafCount[#1] & )]
>
>
> x^4 + 2*x^3 + 4*x^2 + 8*x + 16
>
> But it is of course much more sensible to just use Cancel.
>
> Andrzej Kozlowski
>
>
>
>
Sorry, I forgot about your second question:
Select[First[Transpose[FactorList[x^5 - 32]]],
Exponent[#1, x] >= 2 & ]
{x^4 + 2*x^3 + 4*x^2 + 8*x + 16}
Andrzej Kozlowski
- References:
- silly questions?
- From: Kent Holing <KHO@statoil.com>
- silly questions?