# Possible values of a sum of cubes

If $x_i$ be a sequence of integers such that $x_i\in [-1,2]$ where $i=1,2, \dots,n$. If it is given that $$\sum_{i=1}^n x_i^2 =99$$ and $$\sum_{i=1}^n x_i =19,$$

find min and max value of $\sum_{i=1}^n x_i^3$.

Also, for the max possible value of $\sum_{i=1}^nx_i^3$, what is the no of $2$'s the sequence must have?

• What is a MCQ ? – mvw Apr 20 '17 at 15:20
• multiple choice question – Dev Aggarwal Apr 20 '17 at 15:25
• Here are the choices- min values - 18, 21, 19, 13 max values - 133, 121, 143, 165 number of 2's - 18, 19, 20, 21 – Dev Aggarwal Apr 20 '17 at 15:26
• You should not cube the sum, but rather sum the cube of the variables. – jvdhooft Apr 20 '17 at 15:39
• Going from the first line to the second is not correct. You only get one term $x_1x_2^2$ on the right, but the left has $3x_1x^2$ I don't think this is a productive approach. – Ross Millikan Apr 20 '17 at 16:07

Let us call $n_{-1}$, $n_1$ and $n_2$ the number of times -1, 1 and 2 appear. Note that it does not matter how many times 0 appears, because this does not add to the result of any summation. We know the following:

$$-n_{-1} + n_1 + 2 n_2 = 19 \tag{1}$$ $$n_{-1} + n_1 + 4 n_2 = 99 \tag{2}$$

Subtracting (1) from (2), we get:

$$2 n_{-1} + 2 n_2 = 80 \iff n_2 = 40 - n_{-1}$$

Using this in (2), we get:

$$n_{-1} + n_1 + 160 - 4 n_1 = 99 \iff n_1 = 3 n_{-1} - 61$$

Since $n_1$ and $n_2$ must both be positive, $n_{-1}$ is at most 40, and at least 21. In the former case we have $n_{-1} = 40, n_1 = 59$ and $n_2 = 0$, so we obtain a minimum value of:

$$\sum_{i=1}^n x_i^3 = -40 + 59 + 8 \cdot 0 = 19$$

In the latter case we have $n_{-1} = 21, n_1 = 2$ and $n_2 = 19$, so we obtain a maximum value of:

$$\sum_{i=1}^n x_i^3 = -21 + 2 + 8 \cdot 19 = 133$$

The number of 2's in the latter case equals 19.

• i missed the part where it said integer values. Can you check my solution? – Dev Aggarwal Apr 20 '17 at 15:32