Re: Evaluation and replacement?
- To: mathgroup at smc.vnet.net
- Subject: [mg42730] Re: Evaluation and replacement?
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Wed, 23 Jul 2003 00:25:23 -0400 (EDT)
- Organization: The University of Western Australia
- References: <beln4d$gm0$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <beln4d$gm0$1 at smc.vnet.net>,
"AngleWyrm" <no_spam_anglewyrm at hotmail.com> wrote:
> Given a quantity 20m, and a rule 10m->9m+n, how can I get the result 18m+2n?
>
> ( m doesn't equal n; 10m degenerates into 9m + n. 9m doesn't degenerate into
> 8m+n.)
Generalizing your question slightly (replacing the m on the left-hand
side m^2), here is a simple and general way to achieve what you want:
Last[PolynomialReduce[20 m^2, {10 m^2 - (9m + n)}, {m, n}]]
18 m + 2 n
Cheers,
Paul
--
Paul Abbott Phone: +61 8 9380 2734
School of Physics, M013 Fax: +61 8 9380 1014
The University of Western Australia (CRICOS Provider No 00126G)
35 Stirling Highway
Crawley WA 6009 mailto:paul at physics.uwa.edu.au
AUSTRALIA http://physics.uwa.edu.au/~paul