Let Y be a random variable with mean μ and variance σ^2 where the support is (0, ∞). Suppose you are offered to play a game where you choose a number z between (0, ∞). If a realization of the random variable y is greater than z then you win $z, otherwise you lose z dollars.
a. What value of z maximizes your expected gain? Can this maximum ever result in a loss? following is my work:
Let g(z) denote the expected gain,
g(z) = z(1-F_{y}(z))-zF_{y}(z)
take diervative with respect to z,
g′(z) = ((dg(z))/(dz))=1-F_{y}(z)-z∗f_{y}(z)-z∗f_{y}(z)-F_{y}(z) = 1-2F_{y}(z)-2z∗f_{y}(z)
let g′(z) = 0,
1 = 2F_{y}(z)+2z∗f_{y}(z)
F(z) = (1/2)-z∗f_{y}(z)
replace back to g(z)
g(z) = z(1-(1/2)-z∗f_{y}(z))-z((1/2)-z∗f_{y}(z)) = 2z²∗f_{y}(z)
F is the cdf, f is the pdf.
I do not know how to use the mean and variance of Y, the problem is we do not know the distribution of Y.
Now part b:
b. How large is the maximum expected gain for if Y ∼ exponential(λ).
My work again,
f_{y}(y)=λe^{-λy}
F_{y}(y)=1-e^{-λy}
and subs into g′(z)=0⇒1=2F_{y}(z)+2z∗f_{y}(z)
1=2(1-e^{-λz})+2z∗λe^{-λz}
and solve for z, I got z=((1-W((e/2)))/λ)≈((0.314923)/λ)
and replace this into g(z)=2z²∗f_{y}(z),
I got ((2e^{W((e/2))-1}(1-W((e/2)))²)/λ)≈((0.14477)/λ)
I do not think this is quite right.
Any suggestion will be appreciated! Thanks in advance.
Assume that $X$ is a continuous random variable.
The expected gain is, as you say LaTExlessly, $z(1-F(z))-zF(z) = z(1-2F(z)) = g(z)$. As Neil pointed out to you, this is $0$ when $z$ equals the median $m$. For $z > m$, $F(z) > \frac 12$ and so $g(z) < 0$. Since $g(0) = 0$, the question is, what is the behavior of $g(z)$ in the interval $(0,m)$? In this interval, $z>0$ and $F(z) < \frac 12$ and so $g(z) > 0$. Thus $g(z)$ does indeed have a positive maximum in $(0,m)$. The harder question is how can we determine the location of this maximum from knowledge only of the mean and variance of $X$.
It is known that the difference between the mean $\mu$ and the median $m$ is no larger than the standard deviation $\sigma$. See for example here or there. Thus, if $\mu>\sigma$, we can choose $z = \mu-\sigma > 0$ and be guaranteed a nonnegative (but not necessarily maximal) expected gain.