A curious symmetric function crossed my way in some quantum mechanics calculations, and I'm interested its maximum value (for which I do have a conjecture).


(The question was first asked at [math.SE](https://math.stackexchange.com/questions/958395/maximizing-curious-symmetric-function-from-simple-combinatorics "math.SE"), where (even after 2.5months and 2 rounds of bounty) there is only one special-case-solution and one additional insight on concavity. So I'm hoping to get some more insights here).


The problem
-----------


There are $n$ different objects $A\_1,...,A\_n$, and there are sets containing $m$ different $A\_i$s: $C\_i=(A\_{i\_1}, A\_{i\_2}, ..., A\_{i\_m})$. There are $i\_{max}=\binom{n}{m}$ different combinations $C\_i$. Each combination $C\_i$ has a probability $p\_i$ (with $\sum\_{i=1}^{i\_{max}} p\_i=1$).


**Defining the function**


For a given pair of objects $A\_k$ and $A\_l$:


* $f\_1(k,l)$ contains all probabilities $p\_i$ of the sets $C\_i$, which contains both objects $A\_k$ and $A\_l$.
* $f\_2(k,l)$ contains all probabilities $p\_i$ of the sets $C\_i$, which contains either object $A\_k$ or $A\_l$ (if it contains both elements, we add $p\_i$ twice).
* $F(k,l)=\frac{f\_1(k,l)}{f\_2(k,l)}$


With that, we get the main-function
$$D^{(n,m)}=\sum\_{k=1}^{n-1} \sum\_{l=k+1}^{n} F(k,l)$$



> 
> What is the maximum of $D^{(n,m)}$, given that the sum of all probabilities $p\_i$ is 1?
> 
> 
> 


**Alternative notation**


As pointed out by [Wolfgang](https://mathoverflow.net/users/29783/wolfgang) in a comment, the function $D^{(n,m)}$ can be written in a more intuitive way by the form:
$$D^{(n,m)}=\sum\_{i<j}\frac{\sum \{p\_I|I \ni x,y \}}{\sum \{p\_I|I \ni x\} + \sum \{p\_I|I \ni y \}}$$
where $I$ denotes any m-subset of [n].


Special cases
-------------


**n=2, m=2**


This is a trivial case. We have two objects $A\_1$ and $A\_2$, and only one set of combinations $C\_1=(A\_1,A\_2)$ with $p\_1$.


Thus $f\_1(1,2)=p\_1$, $f\_2(1,2)=p\_1+p\_1$. This leads to $D^{(2,2)}=F(1,2)=\frac{1}{2}$.


Every other case with $n=m$ can be solved easily by $D^{(n,m)}=\frac{1}{n}$




---


**n=3, m=2**


This case is simple (but not trivial) and I found a solution:


We have n=3 objects $A\_1$, $A\_2$ and $A\_3$, and combinations $C\_i$ of m=2 objects $C\_1$=($A\_1$, $A\_2$), $C\_2$=($A\_1$, $A\_3$), $C\_3$=($A\_2$, $A\_3$), with $p\_1$, $p\_2$, $p\_3$ respectivly.


For k=1, l=2 we have $f\_1(1,2)=p\_1$ (because only $C\_1$ contains both $A\_1$ and $A\_2$), and $f\_2(1,2)=2p\_1+p\_2+p\_3$ (because $A\_1$ is contained in $C\_1$ and $C\_2$ and $A\_2$ is in $C\_1$ and $C\_3$).


So we get
$$D^{(3,2)}=F(1,2) + F(1,3) + F(2,3) = \frac{p\_1}{2p\_1+p\_2+p\_3} + \frac{p\_2}{p\_1+2p\_2+p\_3} + \frac{p\_3}{p\_1+p\_2+2p\_3}$$
A maximum can be found easily (due to normalisation of $p\_1+p\_2+p\_3=1$):
$$D^{(3,2)} = \frac{p\_1}{1+p\_1} + \frac{p\_2}{1+p\_2} + \frac{p\_3}{1+p\_3}$$ so each term can be maximized individually, which gives $D^{(3,2)}=\frac{3}{4}$ for $p\_1=p\_2=p\_3$.




---


**n=4, m=2**


We have four objects $A\_1$, $A\_2$, $A\_3$, $A\_4$, and six combinations $C\_1=(A\_1,A\_2)$, $C\_2=(A\_1,A\_3)$, ..., $C\_6=(A\_3, A\_4)$.


Therefore we get:
$$D^{(4,2)} = \frac{p\_1}{2p\_1+p\_2+p\_3+p\_4+p\_5} + \frac{p\_2}{p\_1+2p\_2+p\_3+p\_4+p\_6} + \frac{p\_3}{p\_1+p\_2+3p\_3+p\_5+p\_6} + \frac{p\_4}{p\_1+p\_2+2p\_4+p\_5+p\_6} + \frac{p\_5}{p\_1+p\_3+p\_4+2p\_5+p\_6} + \frac{p\_6}{p\_2+p\_3+p\_4+p\_5+2p\_6}$$


I was not able to find a method for proving a global maximum.




---


**n=4, m=3**


We have $C\_1=(A\_1,A\_2,A\_3)$, $C\_2=(A\_1,A\_2,A\_4)$, $C\_3=(A\_1,A\_3,A\_4)$, $C\_4=(A\_2,A\_3,A\_4)$, which gives


$$D^{(4,3)}=\frac{p\_1+p\_2}{2p\_1+2p\_2+p\_3+p\_4}+\frac{p\_1+p\_3}{2p\_1+p\_2+2p\_3+p\_4}+\frac{p\_1+p\_4}{2p\_1+p\_2+p\_3+2p\_4}+\frac{p\_2+p\_3}{p\_1+2p\_2+2p\_3+p\_4}+\frac{p\_2+p\_4}{p\_1+2p\_2+p\_3+2p\_4}+\frac{p\_3+p\_4}{p\_1+p\_2+2p\_3+2p\_4}$$


This case can be simplified aswell, similar to $n=3,m=2$ case to
$$D^{(4,3)}=\frac{p\_1+p\_2}{1+p\_1+p\_2}+\frac{p\_1+p\_3}{1+p\_1+p\_3}+\frac{p\_1+p\_4}{1+p\_1+p\_4}+\frac{p\_2+p\_3}{1+p\_2+p\_3}+\frac{p\_2+p\_4}{1+p\_2+p\_4}+\frac{p\_3+p\_4}{1+p\_3+p\_4}$$


but I'm not able to find any further method to calculate the maximum.


Conjecture
----------


The two cases I solved had a maximum at equal $p\_i=\frac{1}{\binom{n}{m}}$. Furthermore, the function $D^{(n,m)}$ is very symmetric, so I expect that the maximum is always at $p\_1=p\_2=...=p\_i$. Numerical search up to n=7 confirms my expectation (but I'm not 100% sure about my Mathematica-based numerical maximization).


Questions
---------


1. How can you prove (or disprove) that the maximum for $D^{(n,m)}$ for arbitrary $n$ and $m$ is always at $p\_1=p\_2=...=p\_i$?
2. Is there literature on similar problems or is this function even known? Has the similarity to the [Shapiro inequality](http://en.wikipedia.org/wiki/Shapiro_inequality) some significance or is it just a coincidence?
3. Is there a better (maybe geometrical) interpretation of this function?
4. Can you find solutions for any other special case than $n=m$ (always trivial) and $n=3,m=2$? (See solution for $m=n-1$ and $m=2, n=4$ at [math.SE](https://math.stackexchange.com/a/979390/157257))



Conjecture on maximum of symmetric combinatoric function
Indeed, I have just made things overly complicated in my approach. Thanks to JiK, I now see it fairly clearly.


Let $(\{S\},P\_S)$ be our probability space and let $X\_k$ be the event $S\ni k$. Let $u\_k=EX\_k$. Note that at each $S$ there are exactly $m$ values $X\_k=1$ and the rest are $0$. What we need to control is just $\sum\_{k,j}E\frac{X\_kX\_j}{u\_k+u\_j}$ (adding a few $\frac 12$'s corresponding to $k=j$ does not hurt). Now write it as
$$
E\int\_0^{\infty}\left[\sum\_k X\_ke^{-u\_kt}\right]^2\,dt\le mE\int\_0^\infty \sum\_kX\_ke^{-2u\_kt}\,dt=\frac {mn}2\,, 
$$
and when all $u\_k$ are equal $m/n$, we have an identity.


**Edit** As NicoDean requested, here is exactly the same proof without the word "probability" (or anything like that).


*1.Setup:* 
We have the set $U$ of all $m$-subsets of $\{1,\dots,n\}$ and with each such subset $S$, a positive number $p\_S$ is associated, so that the sum of all numbers is $1$.


*2.Functions $X\_k$:* 
For $k=1,\dots,n$, define the function $X\_k:U\to\mathbb R$ by $X\_k(S)=1$ if $k\in S$ and $X\_k(S)=0$ if $k\notin S$.


*3.The numerator and the denominator:*
$$
N(k,j)=\sum\_{S:k,j\in S}p\_S=\sum\_{S\in U}p\_SX\_k(S)X\_j(S)
$$
This is exactly what stands in the numerator if $k\ne j$. If $k=j$, then $X\_k(S)^2=X\_k(S)$, so
$$
N(k,k)=\sum\_{S:k\in S}p\_S=\sum\_{S\in U}p\_SX\_k(S)\,,
$$
which is "one half" of the denominator (another half is $N(j,j)$).
We shall also denote $N(k,k)$ by $u\_k$ to make our notation here agree with that in the "probabilistic" version of the argument.


*4.The sum of fractions:*
The sum we want to maximize is $\sigma=\sum\_{k<j}\frac{N(k,j)}{N(k,k)+N(j,j)}$. Note that $\frac{N(k,k)}{N(k,k)+N(k,k)}=\frac 12$ and that the sum over $k>j$ is the same as the sum over $k<j$, so
$$
\Sigma=\frac n2+2\sigma=\sum\_{k,j}\frac{N(k,j)}{N(k,k)+N(j,j)}\,.
$$
At last, to maximize $\Sigma$ is the same as to maximize $\sigma$.


*5.The weighted sum representation:*
We now replace $N(k,j)$ with its sum representation from Part 3 but treat $N(k,k)=u\_k$ and $N(j,j)=u\_j$ as positive numbers. Swapping the order of summation, we get
$$
\Sigma=\sum\_{S\in U}p\_S\sum\_{k,j}\frac{X\_k(S)X\_j(S)}{u\_k+u\_j}\,.
$$


*6.The square formula:*
If we had no denominator in the summands, we could write the inner sum
$\sum\_{k,j}X\_k(S)X\_j(S)$ as $\left[\sum\_{k}X\_k(S)\right]^2$. We could also use this trick if we had $v\_kv\_j$ instead of $\frac{1}{u\_k+u\_j}$, in which case the representation would be $\left[\sum\_{k}X\_k(S)v\_k\right]^2$. Unfortunately, our actual factor (inverse sum) does not look like a product, or does it?


*7.The Cauchy-Gram trick:* While many expressions like the one we have cannot be written as usual products of numbers, one of which depends on $k$ only and one of which depends on $j$ only, they can often be written as a mixture of such products, i.e., as integrals $\int\_a^b v\_k(t)v\_j(t)\,dt$ for some appropriate choice of the functions $v\_k$ and the interval of integration. Note, by the way, that such representation, if it exists, is never unique: you can always make any change of variable in the integral and get a new one.
In this case, the representation we'll get will be $\int\_a^b\left[\sum\_{k}X\_k(S)v\_k(t)\right]^2\,dt$, which often is just as good as a single square.


*8.The exponential functions:* The fact that we need to replace the sum by the product suggests that there will be some exponentiation (or raising to the power, or logarithm) somewhere. To put the parameter to the denominator, the formula $\frac 1u=\int\_0^\infty v(ut)\,dt$ valid for any integrable function $v:[0,+\infty)\to\mathbb R$ with total integral $1$ is often used. Since, as I said, we need to turn the sum into the product, $v(x)=e^{-x}$ becomes a natural choice here. So, putting $v\_k(t)=e^{-u\_kt}$, we get just the representation
$$
\sum\_{k,j}\frac{X\_k(S)X\_j(S)}{u\_k+u\_j}=\int\_0^\infty\left[\sum\_k X\_k(S)e^{-u\_kt}\right]^2\,dt
$$
we need.


*9.The Cauchy (Arithmetic mean-Quadratic mean) inequality:*
It is $\left[\sum\_{i\in I}w\_i\right]^2\le |I|\sum\_{i\in I}w\_i^2$ where $|I|$ is the number of terms in the sum. The equality holds when all terms are equal. Note that we can improve the right hand side a bit if instead of all terms, we count just the non-zero ones. Then the inequality becomes an equality if all non-zero terms are equal.


*10. The final count:*
Applying the Cauchy inequality to our innermost sum and taking into account that for each $S\in U$, we have exactly $m$ values of $k$ for which $X\_k(S)\ne 0$ (namely, $k\in S$, when $X\_k(S)=X\_k(S)^2=1$), we get
$$
\left[\sum\_k X\_k(S)e^{-u\_kt}\right]^2\le m\sum\_k X\_k(S)^2e^{-2u\_kt}\,.
$$
Plugging this estimate into the integral, we estimate the integral for each fixed $S$ by
$$
m\sum\_k X\_k(S)^2\int\_0^\infty e^{-2u\_kt}\,dt=m\sum\_k \frac{X\_k(S)}{2u\_k}\,.
$$
(The square or any other positive power on $X\_k(S)$ can be just ignored because it is always $0$ or $1$).
Finally, summing these estimates with the coefficients $p\_S$ and swapping the order of summation, we get
$$
\Sigma\le m\sum\_k\frac 1{2u\_k}\sum\_{S\in U}p\_SX\_k(S)=m\sum\_k\frac 1{2u\_k}N(k,k)=
m\sum\_k \frac 12=\frac{mn}{2}\,.
$$


