I have been thinking about it for several days and still have not solved it completely. This is the problem:
My formula: Outcome=$(a_1*b_1)+(a_2*b_2)+(a_3*b_3)...+(a_n*b_n),$ where $0\le a\le 1,$ $0\le b\le1, ~~a+b\le 1, ~~a_1+a_2+a_3...+a_n\le 1.$
I would like to find the maximum of this function based on the value of n. Just by trying out different numbers, I have found that the maximum should be (n-1)/n, but I have not been able to prove it mathematically yet. Any help is very much appreciated!
Since $0\leq a_i\leq 1$, we have from $a_i+b_i\leq 1$ that
$$\sum_{i=1}^na_ib_i\leq\sum_{i=1}^na_i(1-a_i).$$
Next assume $\sum_ia_i=x\in[0,1]$. Then use
$$\frac{1}{n}\sum_{i=1}^n a_i^2\geq\left(\frac{1}{n}\sum_{i=1}^na_i\right)^2=\frac{x^2}{n^2},$$
we obtain
$$\sum_{i=1}^na_ib_i\leq x-\frac{x^2}{n}.$$
The right-hand side is monotonically increasing over $x\in[0,\frac{n}{2}]$. Therefore it is bounded by its endpoint value at $x=1$ so long as $n\geq 2$. Therefore
$$\sum_{i=1}^na_ib_i\leq 1-\frac{1}{n}.$$
For all three inequalities to take equal sign, we have $b_i=1-a_i$, $a_i=\frac{x}{n}$ and $x=1$. Therefore $a_i=\frac{1}{n}$ and $b_i=\frac{n-1}{n}$. Since equality is achievable, the upper bound is the maximum.