Question

Use dynamic programming algorithm to compute the binary coefficient C(7,5). Show all steps!

Use dynamic programming algorithm to compute the binary coefficient C(7,5). Show all steps!

0 0
Add a comment Improve this question Transcribed image text
Answer #1

in DP for binary coefficient ,

Recurrence relaton is:

C(n,k) = C(n-1,k) + C(n-1,k-1) for n > k > 0

                      C(n,0) = 1,   C(n,n) = 1 for n >= 0

we will make table, value of C(7,5) will be found from table

C(7,5) = C(6,5)+C(6,4) because [C(n,k) = C(n-1,k) + C(n-1,k-1) ]

c(column-wise)

n(row-wise)

0 1 2 3 4 5
0
1
2
3
4
5
6
7

Step 1:   C(n,0) = 1,   C(n,n) = 1 for n >= 0

c(column-wise)

n(row-wise)

0 1 2 3 4 5
0 1
1 1 1
2 1 1
3 1 1
4 1 1
5 1 1
6 1
7 1

Step 2: C(n,k) = C(n-1,k) + C(n-1,k-1) for n > k > 0

c(column-wise)

n(row-wise)

0 1 2 3 4 5
0 1
1 1 1
2 1 2 1
3 1 3 3 1
4 1 4 6 4 1
5 1 5 10 10 5 1
6 1 6 15 20 15 6
7 1 7 21 35 35 21

C(7,5) = C(6,5)+C(6,4) = 6+15 =21

Add a comment
Know the answer?
Add Answer to:
Use dynamic programming algorithm to compute the binary coefficient C(7,5). Show all steps!
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT