Will irrational parameters make a problem not well-defined on complexity Given a set $=\{_1,⋯,_\}$ where all $_$s are rational positive numbers and $\sum_{i\in N}a_i=1$, find a subset ⊆ such that $(\sqrt{2\sum_{i\in S}a_i}-1)^2$ is minimized. Does the appearance of √ make the problem ill-defined with regrading to complexity?
The appearance of square roots does not make this an ill-defined problem.

Note that $(\sqrt{2\sum_{i\in S}a_i}-1)^2=0$ if $\sum_{i\in S}a_i = 1/2$ and $(\sqrt{2\sum_{i\in S}a_i}-1)^2&gt;0$ otherwise. Therefore, the problem is easily seen to be NP-hard by reduction from subset sum.