Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a function as below, $$ f(n) = \sum_{i}{-\Big( (1-q_i)^{n-1} - b \Big)^2} $$ how to find an integer $n\in[0,N]$ that maximizes function $f(\cdot)$. Here, $q_i\in[0,1]$, $b\in[0,1]$ and $N \gg 1$. Or which area should I look into, to solve this problem?

share|cite|improve this question
A few questions: is $n$ real or is it an integer? what do you know about $b$? what about $q_i$? what is the range on your sum? The reason I ask, is that if your sum range is small and n is an integer (with a small $N$), then if may be easiest just to calculate every possible value. – rcollyer Apr 18 '11 at 19:53
edited accordingly. – Richard Apr 18 '11 at 21:01
In that case, you'd want to look at integer programming. – J. M. Apr 18 '11 at 21:08
up vote 1 down vote accepted

By looking at the function, it seems that you only have to compute $f(n)$ for a few values of $n$. Let $q \in \mathbb{R}^k$ and the solution be $n^*$. Now, $n^* \neq 0$ since $(1-q_i) \in [0,1]$. Also, note that $f(1) = -k(1-b)^2$. Now, for $n>1$, you'll have some fluctuations in $f(n)$ due to $b$, but as $n$ increases, $f(n)$ should monotonically decrease to $-kb^2$.

Therefore, finding the $\max$ of the first $m=20$ values should do the trick (you can experiment with the value of $m$).

The area for this problem is constrained nonlinear integer programming in one dimension.

share|cite|improve this answer
I would say having both "constrained" and "programming" is redundant... but I agree with your recommendation. – J. M. Apr 18 '11 at 22:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.