I am working on the following question.

We toss a coin $k$ times with the probability of getting heads in each toss being $p$.

I also define a random variable

$Y =

\begin{cases}

5^{k} & \text{if heads doesn't appear in the k tosses} \\ 5^{i} & \text{if first heads appear in the i-th toss for } 1 \leq i \leq k

\end{cases}$

Let's define each case as $Y_{1} - \text{not getting a heads on the first k tosses and } Y_{2} - \text{getting the first heads on the i-th toss}$

Then, $p(y_{1_{i}} \in Y_{1}) = (1-p)^{k}, \text{whereas } p(y_{2_{i}} \in Y_{2}) = (1-p)^{i-1}p$, by following the Geometric distribution.

Then when defining the pmf of $y_{i} \in Y, p(y_{i} \in Y) = p(y_{1_{i}} \in Y_{1}) + p(y_{2_{i}} \in Y_{2}) $ which gives me

$p(y_{i} = 5^{i}) = (1-p)^{k} + (1-p)^{i-1}p$ which looks kind of wrong to me...

Could someone point me in the right direction?

Thanks a lot