Mathematica 9 is now available
Student Support Forum
Student Support Forum > General > > "List"

Post Reply:
Email Address:

Please send email when my message is replied to.

Url (optional):
Message: view original message?
Attachment (optional):
Please answer this:2+3 =

Original Message (ID '180541') By Student0002012:
Dear sir, i'm ashamed to ask you again, but you are the only one who responded with good and quick answers! The task i had to solve is: How often (in 100 times) will be the person solvent after 10 years? I'm done, but i need to make the mathematica "code" as short as possible, so i have to use loops. Everything worked perfect and the literature helped me aswell! But the loop doesn't work properly... Do[pension = pension*(Risky* Exp[mu + sigma*RandomReal[NormalDistribution[0, 1]]] + Riskless*Exp[riskfree]) - draw, {10}] Count[{Table[pension, {100}]}, _?NonNegative, 2]/100 // N If i let mathematica loop this 10 years it gives me the solution, but if i let mathematica count 100 solutions it only uses 1 solution and doesn't compute it 100 different times.... And ":=" doesn't work in this loop!