One form of Jensen's inequality is

If $X$ is a random variable and $g$ is a convex function, then $\mathbb{E}(g(X))\geq g(\mathbb{E}(X))$.

Just out of curiosity, when do we have equality? If and only if $g$ is constant?

  • 12
    $\begingroup$ Also if $g$ is affine. $\endgroup$
    – hardmath
    Jan 5, 2014 at 19:40
  • 10
    $\begingroup$ And/or $X$ constant almost surely. $\endgroup$
    – Did
    Jan 5, 2014 at 19:45
  • 6
    $\begingroup$ I think an if and only if condition would be: there is equality iff there exists an interval A such that g is affine on A, and X belongs to A almost surely. $\endgroup$
    – D. Thomine
    Nov 20, 2014 at 22:01
  • 2
    $\begingroup$ math.stackexchange.com/questions/1160095/… $\endgroup$ May 15, 2020 at 14:39
  • $\begingroup$ An example of X being constant almost surely is KL(p||q)=0 iff p=q almost surely. Here g is -ln() so can't be affine. The constant must be one (almost surely) due to normalization. $\endgroup$ Mar 15, 2022 at 7:18

1 Answer 1


Just for the sake of having an "answered" question (thanks to @hardmath and @Did), Jensen's inequality is equality when $g$ is affine or $X$ is constant almost surely.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .