Composition Functions Mathematica

Click For Summary

Discussion Overview

The discussion revolves around the implementation of a loop in Mathematica to find the limit of a function defined as f(x) = 5x(-x+1) as n approaches infinity. Participants are exploring the correct approach to iterating and calculating limits, with a focus on the use of loops versus built-in functions.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant suggests defining the function f[x_] outside the loop, questioning the utility of a for loop for finding a limit.
  • Another participant believes that the iterative process will converge to a number, although the specifics of the iteration method are unclear.
  • There is a request for clarification on the meaning of the expression lim f^n(0.75) and whether it refers to the limit of f[x] raised to the nth power.
  • Concerns are raised about the lack of clarity regarding the limit being taken as x approaches a value or as n approaches infinity.
  • Participants discuss the typical structure of iterative methods, suggesting that a While loop with convergence criteria is more appropriate than a fixed iteration count in a For loop.

Areas of Agreement / Disagreement

Participants do not appear to reach a consensus on the correct approach to the problem, with multiple competing views on the use of loops and the definition of the limit being discussed.

Contextual Notes

The discussion highlights uncertainties regarding the iterative method's implementation, the definition of the limit, and the appropriate use of Mathematica functions.

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 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
Replies
8
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K