GATE Computer ScienceEasyGATE CS (PYQ pattern)
Coupons of 6 equally likely types are drawn with replacement. What is the expected number of draws until 4 different types have been seen?
- A. 14.7
- B. 4.0
- C. 5.7
- D. 9.7
Correct answer: C. 5.7
After seeing i types, a new type appears with probability (6 − i)/6, so the wait is 6/(6 − i). Sum for i = 0…3: 1 + 1.2 + 1.5 + 2 = 5.7. 14.7 is the expected time to collect all 6 types.
More Algorithms questions
- Counting sort (stable, processing the input from right to left with cumulative counts) is applied to a = [4, 2, 2, 8, 3, 3, 1, 4, 2]. At…
- LSD radix sort (decimal digits, stable counting sort on each digit, least significant first) is applied to [329, 457, 657, 839, 436, 720…
- A shell sort pass with gap 5 (a gapped insertion sort) is applied to [23, 12, 45, 3, 67, 8, 34, 19, 56, 2, 41, 28]. The cost of the pass…
- The array [14, 5, 21, 9, 30, 7, 18, 2, 26, 11] is made into a max-heap, giving [30, 26, 21, 14, 11, 7, 18, 2, 9, 5]. Heapsort then…
- In how many ways can 30 be written as a sum of ODD positive integers, where order does not matter and parts may repeat?
- In how many ways can 20 be written as a sum of exactly 4 positive integers, where order does not matter (parts may repeat)?