conversion of distribution function Find distribution function  $F_Y(y)$

$$F_X(x) = \left\{ \begin{array}{ll}
         \frac{x}{\theta} &amp;  \  0\leq x \leq \theta;\\
        1 &amp; x \geq \theta \end{array} \right.  $$

Given that $Y=\min(X,\frac{\theta}{2})$

Can anyone please explain me how we convert distribution function?

Edit: I don't want to solve this particular problem, I want to know how these types of problems are solved.

Edit 2:  If necessary one can change the question to another random variable $Y$ or to a different distribution function $F_X(x)$ so that I can understand more about my problem.
They're solved mostly by definition-chasing.

$F_Y(y) = \Pr(Y\le y)$.  That is a definition.

$\Pr(Y\le y) = \Pr(\min\{X,\theta/2\}\le y)$.  That is a definition.

$\min\{X,\theta/2\}\le y$ if and only if $X\le y\text{ or }\theta/2\le y$.  That is an immediate corollary of a definition.  Thus we have
$$
F_Y(y) = \begin{cases} 1 &amp; \text{if }y\ge\theta/2, \\ ? &amp; \text{otherwise}. \end{cases}
$$
So suppose $0\le y &lt; \theta/2$.  Then $\min\{X,\theta/2\}\le y$ if and only if $X\le y$, and the probability of that is $y/\theta$.  Si
$$
F_Y(y) = \begin{cases} 1 &amp; \text{if }y\ge\theta/2, \\ y/\theta &amp; \text{if }0\le y &lt;\theta/2,  \\ ? &amp; \text{otherwise}. \end{cases}
$$
It's not hard to see why the "otherwise" value must be $0$.

Don't try to solve problems like this by applying an algorithm.  Use logic.
For $y &lt; \theta/2$, $F_Y = F_X$ is the same since $Y = X$. We see that for $y \geq \theta/2$, $F_Y = 1$ since all values of $Y$ are less than or equal to $\theta/2$.