[algogeeks] infy color balls

2010-04-30 Thread Ashish Mishra
One of my friend ask me this n i am bad in P C (will love if smone can provide me a link to learn it though) nyways prob is: there are infy color balls of k different color you are allowed to pick n balls out of those infy(infinite) balls cond is : you must have all k color balls with u

Re: [algogeeks] infy color balls

2010-04-30 Thread Kishen Das
Answer is k! * k^(n-k). You can select k number of balls in K! ways and then rest of (n-k) balls in k ways. This way you are ensuring that you have all k color balls and n number of balls in total. - Kishen Das On Fri, Apr 30, 2010 at 6:04 AM, Ashish Mishra amishra@gmail.comwrote: One of

Re: [algogeeks] infy color balls

2010-04-30 Thread saurabh gupta
C(n-1,k-1) if balls are similar On Fri, Apr 30, 2010 at 4:34 PM, Ashish Mishra amishra@gmail.comwrote: One of my friend ask me this n i am bad in P C (will love if smone can provide me a link to learn it though) nyways prob is: there are infy color balls of k different color you are

Re: [algogeeks] infy color balls

2010-04-30 Thread mohit ranjan
@Ashish Check this http://www.codechef.com/problems/MARBLES/ Mohit Ranjan Samsung India Software Operations. On Fri, Apr 30, 2010 at 4:34 PM, Ashish Mishra amishra@gmail.comwrote: One of my friend ask me this n i am bad in P C (will love if smone can provide me a link to learn it