# Do the classes $P$ and $NP$ include problems faster then polynomial?

I have being reading up on complexity classes (in Rieffel & Polak, 2011; pg149). I am slightly confused about something. Does for example $P$ (DTime($n^k$)) include all problems that can be solved faster then polynomial in time (e.g. logarithmic) on a deterministic Turing? And likewise for e.g. PSpace (DSpace($n^k$)) and NP (NDTime($n^k$)) etc.?

## migrated from cstheory.stackexchange.comMay 15 '18 at 0:43

This question came from our site for theoretical computer scientists and researchers in related fields.

We have $$\mathsf{P} = \bigcup_{k \in \mathbb{N}} DTIME(n^k)$$ And e.g. $\log n \in \mathcal{O}(n)$. Thus, problems which are solvable in deterministic logarithmic time are in $\mathsf{P}$ since they are in $DTIME(n)$.