# How a NTM guessing depends on the input?

After looking at the definition of nondeterministic TMs, it seems that, while guessing, the machine could go to at most $|Q|\times | \Gamma |$ configurations, being in a particular one.

However, if we look at several concrete NTMs, the guessing part depends on the size of the input, i.e. it's not bounded. For instance, let's take this machine finding Hamiltonian Path here: How does this non-deterministic algorithm to find if a Hamiltonian path exists work?

A part of the algorithm says "Each number in this list is non-deterministically selected to be from 1 to x.", where x is the number of nodes of the graph(and we may have arbitrarily big number of nodes).

I know the answer is perhaps trivial, but I couldn't find it.

Suppose that the input has length $n$, and suppose that the machine already knows $n$. In order to non-deterministically choose a number from 1 to $n$, it performs the following algorithm:
• Choose $m = \lceil \log_2 n \rceil$ bits non-deterministically, and interpret them as a number $x$ from $0$ to $2^m-1$.
• Increase $x$ by one.
• Reject if $x > n$.