GATE | GATE-CS-2003 | Question 4

Let A be a sequence of 8 distinct integers sorted in ascending order. How many distinct pairs of sequences, B and C are there such that (i) each is sorted in ascending order, (ii) B has 5 and C has 3 elements, and (iii) the result of merging B and C gives A?
(A) 2
(B) 30
(C) 56
(D) 256

Answer: (C)


Suppose you have selected 3 elements from 8 in 8C3 ways, the remaining elements are treated as another array and merging both the arrays gives the sorted array. Here, you can select either 3 or 5.

=> 8C3 = 8C5 = 8!/(3!5!) = 7*8 = 56 Ways.

This solution is contributed by Anil Saikrishna Devarasetty

Quiz of this Question

My Personal Notes arrow_drop_up
Article Tags :

Be the First to upvote.

Please write to us at to report any issue with the above content.