A way to avoid using pre-knowledge about Beta integrals (for a more conceptual explanation, see the second part of this post) is to compute the generating function of $X$, that is,
$$
\mathbb E(s^X)=\sum_{k=0}^ns^k\mathbb P(X=k)=\int_0^1\sum_{k=0}^n\binom{n}ku^k(1-u)^{n-k}s^k\mathrm du.
$$
By the binomial theorem,
$$
\sum_{k=0}^n\binom{n}k(su)^k(1-u)^{n-k}=(1-(1-s)u)^n,
$$
hence
$$
\mathbb E(s^X)=\int_0^1(1-(1-s)u)^n\mathrm du\stackrel{[v=1-(1-s)u]}{=}\frac1{1-s}\int_s^1v^n\mathrm dv=\frac{1-s^{n+1}}{(n+1)(1-s)},
$$
that is,
$$
\mathbb E(s^X)=\frac1{n+1}\sum_{k=0}^ns^k.
$$
This formula should make apparent the fact that $X$ is uniform on $\{0,1,2,\ldots,n\}$...
...But the "real" reason why $X$ is uniform might be the following.
First, the distribution of a sum of i.i.d. Bernoulli random variables is binomial. Second, if $V$ is uniform on $[0,1]$, the random variable $\mathbf 1_{V\leqslant u}$ is Bernoulli with parameter $u$. Hence, if $(U_i)_{1\leqslant i\leqslant n}$ is i.i.d. uniform on $[0,1]$, the random variable $\sum\limits_{i=1}^n\mathbf 1_{U_i\leqslant u}$ is binomial with parameter $(n,u)$.
Thus, $X$ may be realized as $X=\sum\limits_{i=1}^n\mathbf 1_{U_i\leqslant U_{n+1}}$ where $(U_i)_{1\leqslant i\leqslant n+1}$ is i.i.d. uniform on $[0,1]$. The event $[X=k]$ occurs when $U_{n+1}$ is the $(k+1)$th value in the ordered sample $(U_{(i)})_{1\leqslant i\leqslant n+1}$. By exchangeability of the distribution of $(U_i)_{1\leqslant i\leqslant n+1}$, $U_{n+1}$ has as much chances to be at each rank from $1$ to $n+1$. This fact means exactly that $X$ is indeed uniform on $\{0,1,2,\ldots,n\}$.
$\textbf{hint}$
$$
F(a) = P(X\leq a)
$$
Where $F(X)$ is the cdf.
The following is how to compute the cdf from a given pdf $f(x)$
$$
F(a) = \int^{a}_{x_{min}}f(x)dx
$$
where the minimum of your support of the pdf is $x_{min}$ i.e for uniform random variable between 0 and 1, $x_{min}$ = 0.
Can you see how you can solve your problem?
it doesn't seem right generally and by that I mean
$f_Z(z) = \begin{cases}{
z, \ \ \ \ 0\leq z < 1 \\
2-z, \ \ \ \ 1\leq z\leq 2 \\
0, \ \ \ \ \text{otherwise}}
\end{cases}
$
ps. can someone reformat this horredous expression for me :).
So can you take it from there?
Best Answer
You are confusing real and complex exponentials, and the Jacobian formula you cite applies to real exponentials. Here $z$ is a complex-valued random variable and whether $z$ has a density or not depends on the target space one considers and the reference measure one puts on it. As a random variable with values in $\mathbb C\sim\mathbb R^2$ whose Borel sigma-algebra is endowed with the two-dimensional Lebesgue measure $\lambda_2$, $z$ has no density since $z\in S^1$ almost surely where the unit circle $S^1$ is such that $\lambda_2(S^1)=0$. But one can also consider $z$ as a random variable with values in $S^1$, whose Borel sigma-algebra is endowed with its own one-dimensional uniform measure $\sigma_1$. Then $z$ has density $1$ with respect to $\sigma_1$.