MathGroup Archive 1996

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

Search the Archive

Re: substitution rules and patterns

  • To: mathgroup at smc.vnet.net
  • Subject: [mg3417] Re: [mg3410] substitution rules and patterns
  • From: jpk at apex.mpe.FTA-Berlin.de (Jens-Peer Kuska)
  • Date: Wed, 6 Mar 1996 01:45:48 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Susan, Yes ..
> 
> Could someone tell me why the first substitution rule
> works and the second doesn't----
> 
> In[70]:= (c^2)^(d/2)/.{(a_^2)^(b_ /2)->a^b}
Here we have

Power[
  Power[c,2],
  Times[
    d,
    Power[2,-1]
   ]
 ]

as in Your Patten
> 
> Out[70]= c^d
> 
> 
> 
> In[71]:= (c^2)^(5/2)/.{(a_^2)^(b_ /2)->a^b}
Here we have

Power[
  Power[c,2],
  Rational[5,2]
 ]

as You see the two expressions are completly different, and
the pattern b_/2 will not match Rational[5,2].

If You are not shure with the pattern look allways to
the FullForm of Your expression.

Hope that helps
Jens

 
 


==== [MESSAGE SEPARATOR] ====


  • Prev by Date: FindRoot output format
  • Next by Date: Re: Slow ReIm
  • Previous by thread: Re: substitution rules and patterns
  • Next by thread: Re: substitution rules and patterns