Question regarding recursive functions

This is a discussion on Question regarding recursive functions within the C++ Programming forums, part of the General Programming Boards category; If someone could please provide some guidance on this I would greatly appreciate it. I'm taking a C++ Data Structures ...

  1. #1
    Registered User
    Join Date
    May 2005
    Posts
    4

    Question regarding recursive functions

    If someone could please provide some guidance on this I would greatly appreciate it. I'm taking a C++ Data Structures and Algorithms class, we are currently covering recursion.

    The first part of the assignment was to create two programs using recursive functions from exercises from the text-book, no problem there. The second part is involves these jpeg attachments; they are mathematical proofs.

    Apparently, I'm supposed to prove the proof in Lesson5_15.jpeg with a program using recursion. Then, I'm supposed to implement Lesson5_19.jpeg using mutual recursion.

    I have asked several friends and co-workers who are Computer Science grads about this; they are as puzzled as I am. In fact for Lesson5_15.jpeg, I'm told the only way to actually prove it is through writing it out on paper. This is an online course taken through a local college and I never actually meet with the actual class and instrcutor everything is done through the internet.

    The other students in my class are just as confused and to make matters worse, when I asked the instructor to be more specific with he wants, he proceeded to explain the theory behind these proofs, but nothing in regards to what he wants with them or even remotely on how to achieve this. I have emailed him again asking for further clarification and haven't heard anything for a couple days; I doubt I'll hear anything until Monday.

    Please note, I'm not asking anyone to complete my assignment for me, just some input on what the instructor might want and how I might achieve this.

    Thanks in advance,

    Joe
    Attached Images Attached Images   

  2. #2
    Cat Lover
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    109
    Maybe using Newton's method (well, that's for finding the roots, but similar) to find an approximation?
    All I can think of.

  3. #3
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,231
    By prove I think it means proving that equations work. Write a program to calculate that series.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    835
    Quote Originally Posted by knj316
    Apparently, I'm supposed to prove the proof in Lesson5_15.jpeg with a program using recursion.
    Are you sure you didn't misunderstand him, since this equation can be proved in 2 or 3 lines algebraically?

  5. #5
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,510
    The Change of Base logarithm rule described in the 5_15 file can be proved recursively. Remember what a logarithm is. It is the inverse of the exponential function.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  6. #6
    Registered User
    Join Date
    Sep 2006
    Posts
    835
    I'm confused. The equation is valid for any b>0, c>0, and x>0. But whatever variable the recursion is applied to takes discrete values. So is the recursive "proof" limited to just those values? And if it involves infinite series, is it careful about convergence? I'm a mathematician, not a computer scientist, and it just seems perverse that someone would try such a roundabout and error-prone "proof" when a completely general and rigorous proof is trivial.

  7. #7
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,510
    Oh, no. Nothing like that. What I think the teacher wants is just an ad hoc proof. Certainly within a range of acceptable values. It's a programming class. The mathematical validity of this "proof" is not the objective. Instead, to apply a programming technique to a problem.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  8. #8
    Registered User
    Join Date
    May 2005
    Posts
    4

    Thanks

    Thanks for all of your replies, it definately gives me a starting point. Hopefully, I'll get further clarification sometime tommorow.

    Unfortunately, my math is very rusty, thus making it more difficult.

    Joe

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. New to programming, help with recursive functions.
    By HitchHiker in forum C Programming
    Replies: 6
    Last Post: 09-22-2008, 12:53 PM
  2. Functions and Strings Question
    By StrikeMech in forum C Programming
    Replies: 4
    Last Post: 07-18-2007, 06:07 AM
  3. A question about pointers in functions
    By occams razor in forum C Programming
    Replies: 3
    Last Post: 05-15-2007, 12:16 AM
  4. question about c functions
    By LowLife in forum C Programming
    Replies: 1
    Last Post: 11-16-2005, 11:20 AM
  5. .h and functions question
    By Mick D in forum C++ Programming
    Replies: 5
    Last Post: 10-21-2005, 12:53 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21