GATE Computer ScienceVery hardGATE CSE · UGC NET
In how many different ORDERED sequences of coins from {1, 4, 5} can a total of exactly 15 be formed (sequences like 1,4 and 4,1 count separately)?
- A. 10
- B. 249
- C. 191
- D. 200
Correct answer: D. 200
With f(s) = f(s−1)+f(s−4)+f(s−5), f(15) = 200; the unordered count would be only 10.
More Algorithms questions
- How many binary strings of length 12 do not contain three consecutive 1s as a substring?
- Five keys k1<k2<k3<k4<k5 are searched with access frequencies 4, 2, 6, 3, 9. For a binary search tree over these keys, with the root at…
- What is the minimum number of comparisons needed in the worst case to find the SECOND smallest of 100 distinct elements?
- Consider T(n) = 2T(n/2) + n/log₂n for n ≥ 2 (n a power of 2, T(1) = 1). Which is the tightest bound? (The Master theorem in its basic form…
- Let T(n) = 2T(√n) + log₂ n for n > 2, with T(2) = 1, where n is always of the form 2^(2^k). What is the exact value of T(2^16)?
- Consider T(n) = 2T(n/2) + 8T(n/4) + n² with T(1) = 1 (the subproblem sizes add up to 3n, not n). Which is the tight bound?