Re: Bernoulli variable algebra
- To: mathgroup at smc.vnet.net
- Subject: [mg46532] Re: Bernoulli variable algebra
- From: drbob at bigfoot.com (Bobby R. Treat)
- Date: Sun, 22 Feb 2004 11:27:30 -0500 (EST)
- References: <c16m89$5pd$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Oops, I just posted a very incomplete answer; here's a better one. Each Bernoulli variable could be bernoulli[i]. First of all, here's a function that may help, It allows you to make a[i] and Subscript[a,i] synonymous. subFunction[a_Symbol] := Block[{aa = ToString[a]}, MakeExpression[SubscriptBox[ToString[a], i_], f_] := MakeExpression[ RowBox[{ToString[a], "[", i, "]"}]]; MakeBoxes[a[i_], f_] := SubscriptBox[ MakeBoxes[a, f], MakeBoxes[i, f]]] Then enter subFunction[binary] binary[i_]*binary[i_] ^= binary[i]; Unprotect[Power]; binary[i_]^(n_)?Positive := binary[i] Protect[Power]; Expand[(binary[1] + binary[2])^10] binary[1] + binary[2] + 1022*binary[1]*binary[2] You may need to compute intermediate expressions, so that full expansion doesn't occur before any simplifications. For instance: Expand[(binary[1] + binary[2])^100]* Expand[(binary[2] - binary[3])^100] (binary[1] + binary[2] + 1267650600228229401496703205374*binary[1]*binary[2])* (binary[2] + binary[3] - 2*binary[2]*binary[3]) Bobby jmyers6761 at aol.com (JMyers6761) wrote in message news:<c16m89$5pd$1 at smc.vnet.net>... > I have been working on a Mathematica package used to predict the reliability of > complex redundent systems. The calculations, which are done symboliclly, become > quite complex. Since all of the variables used are Bernoulli variables, i.e. > take on only values of 0 or 1, the expressions must be simplified by use of the > rule x_^n_->x. My problem is this, the expressions are complex and large and, > as a result the Mathematica Kernal runs out of memory trying to expand the > expressions. I know, from other techniques, that the resulting expressions > after application of the x_^n_->x rule are still large (> 1000 terms) they are > not unmanageable. (The expressions prior to applying the rule might be on the > order of 10^6 terms) If a technique could be devised for accomplishing the > effect of the above transformation without first requiring the full expansion > of the expressions it would be possible to greatly simplify the required > analysis. Is anyone aware of a technique for the simplification of algebraic > expressions of Bernoulli variables without requiring expansion of the > expression first? > > Any hints would be greatly appreciated. > Thankyou, > Al Myers