Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What are recursion and iteration?

iteration recursion
0
10 Posted

What are recursion and iteration?

0
10

An iteration is a mathematical (or geometrical) operation that is repeated a certain number of times to reach (or approximate) the final result. The division of 10 by 3 gives a result of 3 and a remainder of 1. The division of 1 by 3 gives a result of 0.3 and a remainder of 0.1. The division of 0.1 by 3 gives a result of 0.03 and a remainder of 0.01. Therefore 3+0.3+0.03…=3.33… is the approximate value of 10/3 and you see that the division algorithm is iterative. Now, suppose an operation giving certain result and an iteration which applies the same operation to the result itself: this iterating process is recursive. This can be illustrated in a simple way by the process used to obtain the Cantor dust: Start with a straight segment, the length of which is L. Remove the central 1/3 of this segment. That leaves you 2 segments of length L/3. Remove the central 1/3 of each segment, and you get 4 segments of length L/9. Repeating this recursive process endlessly leads to the Cantor dust

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123