Jump to content
BrainDen.com - Brain Teasers
  • 0
Sign in to follow this  
mmiguel

Recursion

Question

Find a closed-form expression for F(a,b) where:

F(a,b) = F(a-1,b) + F(a-1,b-1),

F(a,0) = 1 for all a

F(0,b) = 0 for all b

a and b are positive integers

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

What does F(0,0) evaluate to? you need it for F(1,1)

In case F(0,0)=1 then F(a,b) = b choose a, as in the binomial coefficient between b and a.

In case F(0,0)=0 then it's the binomial coefficient between b-1 and a.

Given F(0,0) there is only one solution, you can see this if you draw an xy axis and mark a on the x axis and b on the y axis, then mark 0's on the a axis and 1's on the b axis, then the value of every other point on the plane is the sum of values of the point to it's left and the point under that...

Edited by Anza Power

Share this post


Link to post
Share on other sites
  • 0

What does F(0,0) evaluate to? you need it for F(1,1)

In case F(0,0)=1 then F(a,b) = b choose a, as in the binomial coefficient between b and a.

In case F(0,0)=0 then it's the binomial coefficient between b-1 and a.

Given F(0,0) there is only one solution, you can see this if you draw an xy axis and mark a on the x axis and b on the y axis, then mark 0's on the a axis and 1's on the b axis, then the value of every other point on the plane is the sum of values of the point to it's left and the point under that...

F(0,0) = 1

Sorry for leaving that out.

Nice work, you are correct!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...