# Give upper bound for random variable

Problem: Suppose $$X$$ is a random variable such that $$E[2^X] = 4$$. Give an upper bound for $$P(X ≥ 3)$$. Justify your answer.

Attempt: I know the following equations
$$P(X \ge 3) \le \frac{E[X]}{3}$$
$$E[g(X)] = \int_{-\infty}^{\infty}{g(x)f_x(x)dx} = 4$$ where $$g(x)=2^x$$
$$E[X] = \int_{-\infty}^{\infty}{xf_x(x)dx}$$

I thought what I could do is take the second equation and solve for $$f_x(x)$$ and then use that in the third equation to get $$E[X]$$, but I don't know how to solve for $$f_x(x)$$. Is there another way to solve this? If this is the correct path, how can I solve for $$f_x(x)$$?

Define a new random variable, $$Y$$, where $$Y=2^X$$. Solving for $$X$$, we get $$X=\frac{\ln Y}{\ln 2}$$. Then $$P(X\geq 3)=P(\frac{\ln Y}{\ln 2} \geq 3) = P(\ln Y \geq 3\ln2) = P(Y \geq \exp\{3\ln2\}).$$
Applying your first inequality, which only applies to non-negative random variables ($$Y=2^X$$ satisfies this), we get $$P(Y \geq \exp\{3\ln2\}) \leq \frac{E(Y)}{\exp\{3\ln2\}}.$$ Substituting in our given value of $$E(Y)$$, we get. $$P(X\geq 3) \leq \frac{4}{\exp\{3\ln2\}}=\frac{1}{2}.$$
@user240935 has already given a direct proof (+1) of the fact that $$P(X\geq 3) \leq \frac 12$$ so here is an alternative way (proof by contradiction) of looking at the matter.
Suppose that $$P(X \geq 3) > \frac 12$$, that is, the total probability mass at $$3$$ or to the right of $$3$$ is greater than $$\frac 12$$. Now, $$Y=2^X$$ is a positive random variable regardless of the distribution of $$X$$, and in the distribution of $$Y = 2^X$$, the total probability mass at $$8$$ or to the right of $$8$$ is more than $$\frac 12$$. Now, $$E[Y]$$ equals the total moment of the probability mass of $$Y$$ about the origin, and since we know that the mass at $$8$$ or to the right of $$8$$ is more than $$\frac 12$$, we can can conclude that just this mass alone contributes at least $$8\times P(Y\geq 3)$$ to the total moment -- exactly $$8\times P(Y\geq 3)$$ if all the probability mass is sitting (as an atom) at $$8$$ and more if the mass is spread out beyond $$8$$. But since $$P(X \geq 3) > \frac 12$$ by assumption, this contribution to the total moment $$E[Y]$$ is at least $$8\times P(X \geq 3) > 4$$ and so $$E[Y]$$ must be even larger, contradicting the known result that $$E[Y]=E[2^X] = 4$$. So, our assumption that $$P(X \geq 3) > \frac 12$$. is incorrect and it must be that $$P(X \geq 3) \leq \frac 12$$.