Given the function:
$$
f(x) = \begin{cases} 0 & x<0, \\ a(b-x) & 0\le x\le b, \\ 0 & b where $a, b ∈ (0, ∞)$. We also know that $\operatorname{E}(X) = 1$. I need to find out $a,b$ and the distribution function. I made an equation system using $\operatorname{E}(X)=1$ and $F(X)=1$ from which I got $a = 2/9$ and $b = 3$, but I'm not really sure if my method is correct and I'm a bit lost on how to calculate the distribution function. Any help is greatly appreciated! :) $$\operatorname{E}(X)=\int_0^b y f(y) \,dy,$$
This gave me $ab^3=6$. $$F(X)=\int_0^b f(y) \, dy$$
This gave me $ab^2=2$.