Find an example such that $X_n\to 0$ in probability but $X_{N(n)}\to 1$ a.s. with $N(n)\to \infty$ It is an exercise from Durrett's probability.

Find an example with $X_n\in \{0,1\}$,$X_n\to 0$ in probability, $N(n)$ increases to infinity a.s. and $X_{N(n)}\to 1$ a.s.

I was thinking that first we divide $[0,1]$ into two equal pieces and let $X_1=1_{[0,\frac{1}{2}]}$ and $X_2=1_{[\frac{1}{2},1]}$. Then we divide $[0,1]$ into four equal pieces and define $X_3=1_{[0,\frac{1}{4}]}$ and $X_4=1_{[\frac{1}{4},\frac{1}{2}]}$ and so on. So we have $$X_{2^n+m}=1_{[\frac{m}{2^n},\frac{m+1}{2^n}]} \text{ for } 1\leq m &lt; n$$

$X_n\to 0$ in probability, but I could not find a subsequence $N(n)$ which satisfies the above condition.
If you have a convergent sequence it implies that all sub-sequences must converge at the same value, because having a sequence with sub-sequences approaching two values would imply that it isn't caunchy (i.e. the points don't get infinitesimally closer as $n\to \infty$) which means it isn't convergent. So either $X_n\to 1$ or $X_{N(n)}\to 0$ not both.
If you have a convergent sequence it implies that all sub-sequences must converge at the same value, because having a sequence with sub-sequences approaching two values would imply that it isn't caunchy (i.e. the points don't get infinitesimally closer as $n\to \infty$) which means it isn't convergent. So either $X_n\to 1$ or $X_{N(n)}\to 0$ not both.