recursive prog

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mcarthybn
    New Member
    • Jun 2009
    • 7

    recursive prog

    Hi,
    I am very much puzzled to solve this problem .Though i am not from comp. science background but have passion to crack the algos.
    Prob is ->
    How do you prove the correctness of a recursive program? Prove the correctness the
    following function which computes n’th Fibonacci number
    function fib(n)
    begin
    if (n1) then
    return (n)
    else
    return (fib(n-1)+fib(n-2))
    end

    So please help me on this problem .
  • shabinesh
    New Member
    • Jan 2007
    • 61

    #2
    i think it can be proved with mathematical induction

    Comment

    Working...