Re: [algogeeks] Re : Non Decreasing Numbers

2011-09-25 Thread Sanjay Rajpal
Can you plz tell the answer for for 3 answer=? nd for 4 answer=? Sanju :) On Sat, Sep 24, 2011 at 10:39 PM, Dheeraj Sharma dheerajsharma1...@gmail.com wrote: can u plz be more..clear ..with wat the input will consist of.. wat does this mean for 2 answer=55 does that mean..that how many

Re: [algogeeks] Re : Non Decreasing Numbers

2011-09-25 Thread Yogesh Yadav
n=1 n=2 n=3 n=4 01010!(10!)! 1 9 9! (9!)! 2 8 8! 3 7 7! 4 6 6! 5 5 5! 6 4

Re: [algogeeks] Re : Non Decreasing Numbers

2011-09-25 Thread Yogesh Yadav
mistake in last post...it was not factorialsum upto n i.e =n(n+1)/2 i.e 10! is wrong ...it will be 10(10+1)/2 On Sun, Sep 25, 2011 at 12:14 PM, Yogesh Yadav medu...@gmail.com wrote: n=1 n=2 n=3 n=4 01010!(10!)! 1

Re: [algogeeks] Re : Non Decreasing Numbers

2011-09-25 Thread Dheeraj Sharma
yeah exactly..yogesh..i was confused with factorial On Sun, Sep 25, 2011 at 12:21 PM, Yogesh Yadav medu...@gmail.com wrote: mistake in last post...it was not factorialsum upto n i.e =n(n+1)/2 i.e 10! is wrong ...it will be 10(10+1)/2 On Sun, Sep 25, 2011 at 12:14 PM, Yogesh Yadav

Re: [algogeeks] Re : Non Decreasing Numbers

2011-09-25 Thread Sanjay Rajpal
let the number of digits be n then answer would be ((n+9)! ) / (9! * n!) Sanju :) On Sat, Sep 24, 2011 at 11:51 PM, Yogesh Yadav medu...@gmail.com wrote: mistake in last post...it was not factorialsum upto n i.e =n(n+1)/2 i.e 10! is wrong ...it will be 10(10+1)/2 On Sun,

Re: [algogeeks] Re : Non Decreasing Numbers

2011-09-25 Thread Sanjay Rajpal
Or in other words... for n=2 , answer= (10*11)/2 for n=3, answer= (10*11*12)/(2*3) for n=4, answer = (10*11*12*13)/(2*3*4) Sanju :) On Sat, Sep 24, 2011 at 11:58 PM, Sanjay Rajpal srn...@gmail.com wrote: let the number of digits be n then answer would be ((n+9)! ) / (9! * n!) Sanju :)

Re: [algogeeks] Re : Non Decreasing Numbers

2011-09-25 Thread Yogesh Yadav
+1 Gohana On Sun, Sep 25, 2011 at 12:28 PM, Sanjay Rajpal srn...@gmail.com wrote: let the number of digits be n then answer would be ((n+9)! ) / (9! * n!) Sanju :) On Sat, Sep 24, 2011 at 11:51 PM, Yogesh Yadav medu...@gmail.com wrote: mistake in last post...it was not

Re: [algogeeks] Re : Non Decreasing Numbers

2011-09-25 Thread shady
@sanjay can you please tell how did you arrive at that solution ? On Sun, Sep 25, 2011 at 12:32 PM, Yogesh Yadav medu...@gmail.com wrote: +1 Gohana On Sun, Sep 25, 2011 at 12:28 PM, Sanjay Rajpal srn...@gmail.com wrote: let the number of digits be n then answer would be ((n+9)! ) /

[algogeeks] Re : Non Decreasing Numbers

2011-09-24 Thread shady
A number is said to be made up of non-decreasing digits if all the digits to the left of any digit is less than or equal to that digit. for eg. 1122, 234, 2 , 0011 is a possible 4 digit non decreasing number so given a number n, how many n digit numbers exist ? for 2 answer = 55 Can

Re: [algogeeks] Re : Non Decreasing Numbers

2011-09-24 Thread Dheeraj Sharma
can u plz be more..clear ..with wat the input will consist of.. wat does this mean for 2 answer=55 does that mean..that how many non decreasing digits can be formed by 2 digit num On Sun, Sep 25, 2011 at 1:08 AM, shady sinv...@gmail.com wrote: A number is said to be made up of non-decreasing