The weight of a sequence \(a_0,a_1, \dots, a_{n-1}\) of real numbers is…

PYQ GATE 2010

The weight of a sequence a0,a1,…,an−1a_0,a_1, \dots, a_{n-1} of real numbers is defined as a0+a1/2+⋯+an−1/2n−1a_0+a_1/2+ \dots + a_{n-1}/2^{n-1}. A subsequence of a sequence is obtained by deleting some elements from the sequence, keeping the order of the remaining elements the same. Let XX denote the maximum possible weight of a subsequence of a0,a1,…,an−1a_0,a_1, \dots, a_{n-1} and YY the maximum possible weight of a subsequence of a1,a2,…,an−1a_1,a_2, \dots, a_{n-1}. Then XX is equal to

  1. A.

    max(Y,a0+Y)max(Y, a_0+Y)

  2. B.

    max(Y,a0+Y/2)max(Y, a_0+Y/2)

  3. C.

    max(Y,a0+2Y)max(Y, a_0 +2Y)

  4. D.

    a0+Y/2a_0+Y/2

Attempted by 184 students.

Sign up free to check your answer

Sign up free

Explore the full course: Algorithms

Loading lesson…