MathGroup Archive 2004

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

Search the Archive

Re: Bernoulli variables again

  • To: mathgroup at smc.vnet.net
  • Subject: [mg46562] Re: Bernoulli variables again
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Mon, 23 Feb 2004 22:33:44 -0500 (EST)
  • Organization: Universitaet Leipzig
  • References: <c1amhq$3qt$1@smc.vnet.net>
  • Reply-to: kuska at informatik.uni-leipzig.de
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

1 - (1 - (1 - (1 - x1) (1 - x2)) x4) (1 - (1 - (1 - x2) (1 - 
                        x3)) x5)  //. {(1 - a_) :> Not[a], 
      a_*b_ :> And[a, b]} // Simplify

gives

x4 && x1 || x4 && x2 || x5 && x2 || x5 && x3

and you can transform it back replacing Or[] with Plus[]
and And[] with Times[]

Regards
  Jens

JMyers6761 wrote:
> 
> Consider the following expresion where each of the xn are Bernoulli variables:
> 
> 1 - (1 - (1 - (1 - x1) (1 - x2)) x4) (1 - (1 - (1 - x2) (1 - x3)) x5)
> 
> when this expression is Expanded we get:
> 
> x1 x4+x2 x4 - x1 x2 x4 + x2 x5 + x3 x5 - x2 x3 x5 - x1 x2 x4 x5 - x2^2 x4 x5 +
> x1 x2^2 x4 x5 - x1 x3 x4 x5 - x2 x3 x4 x5 + 2 x1 x2 x3 x4 x5 + x2^2 x3 x4 x5 -
> x1 x2^2 x3 x4 x5
> 
> but since a Bernoulli variable, x, can take on only values of 0 or 1 and x^n =
> x this expression is subject to the transformation x^n-> x with the following
> result:
> 
> x1 x4 + x2 x4 - x1 x2 x4 + x2 x5 + x3 x5 - x2 x3 x5 - x2 x4 x5 - x1 x3 x4 x5 +
> x1 x2 x3 x4 x5
> 
> My question is does anyone know how to transform such an unexpanded expression
> without having to first do an Expand? The actual expressions I am dealing with
> have a very large number of fully expanded terms ( > 10^6) and as a result
> Mathematica runs out of memory attemting to Expand the expressions. I know that
> the resulting expressions, after the Bernoulli transformation, if they could be
> expanded, would still be large but the number of terms would be much smaller,
> on the order of 10^3 terms. Does anyone know of a technique that could used to
> transform the unexpanded expression?
> 
> Thank you for your thoughts.
> 
> Al Myers


  • Prev by Date: Re: Bernoulli variable algebra
  • Next by Date: Re: Attributes and behaviors?
  • Previous by thread: Re: Bernoulli variables again
  • Next by thread: i dont understand module.