3

Is the set, $S=\{\bf x \in \mathbb{R}^n: \sum_{i=1}^{n} \frac{e^{x_i}}{1+e^{x_i}}=1 \}$, a convex set?

Sedi
  • 105
  • For $n=2$, the set $S$ is equal to $S={\bf x \in \mathbb{R}^2: x_1+x_2=0}$ which is convex. But I am not able to show it in higher dimension. – Sedi Jul 02 '15 at 11:10
  • Nonlinear equations are almost always not convex, so much so that you should never even bother to hope they are. There really are no exceptions to this rule in practice; the only actual exceptions are manufactured, like $x^2=0$. – Michael Grant Jul 02 '15 at 12:54
  • Your edit changes nothing. It's still a nonlinear equality constraint. There is no reason whatsoever for you to have hope this could be convex. – Michael Grant Jul 03 '15 at 14:15

3 Answers3

2

It is not a convex set. I have the following counterexample for $n=2$ (calculated by hand, so it might be wrong):

Take $a=(\ln(\frac{1}{4}),\ln(\frac{2}{5}))$,$b=(\ln(\frac{2}{5}), \ln(\frac{1}{4}))$. This gives us $\frac{1}{2}(a+b) = (\frac{1}{2}\ln(\frac{1}{10}),\frac{1}{2}\ln(\frac{1}{10}))$

We have $a,b \in S$ but $\frac{1}{2}(a+b) \notin S$

supinf
  • 13,433
  • I made a mistake in the question having $1-e^{x_i}$ in the denominator, but the correct one is $1+e^{x_i}$, which I edited. Thank you for you answer which made me understand my mistake in writing the question – Sedi Jul 02 '15 at 15:48
1

This should help. It is always a good idea to plot. Note : $1$-dimensional convex sets are subsets of lines. You don't expect something having to do with exponentials to be a line segment (a priori it could have been, but your first guess should be no).

  • Dear Silvia, I don't know what do you mean by plotting it? Do you mean plotting $S$ set?. – Sedi Jul 03 '15 at 07:34
  • @Sedi : It'd be nice if you could type my name correctly, but whatever (my first name is Patrick by the way, not Silva). What I meant is to go on Wolfram Alpha using my link and typing

    Plot[e^x/(1+e^x) + e^y/(1+e^y) == 1,{x,-1,1},{y,-1,1}]

    this instead (I just changed the signs). You can type

    Plot[e^x/(1+e^x) + e^y/(1+e^y) + e^z/(1+e^z) == 1,{x,-1,1},{y,-1,1},{z,-1,1}]

    too and see that your conjecture is true when $n=2$ but not for $n > 2$.

    – Patrick Da Silva Jul 03 '15 at 10:50
  • @Sedi : I tried plotting on WolframAlpha and for some reason it can't do the 3d plot, I don't know why. But Mathematica can definitely do it, if you have that (or any other plotting software). – Patrick Da Silva Jul 03 '15 at 10:55
  • 1
    @ Dear Patrick, I am sorry for the mistake of spelling your surname. I tried to plot in Matlab. It seems it's not convex. – Sedi Jul 07 '15 at 10:40
1

(Because the question changed ( $\frac{e^x}{1-e^x}$ became $\frac{e^x}{1+e^x}$), i decided to write another answer)

It is still not convex. Your calculations for $n=2$ are correct, but e.g. for $n=3$ it is not correct, here is another counterexample (again, calculated by hand):

Take $a=(\ln(\frac{1}{2}),\ln(\frac{1}{5}),0)$,$b=(\ln(\frac{1}{5}), \ln(\frac{1}{2}),0)$. This gives us $\frac{1}{2}(a+b) = (\frac{1}{2}\ln(\frac{1}{10}),\frac{1}{2}\ln(\frac{1}{10}),0)$

We have $a,b \in S$ but $\frac{1}{2}(a+b) \notin S$

supinf
  • 13,433
  • Yes, you are right, I also find in $R^3$ if we choose point along any axis it will be a counter example. But what if the domain of vector $x$ will be restricted to be only in any of the 1/8 possible portion in $R^3$? – Sedi Jul 02 '15 at 17:17
  • @Sedi : I suggest you plot it again and see for yourself! – Patrick Da Silva Jul 02 '15 at 19:45