Problem with loops in Mathematica

*To*: mathgroup at smc.vnet.net*Subject*: [mg49693] Problem with loops in Mathematica*From*: kristofer_eklundh at spray.se (Kristofer Eklundh)*Date*: Thu, 29 Jul 2004 07:42:57 -0400 (EDT)*Sender*: owner-wri-mathgroup at wolfram.com

Hi all, I am trying to work out the value of S at different nodes in a binomial tree, using the following formula: Table[S u^j d^(n - j) p^j q^(n - j), {j, 0, n}] I would like to loop this in some way so that I don't have to assign new values to n all the time (S, d, p, q are given). I have tried For and Do, but when i print the result, Mathematica produces n lists that are equal to the final value of n, and not for n=0,1,..., n-1. Anyone who could help me with this?

**Follow-Ups**:**Re: Problem with loops in Mathematica***From:*DrBob <drbob@bigfoot.com>