in Programming in C retagged by
1,324 views
3 votes
3 votes

in Programming in C retagged by
by
1.3k views

4 Comments

168 ans
1
1
Please explain.
0
0
I am trying to solve this way- we have to maintain this order-         2-12-62-82.

place 91 anywhere in place of - in        -2-12-62-82-  5 dashes so 5 ways.

For 13,( assuming 91 is placed anywhere and our string looks like this    -2-12-91-62-82- ) 2 dashes as 13 should come before 12. So 2 ways.

For 24,( again assuming a random place for 13 string looks like -2-13-12-91-62-82- )  3 dashes before 12 so 3 ways.

For 77,  assuming our string looks like this  -2-24-13-12-91-62-82- 8 dashes so 8 ways. total 5*2*3*8=240  ways.

which cases I am missing?
0
0

2 Answers

2 votes
2 votes
Best answer

Although shaik answered this question but way back I have solved similar kind of question-

1st case-

[91,2,13,24,77][62,72,82]  now first bolded part can be arrange in how many ways = 5! = 120 ways

 

2nd case-

now take one element from 1st partition and put in 2nd partition but you can not put 2,13,24 because if you will move that then 62,72 wil not come at position 6 and 7. So move 91 and 77 one by one

a) now take 91, we can arrange in following ways [62,_,72,82],  [62,72,_,82],[62,72,82,_] (place 91 at each blank) so there are only 3 ways and 4 elements in 1st partition can be arranged in 4! ways. So total ways = 3*4! = 72 ways

b) now take 77, we can arrange in following ways [62,_,72,82],  [62,72,_,82] (place 77 at blanks and we can't put 77 after 82) so there are only 2 ways and 4 elements in 1st partition can be arranged in 4! ways. So total ways = 2*4! = 48 ways

 

3rd case-

now take two elements at one time (91,77).

a)take (91,77), we can arrange in following manner[62,_,77,_,72_,82_] and [62,_,72,_,77_,82_] (place 91 at each blank and look we can't use [62,_,72,_,_,82_,77,_] because 77 can't come after 82)so there are 8 ways and 3 elements in 1st partition can be arranged in 3! ways. So total ways for (91,77) = 8*3! = 48

 

 

Total ways = 120 + 72 + 48 + 48 = 288 ways

selected by

1 comment

somewhat difficult to understand to others

But this way of solving giving good knowledge in Permutations and Combinations, and it really helps at many other places.
1
1
8 votes
8 votes

Total Places = 8

   ___    ___   ___    ___    ___    ___   ___    ___

    1       2       3       4         5      6        7       8

 

From the Data we can observe that 91 can be inserted at any time ===> 8C1 = 8

 

now, remaining positions are 7

   ___    ___   ___    ___    ___    ___   ___

    1       2        3       4        5       6       7     

82 should be at the end ====> 1

 

now, remaining positions are 6

   ___    ___   ___    ___    ___    ___

    1       2        3       4        5       6     

From the Data now, we can observe that 77 can be inserted at any time ===> 6C1 = 6

 

now, remaining positions are 5

   ___    ___   ___    ___    ___

    1        2       3       4        5      

From the Data now, we can observe that 12 and 62 should be inserted at last and in-order ===>1

 

now, remaining positions are 3

   ___    ___   ___

    1        2        3  

From the Data now, we can observe that 2,13 and 34 can be inserted at any order ===> 3 !

 

From Multiplication rule = 8 * 1 * 6 * 1* 3 ! = 8*6*6 = 36 * 8 = 288

4 Comments

Ok, I got it my mistake
0
0
you didn't respond on GATE question.

Please something comment for " I have to know did you get it or not "
0
0
I got both the question. Thanks for your procedure
0
0

Related questions