SOLUTION: Tom the cat is brushing up his Math skills. He has a bag containing N balls of different colors. Now Tom can randomly pick any even number of balls from the bag. Tom wants to find

Algebra.Com
Question 1086986: Tom the cat is brushing up his Math skills. He has a bag containing N balls of different colors. Now Tom can randomly pick any even number of balls from the bag. Tom wants to find out the sum of all such combinations of balls that he can pull out from the bag. Given he can pull out at max K balls in one pick.
Input Format:
First line contains two space separated numbers N and K
Output Format:
The output is the sum of all the combinations of balls he can pull out modulo 10^9+7 i.e. (1000000007)
Constraints:
0<=N,k<=10^9
N >= k

Sample Input and Output
SNo. Input Output Explaination
1
4 4
8
We need 4C0 + 4C2+ 4C4= 1+6+1=8
2
8 3
29
We need 8C0 + 8C2= 1+28=29

Answer by ikleyn(52800)   (Show Source): You can put this solution on YOUR website!
.
See the lesson
    - Tom the cat is brushing up his Math skills
in this site, where this problem was solved.


Also,  you have this free of charge online textbook in ALGEBRA-II in this site
    ALGEBRA-II - YOUR ONLINE TEXTBOOK.

The referred lesson is the part of this online textbook under the topic
"Miscellaneous word problems".


RELATED QUESTIONS

Tom the cat is brushing up his Math skills. He has a bag containing N balls of different... (answered by ikleyn)
Tom is the custodian at the local high school. He has a circular key ring with 9 keys on... (answered by ikleyn)
I have a container with balls of 3 different colors. (for this let's assume the number of (answered by Fombitz)
From a pile of coins containing nickels (N), dimes (D) and quarters (Q), Tom picked 10... (answered by josmiceli)
Larry tells his friend he has a bag containing 4 types of marbles: cat’s eye, clear,... (answered by fractalier)
Dear tutor , Can you please help me on this word problem? Can you also shiw the steps, (answered by MathTherapy)
there are (t) orange balls and 2 yellow balls in a bag. Craig randomly selects one ball... (answered by htmentor)
Mike has a bag of 300 balls he randomly chooses 15 balls and 4 are purple how many of the (answered by stanbon)
If Tom and Mary are taking two different Methods classes, Tom has a z score of .40 for... (answered by stanbon)