hermit said:
taking 1 step --> 1 way ;
taking 2 steps --> 1 way;
combination of 2&3 --> 4 ways;
combination of 1&3 --> 4 ways;
combination of 1,2 &3-->5!/5*2! + 3!
ways
1&2 combination has been left out above, and some mistakes are there...
Combination of 2 & 3: Here, no. of 3s has to be 2 (cannot be 0 as it will be all 2s which has been accounted, cannot be 1 or 3 as there will be odd number in total, anything above 3 will lead to total more than 10.). So, you have 2 2s and 2 3s in this combination set... (2,2,3,3), (2,3,2,3), (2,3,3,2), (3,2,2,3), (3,2,3,2), (3,3,2,2,) implies 6 combinations...
Combinations of 1 & 3: Here, things get a bit complicated...If we have x 1s and y 3s, x+y must be even, but x and y can both be odd... x and y must be greater than 0... y=1 => x=7, y=2 => x=4, and y=3 => x=1.
x=7, y=1 => 8 combinations
x=1, y=3 => 4 combinations
x=4, y=2 => (111133) (111313) (111331) (113113) (113131) (113311) (131113) (131131) (131311) (133111) (311113) (311131) (311311) (313111) (331111) 15 combinations...
Combinations of 1 & 2: Here again, the combinations will increase... no. of 1s must be 2, 4, 6 or 8. I will get back to this later...
2 1s, 4 2s
4 1s, 3 2s
6 1s, 2 2s
8 1s, 1 2(s)
And then we have combinations of 1,2 and 3, which I will look into later...
Arun