Pseudopolynomial running time for small input

23 Views Asked by At

I think that I generally understand the concept of pseudopolynomial running time for large input:

e.g. An algorithm that checks whether a given natural number $n$ is prime by testing wheter it is divisible by $2, 3, 4, ... n-1$ one after another has a running time of $\mathcal{O} (n)$. This is exponential in the size of the input, which is $log(n)$ and polynomial in the magnitude of the input, which is $n$.

However, I do not understand what pseudopolynomial means, when the input is small:

e.g. An algorithm wich gets a number of the form $1/n$ as an input and determines whether $1/(1/n)=n$ is a prime by the trying whether $2,3,..., n-1$ divides $n$.

The running time of this algorithm is again $\mathcal{O} (n)$, which is exponential in the size of the input, which is $log(n)$. However, the magnitude of the input would be $1/n$.

Is it in this case really harder to find a pseudopolynomial algorithm than a polynomial algorithm, as $1/n$ is smaller than $log(n)$ for large $n$? Or do I understand the concept of pseudopolynomial running time wrong in this case?