Mathematica Composition Functions Mathematica

AI Thread Summary
The discussion revolves around writing a loop to find the limit of the function f(x) = 5x(-x+1) as n approaches infinity, specifically evaluating f^n(0.75). Participants highlight that the definition of the function should be placed outside the loop and question the appropriateness of using a for loop to find a limit. Instead, they suggest using the Limit function for this purpose. Clarification is sought regarding the intent behind the iteration: whether it involves calculating the limit of f[x]^n or if it is about iterating based on previous estimates. The conversation emphasizes that iterative methods typically rely on convergence criteria rather than a fixed number of iterations, recommending the use of a while loop to assess convergence effectively.
Nusc
Messages
752
Reaction score
2
I need to write a loop that iterates several times to find the limit of this function


f(x) = 5x(-x+1) lim f^n(0.75) n->

For[n = 0, n < 5, n++,
x=0.75;
f[x_] := 5x(-x+1)
];
]

what am i doing wrong?
 
Physics news on Phys.org
You probably want to put the definition of f[x_] outside the for loop, but that said I don't understand what you are trying to do. I don't understand how a for loop is going to help you find a limit. You can just use the Limit function.
 
It's going to keep iterating and eventually converge to a number.
 
Try to explain what exactly you're trying to do. What does:
f(x) = 5x(-x+1) lim f^n(0.75) n->

mean?
are you trying to do the Limit of f[x]^n (to the nth power?)
 
And are you taking the limit as x approaches something or as n approaches something?

Also, how are you iterating? In other words, in an iterative method one estimate is based on the previous estimate. It is not clear at all from your description how you are planning on obtaining one estimate from the previous.

Finally, usually when you are doing an iterative method, you will not iterate a fixed number of times using a For loop. Instead you usually have some convergence criteria that you evaluate at the end of each pass through a While loop. You then exit the While loop when the convergence criteria is met or return an error if it is not met after a certain maximum number of iterations.
 
Last edited:

Similar threads

Replies
1
Views
2K
Replies
2
Views
2K
Replies
4
Views
1K
Replies
4
Views
2K
Replies
3
Views
2K
Back
Top