Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: signs in the mathematica output

  • To: mathgroup at smc.vnet.net
  • Subject: [mg92480] Re: signs in the mathematica output
  • From: "David Park" <djmpark at comcast.net>
  • Date: Wed, 1 Oct 2008 18:32:01 -0400 (EDT)
  • References: <gbulqi$lcr$1@smc.vnet.net>

The handling of signs under simplification is an annoying feature of 
Mathematica.

Sometimes the result might look better if you display in TraditionalForm.

Simplify[(1 - s) (1 - a)]
% // TraditionalForm
(-1 + a) (-1 + s)
(a - 1) (s - 1)

Otherwise you can Map Minus onto the two factors.

Simplify[(1 - s) (1 - a)]
Minus /@ %
(-1 + a) (-1 + s)
(1 - a) (1 - s)

More generally what you have to do is Map Minus at the location of two 
factors. For example if we divide the two factors we could use:

Simplify[(1 - s)/(1 - a)]
MapAt[Minus, %, {{1, 1}, {2}}]
(-1 + s)/(-1 + a)
(1 - s)/(1 - a)

But getting the positions of the two factors and straightening everything up 
can be something of a pain in the neck. Maybe someone else will have a 
better suggestion.


-- 
David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/


"Simone Moriconi" <simone.moriconi at eco.unipmn.it> wrote in message 
news:gbulqi$lcr$1 at smc.vnet.net...
> Hello everybody! I have a problem in using the Mathematica Package which 
> is probably a bit stupid but very annoying when you have long 
> expressions..
>
> When I "FullSimplify" big equations, in the output the negative sign is 
> always put aside i.e. if I do something like:
>
> FullSimplify[(1-s)(1-a)]
>
> I obtain
>
> (-1+s)(-1+a).
>
> Which is very confusing with long and tedius expressions. Does anybody 
> know a way to solve this problem?
>
> Thanks a lot for your help!!
> 



  • Prev by Date: Re: Comparison between Mathematica and other symbolic systems
  • Next by Date: Re: extracting contour points
  • Previous by thread: Re: signs in the mathematica output
  • Next by thread: Re: signs in the mathematica output