What is Recursion: Definition and 120 Discussions

Recursion (adjective: recursive) occurs when a thing is defined in terms of itself or of its type. Recursion is used in a variety of disciplines ranging from linguistics to logic. The most common application of recursion is in mathematics and computer science, where a function being defined is applied within its own definition. While this apparently defines an infinite number of instances (function values), it is often done in such a way that no infinite loop or infinite chain of references can occur.

View More On Wikipedia.org
  1. P

    Recursion code for generating Gray Code in C

    Homework Statement I need to implement a recursive code for generating the Gray code for a given number of bits. For example, if the input bit is 1 it generates Gray code for 1 bit number i.e 0 and 1. Given 2, it generates Gray code for 2 bit numbers i.e 00 and 01 and so on. I don't...
  2. D

    Difficult recursion problem in C

    Hi, everybody. I really need your help with this question that giving me no sleep at nights. :( no loops and no pointers, and No STATIC can be used. Write a recursive function that fills the given character array with all possible given-size subsets of characters in given word, separated by...
  3. L

    Solution of a recursion relation

    Hi there! I wonder if there's an explicit solution to a recursion relation of the form \alpha_{n+2} = A \alpha_{n+1} + B \alpha_n + C^n . The solution of this recursion relation without C^n can easily be computed. I haven't found anything on the net. Thanks!
  4. P

    Java Java recursion longest common subsequence

    can someone explain java recursion to me?
  5. T

    Where can i find binary tree recursion manual

    where can i find a tutorial on binary tree recursion i searched in google: http://www.google.co.il/search?hl=iw&sa=X&oi=spell&resnum=0&ct=result&cd=1&q=binary+tree+recursion&spell=1 and there is no tutorials for this kind of stuff ??
  6. T

    How to find a mathematical formula for this recursion?

    how to find a mathematical formula for this recursion?? i got this recursion int b(int n,int count) { int i; count =a(n,count); for(i=0;i<n;i++) count =b(i,count); return count; b(0,0)=1 b(1,0)=3 b(1,1)=4 b(2,0)=8 the formula for function "a" is a(n,c)=2^n + c what is...
  7. T

    How to organise the tracing of this recursion

    i tried to trace this recurtion for small numbers but i don't know how to write down in an organized way int a(int n,int count){ int i; for(i=0;i<n;i++) count =a(i,count); return count+1; } a(0,0) is easy its 1 a(1,0) a little harder it returns 2 but when i get...
  8. M

    Kalman Filters: Understanding Kalman Recursion and AR(1) Process

    As this is concerning signal processing i guess this is the right place to post the question. I am Trying to learn how to use kalman filters. I've reached some form of verry basic understanding of the state-space model but I am still kindof confused. What I am trying to do now is to understand...
  9. A

    Recursion relation for C-G coefficients

    From J.J. Zakurai page no.222-225: We know that Clebsch-Gordan coefficients vanish unless m=m1+m2. Then, (1) why is that the terms in recursion relation doesn't vanish? since m1+m2=m+1 or m1+m2=m-1 in eqn.(3.7.49). (2) why is again in the example shown in eqn.(3.7.54), m1+m2=m? I...
  10. D

    Is recursion truly superior to iteration?

    When is recursion really better than iteration. I'm not a programmer by major, but I can't think of any time when recursion would be better
  11. B

    Legendre's Equation & Bonnet's Recursion

    This seemed to be the most appropriate forum for this. I've been doing a bit of self-study of Kreyszig's Advance Engineering Mathematics (which I think is an excellent book). Doing out one of the problems (Chapter 5, 14 (d), pg 181 in the 9th International Edition) I've come across Bonnet's...
  12. Math Is Hard

    Is Leaving an Empty if Statement in a Recursive Function Bad Programming Style?

    I just finished writing a little recursive function in C++ and when my stopping condition is reached, I need it to do nothing. So the if statement looks funny: if (the condition is met) { //do nothing } else { call yourself with smaller arguments } It works fine, but I feel uneasy...
  13. H

    Recursion Formula for Series: a (n) = 1/2^n

    Can you write the recursion formula for this series?' a (then little n) = 1/2^n *the 2 is to the nth power, not the one *for the first half, it is written a then a little n to the bottom right. I don't understand how to even go about this. Any help would be great thanks.
  14. Math Is Hard

    C/C++ Solving C++ Recursion Problem with Summing Digits

    Hi, I am playing around with doing stuff recursively, just to practice, and I have a problem I can't work out. I want to write a recursive function that will sum the digits of a number, take the result, sum those digits, etc. until I reach a single digit number. Then I want to return that...
  15. M

    Recursion formula for power series solution

    Hi, I'm trying to solve a differential equation and I'm supposed to obtain a recursion formula for the coefficients of the power series solution of the following equation: w'' + (1/(1+z^2)) w = 0. The term 1/(1+z^2) I recognize as a geometric series and can be expressed as sum of 0 to...
  16. P

    Recursion Formula: Solve Series with Ease

    Do you guys know what the recursion formula for this series? http://ourworld.cs.com/SuperSamuraiStar/math.bmp
  17. G

    Solve Recursion Equation: (n-1)*a[n+1] - n*a[n] + 10*n = 0

    how do you solve the recursion equation (n-1)*a[n+1] - n*a[n] + 10*n = 0?
  18. O

    Understanding Recursion in C: Exploring Factorial Function

    Look at this code : 27: unsigned int factorial(unsigned int a) 28: { 29: if (a == 1) 30: return 1; 31: else 32: { 33: a *= factorial(a-1); 34: return a; 35: } 36: } The code evaluates fcatorial of "a". The only point I don't get is the return in line 30. When the function is called...
  19. Bob3141592

    Notation for recursion - better typesetting

    I know this is nothing new to most people here, but my question is really more about the notation than the mathematics. And since this question is really about notation, and it’s my first use of the LaTex equation formatter, I get to experiment with something new. That’s always fun. But...
  20. Bob3141592

    What is the proper notation for recursion in LaTex?

    Okay, my first attempt at LaTex was terrible, and the post originally made in this space was undecipherable. I requestd this thread be deleted, and I'll be posting a proper (I hope) version in a separate thread. Thanks for your patience. Bob
Back
Top