Algebraic problem solved by simulation

• To: mathgroup at smc.vnet.net
• Subject: [mg53604] Algebraic problem solved by simulation
• From: guillerm at aida.usal.es (Guillermo Sanchez)
• Date: Thu, 20 Jan 2005 03:47:44 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```(* Dear group;
Given the equation L1 < a1 X1, ..., an Xn < L2 where {a1, ..an} are
known and {X1, ...Xn} follows a Uniform random  distribution I wish to
find the average and the estandar deviation of X, being X = X1 + ... +
Xn.

For instance, for solving 0.95 < 0.017 X1 + 0.013 X2 + 0.012 X3 < 1.05
I apply this method*)

a = {0.017, 0.013, 0.012};

rr := {Random[Real, {0, 1/0.017}], Random[Real, {0, 1/0.013}],
Random[Real, {0, 1/0.012}]};

eq1 := (X = rr; If[0.95 < a . X < 1.05, Plus @@ X] ) ;

L = Array[eq1 &, 1000] ;

sol1 = Cases[L, x_?NumericQ];

{Mean[sol1], StandardDeviation[sol1]}

(*Can any body find a better method?, In the real problems the size of
{X1, ..., Xn} is too big (1000)

Guillermo*)

```

• Prev by Date: ShowLegend....
• Next by Date: Re: random matrix from row and column sums
• Previous by thread: Re: ShowLegend....
• Next by thread: Re: Algebraic problem solved by simulation