In a vectorial space with N dimensions, let $\vec{v}$ and $\vec{w}$ be two vectors such as :
(1) $\forall i \le N, \frac{1}{\delta_i} \le v_i \le \delta_i$ (with $\delta_i \ge 1$)
(2) $\forall i \le N, \frac{1}{\lambda_i} \le w_i \le \lambda_i$ (with $\lambda_i \ge 1$)
What is the maximum of $H=\frac{\vec{v}.\vec{w}}{||\vec{v}||_1||\vec{w}||_1} = \frac{\sum_i{v_i.w_i}}{\sum_i{v_i}\sum_i{w_i}}$ ?
Here is what I have found so far (after several days...) :
I) I proved that the maximum can always be reached for $w_i$ and $v_i$ all equal to extrema ($\delta_i$ or $\frac{1}{\delta_i}$ for $v_i$ , $\lambda_i$ or $\frac{1}{\lambda_i}$ for $w_i$).
Proof is obtained by noticing that $\frac{\partial H}{\partial v_i} \ge 0 \iff w_i \ge \frac{\sum_j{v_jw_j}}{\sum_j{v_j}} $ (A)
So, at the maximum, either $v_i$ is on an extrema or $\frac{\partial H}{\partial v_i}=0$ and in that case, you note that (A) remains true if you change $v_i$ to any possible value so H as a function of $v_i$ is constant. So, we can set $v_i =\delta_i$ for instance while remaining on the maximum.
Question 1 : Can we prove the property (B) : $\forall i , [ v_i=\delta_i \text{ and } w_i=\lambda_i ] \text{ or }[ v_i=\frac{1}{\delta_i} \text{ and } w_i=\frac{1}{\lambda_i ]}] $ (values are in phase).
Question 2 : Can we devise an algorithm to get the $v_i$ and $w_i$ that maximize H ?
A Different approach (for your curiosity)) When $\forall i , \delta_i=\delta \text{ and } \lambda_i=\lambda$, the problem is much easier.We can also find an upper bound for H which is very simple :
(C) $H \le \frac{1}{N}\frac{\lambda \delta+1}{\lambda+\delta} $
Proof : In that case, (A) is true (easily demonstrable). Let P be the number of i where $v_i=\delta$. Let $t=\frac{P}{N}$.
$H(t)=\frac{t \lambda \delta+\frac{1-t}{\lambda \delta}}{(t\delta+\frac{1-t}{\delta})(t\lambda+\frac{1-t}{\lambda})}$
You can differentiate to get the maximum ($t_M=\frac{1}{1+\lambda \delta}$) and note that $H(t_M)=\frac{1}{N}\frac{\lambda \delta+1}{\lambda+\delta}$
remark : t has been considered as a real number while it can only take N+1 values of the form $\frac{P}{N}$ So we only get an upper bound.
I wondered if there is a formula analogous to (C) for the general case (with different $\lambda_i$ and $\delta_i$)
What I have tried :
In order to answer that question, I have first tried a simpler problem : I have tried to make a similar demonstration that the one leading to (C) for a slightly more complicated case where there are a partition of the indexes in 2 sets. In the first set, I have $\lambda_i=\lambda_A$ and $\delta_i=\delta_A$. In the other set, I have $\lambda_i=\lambda_B$ and $\delta_i=\delta_B$.
I have considered (A) true and considered the ratio of indexes in each subset where the values are on their maximum. H can be written as a function of those 2 ratios s and t :
$H(t,s)=2.\frac{t \lambda_A \delta_A+\frac{1-t}{\lambda_A \delta_A}+s \lambda_B \delta_B+\frac{1-s}{\lambda_B \delta_B}}{(t\delta_A+\frac{1-t}{\delta_A}+s\delta_B+\frac{1-s}{\delta_B})(t\lambda_A+\frac{1-t}{\lambda_A}+s\lambda_B+\frac{1-s}{\lambda_B})}$
Using a tool like gnuplot, I can see that the maximum is always obtained when s=0, s=1, t=0 or t=1.But, even in that simpler case, writing $\frac{\partial H(t,0)}{t}=0$ leads to 2nd degree equation in t which don't seem to be easy to simplify.