I flip a coin for $N$ times. I stop the flipping until I get 4 consecutive heads. Let $X=P(N\leq6)$.
On the other hand, I flip the coin for exactly 6 times. Once I finish all the flips, I check whether I got 4 consecutive heads. Let $Y=P(4$ consecutive Heads in 6 Flips$)$.
Is $Y=X?$
Attempt:
Yes, I think Y=X. Since $X=P(n\leq6)=P(n=1)+P(n=2)+...+P(n=6)$,, for each term, say $P(n=5)$, it would be {dont_care x1}{HHHH}. This is same as {dont_care x1}{HHHH}{dont_care x1}. When you add up all the terms in $X$ (i.e., n=1, n=2... and so on), it should give you $Y$.
What do you guys think?
The one direction: If $N\le 6$ occurred, this implies that "$4$ consecutive Heads in the first $6$ Flips" indeed occurred! This shows (in your notation) that $$X\ge Y$$
The converse direction: If "$4$ consecutive Heads in the first $6$ Flips" occurred this implies that $N\le 6$ occurred. This shows that $$X\le Y$$ Putting these together, you have that these two events are equivalent (i.e. $N\le 6$ occurs iff "$4$ consecutive Heads in the first $6$ Flips" occurs) and therefore you obtain $X=Y$.