[Date Index]
[Thread Index]
[Author Index]
Re: canonical mathematical expression represenation?
*To*: mathgroup at smc.vnet.net
*Subject*: [mg52522] Re: canonical mathematical expression represenation?
*From*: David Bailey <dave at Remove_Thisdbailey.co.uk>
*Date*: Wed, 1 Dec 2004 05:57:35 -0500 (EST)
*References*: <coefjk$rf3$1@smc.vnet.net>
*Sender*: owner-wri-mathgroup at wolfram.com
nospam nospam wrote:
> I noticed that Mathematica represents expressions with
> some specific 'way' or order.
>
> For example,
>
> Sum[a^k, {k, 0, M}]
>
> gives
> -1 + a^(1+M)
> -------------
> -1 + a
>
>
> How can I make it display the expression, in what I would consider
> a more 'natural' way, as follows
>
> 1 - a^(1+M)
> -------------
> 1 - a
>
> I am sure there is a way to do, and why do you think
> Mathematica does it the way it does? what is the logic
> of how it represents things? is there a command to convert
> the first output to the second? I tried few commands, but
> can not figure it out.
>
> thank you,
> --nospam
>
Hi,
Using //TraditionalForm often helps, but be careful if you are in the
habit of editing output cells to create new inputs - TraditionalForm can
be a bit troublesome if you do this.
I think what you are really asking, is why does Mathematica reduce
expressions to a canonical form. I think there are at least two reasons
for this:
1) It is more efficient when manipulating expressions because it reduces
the number of trivial ways in which two expressions can appear to differ.
2) Mathematica always has a go at evaluating an expression - even if it
ends up looking the same. Clearly it could be designed to return an
expression unchanged if it could not evaluate it significantly, but that
would probably turn out very inconsistent, for example:
a^2+a+1
would not evaluate further, but
a^2+a+1+1
would evaluate further and so would come back in a different order!
Expressions wrapped in Hold don't get rearranged, of course, but they
don't undergo mathematics either!
David Bailey
Prev by Date:
**Re: use of orderless**
Next by Date:
**Re: New User - Programming**
Previous by thread:
**Re: Re: canonical mathematical expression represenation?**
Next by thread:
**Re: Re: canonical mathematical expression represenation?**
| |