1
   

Problem with loops in Mathematica

 
 
krulf
 
Reply Tue 27 Jul, 2004 06:42 am
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?
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 1 • Views: 518 • Replies: 1
No top replies

 
muddierwaters
 
  1  
Reply Wed 28 Jul, 2004 04:51 pm
try doing it the old fasioined way... write your own program!
0 Replies
 
 

Related Topics

Evolution 101 - Discussion by gungasnake
Typing Equations on a PC - Discussion by Brandon9000
The Future of Artificial Intelligence - Discussion by Brandon9000
The well known Mind vs Brain. - Discussion by crayon851
Scientists Offer Proof of 'Dark Matter' - Discussion by oralloy
Blue Saturn - Discussion by oralloy
Bald Eagle-DDT Myth Still Flying High - Discussion by gungasnake
DDT: A Weapon of Mass Survival - Discussion by gungasnake
 
  1. Forums
  2. » Problem with loops in Mathematica
Copyright © 2025 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 01/17/2025 at 01:31:47