Consider an event such that the time between consecutive events is exponentially distributed with a mean of $1$ time unit. After each event, there is a $1/2$ chance of no more events occurring. How does one find the variance of the time it takes until the final event occurs?
To my understanding, the time until the nth event is a gamma distribution with $k=n, \theta=1$, giving a mean of $k\theta=n$ and variance of $k\theta^2=n$. This is, of course, before considering the fact that events eventually cease, and that the final event is the one of interest. As each event has a 1/2 chance of being the final one, that gives a geometric distribution with a mean of $2$ events occurring, and variance of $(1-1/2)/(1/2)^2=2$. Now, I believe the mean time until the final event can be obtained by essentially setting the $n$ for the gamma distribution to the mean of the geometric one, giving a mean of $2$, but I am unsure as to how to determine variance.
It appears the correct variance is $4$, but I do not know how this is obtained.
The number of events is $1+N$ where $N \sim \text{Geometric}(1/2)$. So we have to wait $N$ times (assuming the first event occurs immediately).
If there are $n+1$ events (i.e., we have to wait $n$ times), then as you said the total waiting time has the distribution $\text{Gamma}(n,1)$. But since the number of events is random, the total waiting time is $T \sim \text{Gamma}(N,1)$.
So to compute the variance of $T$, we need to use the Law of Total Variance. This says that: $$\text{Var}(T) = \mathbb{E}[\text{Var}(T \mid N)] + \text{Var}(\mathbb{E}[T \mid N]).$$ As you noted, the variance of the $\text{Gamma}(n,1)$ distribution is $n$, so $\text{Var}(T\mid N) = N$. So the first term becomes $\mathbb{E}[N] = \frac{1}{1/2} = 2$.
You also noted the mean of the $\text{Gamma}(n,1)$ distribution is $n$, so $\mathbb{E}[T \mid N] = N$. Hence the second term becoesm $\text{Var}(N) = \frac{1-1/2}{(1/2)^2}=\frac{1/2}{1/4}=2.$
Adding these together we get $\text{Var}(T) = 4$.