How do I show that two random variables have the same cumulative distribution function? Let $X$ be a random variable on $\mathbb N_0$ and $Y$ a uniformly distributed random variable on $[0,1]$, independent of $X$. Now define the random variable $$Z:=\inf\{n\in \mathbb N_0 : Y < \mathbb P(X \leq n)\}.$$
How can I show that the cdf of $X$ and $Z$ are the same? Or how do I approach problems like these in general? 
 A: What you want is to show 
$$P[Z \leq k] = P[X \leq k] \quad \forall k \in \mathbb{N}_0$$
Here are two tips. The event
$$\inf \{n\in \mathbb{N}_0: Y < P(X \leq n)\} \leq k $$
is the same as saying there exists an $n \leq k$ such that $\{Y < P(X \leq n)\}$ which is equivalent to 
$$ \bigcup_{n=1}^k \{Y \leq P(X\leq n)\}$$
The second tip is to use monotonicity of $P(X \leq n)$. Does the above expression simplify to something easier?
Let me know if you need more help.
Edit: You had asked for help in identifying the trick to these kind of problems. Well, the trick is to eliminate the infimum and supremum by writing in words what the event really is. If the phrase "for every" comes up, you can expect an intersection of events. If you write "for some" or "there exists", then it is a union. Sometimes the complementary event may be easier to work with also. Consider negating whatever statement you had and the probability will be 1 minus that.
Another helpful trick is that 
$$X_i \leq a \quad \forall i\in A \iff \sup_{i\in A}X_i \leq a$$
$$X_i \geq a \quad \forall i\in A \iff \inf_{i\in A}X_i \geq a$$
