I just finished calculus 1 (derivative and integral) then I take another course on calculus 2. In the video the professor talks about the the series $$\frac{n!}{(\frac{n}{e})^n}$$
He shows the approximation of the numerator ($n!$) and the denominator ($(\frac{n}{e})^n$) he approximates $\log(n!)$ using $$\sum_{k=1}^n\log(k) \approx \int_1^n\log(x) \text{d}x$$
I'm very curious because I think the $\log(n!)$ is a step function. I tried it with graphing calculator here but it shows continuous function. Is the calculator wrong? Because $n!$ has whole number as a domain so $\log(n!)$ should also be a step function?
My second question is can we apply integral to a step function? What is the result different from continuous function, and how can we distinguish. For example when we have $f(x) = x^2$ and we want to do integral with the step domain (whole number) or all the domain?
Here is the video (you can go and view it at 2:30)
I'm a beginner in this field please explain a step by step and beginner friendly to me.
Firstly, $\log(n!)$ is not a step function, because it's not a function defined on (an interval of) the reals; it is defined on a discrete set. A step function, roughly speaking, is a function with a discrete range. This one is a function with a discrete domain.
Secondly, both $\displaystyle\sum_{k=1}^n\log k\;$ and $\displaystyle\int_1^n\log x\,\mathrm d\mkern1mu x\;$ are functions of $n$. Your professor is asserting that these two expressions are equivalent at $\infty$ (denoted $\sim_\infty$) in a very precise sense, not that their values are approximately the same (denoted $\;\approx$), which is not a mathematically defined notion.
The precise definition of equivalence here is that $$\lim_{n\to\infty}\frac{\displaystyle\sum_{k=1}^n\log k}{\displaystyle\int_1^n\log x\,\mathrm d\mkern1mu x}=1.$$
Thus one might say, very very roughly, that $\;\approx\;$ means ‘absolutely almost equal’, while $\;\sim\;$ means ‘comparatively almost equal’.