0
$\begingroup$

What's the hardness of the following problem: $\textbf{argmin}_x\{|x^2-2|\}$.

By analytical calculation, I know the solution is $\pm \sqrt{2}$. But I am quite confused about whether it is hard with regarding to its computation complexity.

$\endgroup$
6
$\begingroup$

What's the hardness of the following problem: $\textbf{argmin}_x\{|x^2-2|\}$.

It is $O(1)$. There is a single answer: $x = \sqrt{2}$. That means that, regardless of how that answer is represented, a computer can just output the answer and it solves your problem.

In general, to consider the hardness or complexity of a problem, you need there to be at least one variable as input; in particular, you need infinitely many possible input values. Otherwise, every problem can be solved trivially by just outputting the answer.

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.