MathGroup Archive 1998

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

Search the Archive

Re: How does a rule get applied?


  • To: mathgroup@smc.vnet.net
  • Subject: [mg12474] Re: How does a rule get applied?
  • From: "Kevin J. McCann" <kevinmccann@erols.com>
  • Date: Tue, 19 May 1998 13:31:40 -0400
  • Organization: Erol's Internet Services
  • References: <6jf2mg$3vl@smc.vnet.net>

A guess is that in your example the (1 + 3) is being evaluated to 4 so
that your rule with the n_ + 1 doesn't work, i.e. there is no pattern
that matches.

Kevin

Yacine Ait-Sahalia wrote in message <6jf2mg$3vl@smc.vnet.net>...
>Hi,
>
>I'm having trouble understanding how rules are applied after /. Consider
>the following example:
>          x^a + x^(1+a)  /. x^(n_) + x^(n_+1) ->0
>          x^3 + x^(1+3)  /. x^(n_) + x^(n_+1) ->0
>          x^3            /. x^(n_) ->0
>
>Out[388]=
>                0
>
>Out[389]=
>                 3    4
>                x  + x
>
>Out[390]=
>                0
>
>
>Could anyone please explain to me why
>
>        x^a + x^(1+a)  /. x^(n_) + x^(n_+1) ->0
>
>returns 0 (as expected), whereas
>
>        x^3 + x^(1+3)  /. x^(n_) + x^(n_+1) ->0
>
>returns
>
>                 3    4
>                x  + x
>
>instead of 0?
>
>Thanks for your help.
>




  • Prev by Date: RE: Pagination problems Mathem
  • Next by Date: HElp on displaying output without the "Prviate`..." message
  • Prev by thread: Re: How does a rule get applied?
  • Next by thread: Re: How does a rule get applied?