We have a set of positive random variables $\boldsymbol X=\{X\_1, X\_2,\ldots\}$, where $X\_1, X\_2,\ldots$, are independent and identically distributed (i.i.d.). The CDF $F(x)$ and PDF $f(x)$ for $X\_i$ are known in advance.


Define $S\_n=\sum\_{i=1}^nX\_i$. 


As we can see $\boldsymbol X$ can be viewed as inter-arrival times for a renewal process, and $S\_n$ denotes each arrival epoch.


Next we define a variable $K$: $K=\inf\, \{n\mid S\_n>T\}$ (or $K=\min\, \{n\mid S\_n > T\}$), where $T$ is a constant. 


Then 


1. what is the distribution of $K$?
2. what is the distribution of $S\_K$?


I already know that the PDF for $S\_n$, denoted by $f\_n$, can be computed by $f\_n=f^{\*n}=f\*f\*\cdots \*f$, the $n$-fold convolution power of $f(x)$. By Laplace Transform, we can convert the convolution to multiplication.



Distribution of bounded summation of i.i.d random variables
The CDF of $K$ is 
$$ P(K \le n) = P(S\_n > T) = \int\_{T}^\infty dt\; f\_n(t)$$
The CDF of $S\_K$ (for $s > T$) is
$$\eqalign{P(S\_K \le s) &= \sum\_{n=1}^\infty P(K = n, S\_n \le s) = \sum\_{n=1}^\infty P(S\_{n-1} \le T, T < S\_n \le s)\cr &= \sum\_{n=1}^\infty \int\_0^T dt\; f\_{n-1}(t) \int\_T^s dr\; f(r-t)}$$


EDIT: the $n=1$ term needs to be modified since $S\_0 = 0$ doesn't have a density.
So (assuming of course $T > 0$) it's 
$$P(S\_K \le s) = \int\_T^s dr\; f(r) + \sum\_{n=2}^\infty \int\_0^T dt\; f\_{n-1}(t) \int\_T^s dr\; f(r-t)$$


