Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'iterative function' topicStudent Support Forum > General > Archives > "iterative function"

Next Comment >Help | Reply To Topic
Author Comment/Response
05/27/13 09:16am

hey everyone. i'm having trouble with an iterative function.

this is it:
f[0, n] = Cos[0.45*Sqrt[n + 1]]^2 + Sin[0.45*Sqrt[n]]^2

f[m_, n] :=
Cos[0.45*Sqrt[n + 1]]^2*f[m - 1, n] +
Sin[0.45*Sqrt[n]]^2*f[m - 1, n - 1]

i want to iterate through m but keep n as a variable for plotting later on.
but mathematica keeps having trouble with the last part where it says "n-1"
i've been to a point, where the function would evaluate but there would be the term f[(...),-1+n] in it, which should not be there...

any suggestions, or am i even getting something basic wrong here?

thanks a lot

URL: ,

Subject (listing for 'iterative function')
Author Date Posted
iterative function Sebastian 05/27/13 09:16am
Re: iterative function jf 05/27/13 2:39pm
Re: iterative function Sebastian 05/28/13 3:22pm
Next Comment >Help | Reply To Topic