MathGroup Archive 2010

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

Search the Archive

Re: Question about exponent

  • To: mathgroup at smc.vnet.net
  • Subject: [mg115060] Re: Question about exponent
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Thu, 30 Dec 2010 04:08:55 -0500 (EST)

expr1 = 1 - (1 - x)^2 (1 - y)^3;

expr2 = ToString[expr1 /. (1 - z_)^n_ :>
    (StringJoin @@ 
      Table["(" <> ToString[1 - z] <> ")", {n}])]

"1 - (1 - x)(1 - x) (1 - y)(1 - y)(1 - y)"

expr1 == (expr2 // ToExpression)

True


Bob Hanlon

---- Maria Davis <arbiadr at gmail.com> wrote: 

=============
Hi Mathematica Community,

How can I convert the expression:
1- (1-x)=B2 (1-y)=B3
to the expression:
1- (1-x)(1-x) (1-y)(1-y)(1-y)

Thank you



  • Prev by Date: Re: Mathematica daily WTF
  • Next by Date: Changing the TraditionalForm Output Font
  • Previous by thread: Question about exponent
  • Next by thread: Digital Events in Wolfram Alpha