# Conditional Expectation in a Renewal Process

My professor wrote the following statement down as a starting point for a problem that I'm working on, and I don't quite see where it's coming from.

We are told that $$\{N(t); t \ge 0\}$$ is a simple renewal process, where the lengths of its interrenewal intervals have cdf $$F$$. The interrenewal lengths are denoted by $$\{X_k; k\ge 0\}$$. The statement that my professor made was $$\mathbb{E}[N(t)] = \int_{[0,\infty)} \mathbb{E}[N(t) \ |\ X_1 =s] dF(s)$$ I understand that for any random variable $$X$$ with cdf $$F_X$$, $$\mathbb{E}[X] = \int_{(-\infty,\infty)} x dF_X(x)$$ I just don't quite see how we get that conditional expectation inside the integral. I feel like I'm missing some fundamental fact about conditional expectation, rather than some fact about renewal theory. Can anyone help me see what I'm missing?

Starting out with a simpler case, consider a matrix with entries $$a_{ij}$$, where $$1\leq i,j\leq n$$. You can take the average of all the entries "at once" and arrive at $$\textrm{average}=\frac{1}{n^2}\sum_{i,j=1}^n a_{ij}.$$ Or, you can first average the columns and then average the averages: $$\textrm{average of column i} = \frac{1}{n}\sum_{j=1}^n a_{ij},$$ $$\textrm{average of column averages} = \frac{1}{n}\left(\sum_{i=1}^n\frac{1}{n}\sum_{j=1}^n a_{ij}\right).$$ But of course, the two averages turn out to be the same - and this is the law of total expectation (in the discrete case). Indeed, you can think of the column averages as the condition expectation with respect to the column number.