Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

ReplaceList and //.

  • To: mathgroup at
  • Subject: [mg73569] ReplaceList and //.
  • From: Mr Ajit Sen <senra99 at>
  • Date: Thu, 22 Feb 2007 04:29:16 -0500 (EST)

Dear Mathgroup,

 Could someone please enlighten me as to when I should
use  ReplaceList and when to use //.  in pattern

  Thus, if  Y = a x^2/b^3,  then

   ReplaceList[Y, a^m_. x^n_. b^p_. :> z 
    b^(p + 1) a^(m - 1) x^(n - 1)][[1]]

 as well as 
  Y //. a^m_. x^n_. b^p_. :> z b^(p + 1) a^(m - 1)
x^(n - 1)
give the same result.


     ReplaceList[a*b*c, {(x_)*(y_) -> x^y, (x_)*(y_)
-> x + y}]

      a*b*c //. {(x_)*(y_) :> x^y, (x_y)*_ :> x + y}

  yield different outputs.

 What am I missing here?

  Thanks in advance.

  Ajit Sen.

What kind of emailer are you? Find out today - get a free analysis of your email personality. Take the quiz at the Yahoo! Mail Championship.* 

  • Prev by Date: Re: Map function which adds last two numbers of a list
  • Next by Date: Re: Showing that ArcSinh[2]/ArcCsch[2] is 3?
  • Previous by thread: Re: Roman Numerals
  • Next by thread: Re: ReplaceList and //.