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?
-
$\begingroup$ 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. $\endgroup$– SediJul 2, 2015 at 11:10
-
$\begingroup$ 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$. $\endgroup$– Michael GrantJul 2, 2015 at 12:54
-
$\begingroup$ 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. $\endgroup$– Michael GrantJul 3, 2015 at 14:15
3 Answers
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$
-
$\begingroup$ 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 $\endgroup$– SediJul 2, 2015 at 15:48
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).
-
$\begingroup$ Dear Silvia, I don't know what do you mean by plotting it? Do you mean plotting $S$ set?. $\endgroup$– SediJul 3, 2015 at 7:34
-
$\begingroup$ @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$. $\endgroup$ Jul 3, 2015 at 10:50
-
$\begingroup$ @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). $\endgroup$ Jul 3, 2015 at 10:55
-
1$\begingroup$ @ Dear Patrick, I am sorry for the mistake of spelling your surname. I tried to plot in Matlab. It seems it's not convex. $\endgroup$– SediJul 7, 2015 at 10:40
(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$
-
$\begingroup$ 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$? $\endgroup$– SediJul 2, 2015 at 17:17
-
$\begingroup$ @Sedi : I suggest you plot it again and see for yourself! $\endgroup$ Jul 2, 2015 at 19:45