Finding The maximum and minimum value of a summation given a condition If $a_i = 1 - \frac{1}{N_i}$ and $\sum\limits_{I=0}^k{N_i} = n$, then what is the maximum and minimum values of $\sum\limits_{I=0}^k{a_i}$? Please help, I've tried to solve it but then I got confused. I think I may of found the minimum value to be $\frac{n - k}{n - k + 1}$ but i'm not sure.
Also $N_i > 0$ and $N_i$ is a subset of $\mathbb{N}$
 A: Firstly, note that
$$\sum_{i=0}^k a_i = \sum_{i=0}^k \left(1 - \frac{1}{N_i}\right) = k+1 - \sum_{i=0}^k \frac{1}{N_i}  $$
If $N_i$ are arbitrary positive real numbers, then the right hand side can get arbitrarily small. However, we have $N_i \in \mathbb{N}$ for each $i$ so that $$ \sum_{i=0}^k \frac{1}{N_i} \le k+1$$ A sensible first guess to obtain the minimum for $\sum_{i=0}^k a_i$ would be to put $N_i = 1$ for $0 \le i \le k-1$ and $N_k = n-k$, thus getting $$\sum_{i=0}^k \frac{1}{N_i} = k + \frac{1}{n-k}$$ If we make any other choice, then there are at least two values $i$ such that $N_i \ge 2$ and hence $$ \sum_{i=0}^k \frac{1}{N_i} \le (k-1) + \frac{1}{2} + \frac{1}{2} = k < k + \frac{1}{n-k}$$ so our sensible first choice is the best we can do, that is 
$$ \sum_{i=0}^k a_i = k+1 - \sum_{i=0}^k \frac{1}{N_i} \ge k+1 - \left(k + \frac{1}{n-k} \right) = 1 - \frac{1}{n-k}$$
and this is the minimum. 
For the maximum, as mentioned in the comments you can use the AM-HM inequality to obtain
$$ \sum_{i=0}^k \frac{1}{N_i} \ge \frac{(k+1)^2}{\sum_{i=0}^k N_i}= \frac{(k+1)^2}{n} $$ 
so that $$\sum_{i=0}^k a_i \le k+1 - \frac{(k+1)^2}{n} $$
Equality only happens in this case if all $N_i$ are equal, which may not always be possible. I think that, in this case, you want to select the $N_i$ to be as close to being equal as possible, that is each $N_i$ should be either $\lfloor \frac{n}{k+1} \rfloor$ or $\lceil \frac{n}{k+1} \rceil$. There will essentially be just one way to do this (not counting permutations). 
