Let $X$ be distributed uniformly on $[0,2]$ and $f(X) = \beta X$, $0 < \beta <1$. Also, let $f(0) = 0$ and $f(X) < X$ for $X>0$. Note that $c,\beta$ are constants. Then: $$ E[X \vert f(X) \leq c] = \frac{c}{2\beta} $$
My question is how to derive this using the definitions here (and elsewhere). Specifically, $$E[X\vert Y = y] = \int_{-\infty}^\infty x f_{X\vert Y}(x\vert y) dx $$ with $$ f_{X\vert Y}(x\vert y) = \frac{f_{X,Y}(x,y)}{f_Y(y)} $$ where I believe $f_{X,Y}(x,y)$ is the joint distribution of $X$ and $Y$, $f_Y(y)$ is the marginal distribution of $Y$.
My attempt at calculating the expectation was as follows: $$ E[X \vert f(X) \leq c] = E[X \vert \beta X \leq c] = E[X \vert X \leq \frac{c}{\beta}] $$ Then, some steps I am unsure about, $$ E[X \vert X \leq \frac{c}{\beta}] = \int_{0}^{c/\beta}x f_X dx = \int_{0}^{c/\beta}x \frac{1}{2} dx = \frac{c^2}{4b^2} $$ which is not correct... I do get the correct answer from $\int_{0}^{c/\beta} f_X dx$ though, but isn't $E[X] = \int_{-\infty}^\infty x f_X dx$? (see equation $(2)$ at this stackexchange answer
So I guess I am asking two question:
1) How do to evaluate the conditional expecation using the formulas provided at the beginning. (This is my main question)
2) What is the mistake in my approach?
Thank you very much.
You're conditioning on an event $f(X) < c$, which is rather different than conditioning on $Y=c$ for a (continuous) random variable $Y$.
In general, if $A$ is an event with $\mathbb P(A) > 0$ and $I_A$ is its indicator random variable, ($1$ when $A$ is true, $0$ when it's false), and $X$ a random variable such that $\mathbb E[X I_A]$ exists, $$\mathbb E[X | A] = \dfrac{\mathbb E[X I_A]}{\mathbb P(A)}$$
In the case where $A = (\beta X \le c) = (X \le c/\beta)$ (where $\beta > 0$) and $X$ has density $f_X$, this translates to $$E[X |\beta X \le c] = \dfrac{\int_{-\infty}^{c/\beta} x f_X(x)\; dx}{\int_{-\infty}^{c/\beta} f_X(x)\; dx}$$