Gibbs' inequality is equivalent to:


\begin{equation}
\sum\_{i} \ln q\_i^{p\_i}-\ln p\_i^{p\_i} \leq 0
\end{equation}


where $p\_i,q\_i \in [0,1]$ and $\sum\_i p\_i = \sum\_i q\_i=1$.


Now, a friend of mine suggested that assuming $p\_i,q\_i \in [0,1]$ and $\sum\_i p\_i = \sum\_i q\_i=1$, Gibbs' inequality implies:


\begin{equation}
\sum\_{i} q\_i^{p\_i}-p\_i^{p\_i} \leq 0
\end{equation}


Right now I doubt this is true but I can't think of a counter-example. 


**Update**: I have found experimental evidence for my friends' conjecture
by running the following Python code:



```
import numpy as np

count = 0

for i in range(10000):
    # randomly create distributions:
    P, Q = np.random.rand(10), np.random.rand(10)
    p, q = P/np.sum(P), Q/np.sum(Q)

    M = np.sum([p[i]**p[i] for i in range(10)])
    m = np.sum([q[i]**p[i] for i in range(10)])

    if m <= M:
        count+=1

```

The inequality was satisfied every single time I ran this script. 



A corollary of Gibbs' inequality
That does not seem to be true. Here is how you can build a counterexample: Define $F(q) = \sum\_i q\_i^{p\_i} - p\_i^{p\_i}$ and note that $F(p)=0$. To find $q$ such that $F(q)> 0$ try to set $\tilde q = p + t \nabla F(p) = p+tp^p$ (exponentiation applied componentwise) for some small $t$, and renormalize to get $q = \frac{\tilde q}{\sum\_i \tilde q\_i}$. I used a random $p$, $t=0.01$ and got



```
p =
 0.1532696579656778
 0.2067195573676092
 0.0459491849155964
 0.1571139939276139
 0.0425424874234802
 0.0322607550224537
 0.2054340486142850
 0.0106719016346504
 0.1310342405827529
 0.0150041725458808

```

and 



```
q =

 0.1485356620020452
 0.1976565884683083
 0.0504718308948335
 0.1520644631305625
 0.0473824833517361
 0.0380756305476259
 0.1964738847480934
 0.0186616781313398 
 0.1281407424548285
 0.0225370362706270

```

with $F(q) \approx 0.001>0$


