Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Simplify and Abs

  • To: mathgroup at smc.vnet.net
  • Subject: [mg54728] Re: Simplify and Abs
  • From: "David W. Cantrell" <DWCantrell at sigmaxi.org>
  • Date: Mon, 28 Feb 2005 03:27:18 -0500 (EST)
  • References: <200502250618.BAA02358@smc.vnet.net> <cvrppa$p00$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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