MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Simplify and Abs


Murray Eisenberg <murray at math.umass.edu> wrote:
> Strangely, though, the docs for version 5.1 say:
>
>    FunctionExpand is automatically called by FullSimplify

Similarly, Refine is automatically called by Simplify. And, as I already
pointed out, when specifically used, Refine also yields 1-p.

Perhaps what seems strange is that neither Simplify nor FullSimplify yields
1-p in this problem. But that behavior is understandable when one realizes
that LeafCount[1-p] is 5, its FullForm being Plus[1, Times[-1, p]], whereas
LeafCount[Abs[p-1]] is only 4.

Does anyone have a clever way to make Mathematica treat both p-1 and 1-p
as though they had LeafCount = 3 when simplifying?

By the way, this discussion brings to light another way to solve the
problem: Just write "one" instead of "1"!

In[3]:= Simplify[Abs[p - one], p < one && p > 1/2]

Out[3]= one - p

David Cantrell


> Bob Hanlon wrote:
> > FunctionExpand[Abs[p-1],p<1&&p>1/2]
> >
> > 1-p
> >
> >>From: Simon Anders <simon.anders at uibk.ac.at>
To: mathgroup at smc.vnet.net
> >
> >>Date: 2005/02/24 Thu AM 03:21:06 EST
> >>Subject: [mg54728]  Simplify and Abs
> >>
> >>can it really be that this is already beyond Mathematica?
> >>
> >>    In :=  FullSimplify[Abs[p - 1], p < 1 && p > 1/2]
> >>
> >>    Out := Abs[-1 + p]


  • Prev by Date: Re: Construcing correlation matrix from time-ordered list
  • Next by Date: Re: Construcing correlation matrix from time-ordered list
  • Previous by thread: Re: Re: Re: Simplify and Abs
  • Next by thread: Re: Simplify and Abs