TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The Halting Problem is a terrible example of NP-Harder

108 点作者 BerislavLopac27 天前

14 条评论

bob102927 天前
&gt; Most &quot;definitely harder than NP&quot; problems require a nontrivial background in theoretical computer science or mathematics to understand.<p>One of the simplest examples of this is automatic program synthesis.<p>Searching for the optimal (e.g., shortest) program that satisfies a given set of inputs&#x2F;outputs (function) is an <i>undecidable</i> (worse than exponential time) problem similar to the halting problem. The exponent in this case would have been the size of the instruction set, but we still don&#x27;t know how many cycles we need (i.e., is it even practical to run?).<p>In applications like genetic programming, we deal with the halting problem by specifying a maximum # of cycles that the program interpreter will run for each time. The ability of the synthesized programs to halt in a bounded time becomes part of selection pressure. Candidates that return poor or no results within the constraints are quickly eliminated. This can be further compounded by making the candidates evolve their own resource limits as part of their genome.<p>Put differently, we can approximately solve the halting problem for some smaller problems with clever search techniques. I don&#x27;t think talking about these things in absolute terms is very useful. Everything depends on the problem and the customer&#x27;s expectations.
评论 #43719848 未加载
评论 #43714848 未加载
andrewla27 天前
The example given doesn&#x27;t seem right to me.<p>&gt; There is one problem, though, that I find easily explainable. Place a token at the bottom left corner of a grid that extends infinitely up and right, call that point (0, 0). You&#x27;re given list of valid displacement moves for the token, like (+1, +0), (-20, +13), (-5, -6), etc, and a target point like (700, 1). You may make any sequence of moves in any order, as long as no move ever puts the token off the grid. Does any sequence of moves bring you to the target?<p>If someone gives you such a sequence, it seems trivial to verify it in linear time. Even for arbitrary dimensions, and such witness can be verified in linear time.
评论 #43717130 未加载
评论 #43716408 未加载
评论 #43716238 未加载
评论 #43716279 未加载
thaumasiotes27 天前
I agree with the issue (&quot;What&#x27;s bigger than a dog? THE MOON&quot;), but I don&#x27;t agree with the need to provide an example that is provably distinct from NP. We&#x27;re fine providing NP-complete problems without proving that they&#x27;re distinct from P.<p>There are lots of accessible problems that belong to spaces that probably aren&#x27;t NP. One that should be familiar to most people studying CS theory is &quot;do these two regular expressions match the same set of strings?&quot;.<p>---<p>For the Diophantine vector reachability problem... I don&#x27;t really like the Quanta presentation. (&quot;An easy-sounding problem yields numbers too big for our universe.&quot;)<p>First, the problem, if you describe it accurately, doesn&#x27;t sound easy at all. Diophantine problems are <i>never</i> easy. That&#x27;s why we have real numbers.<p>Second, the article suggests that the problem should be introduced to children by casting in in terms of several rules of exchange (&quot;For Alice, the transition vector (−1, −1, 1, 0) would represent the exchange of an apple and a banana for a cantaloupe.&quot;). But that would make the problem trivial: you start at the origin; without a rule of &quot;exchange&quot; in which the other party gives you as much as you want of something for free, you&#x27;re never going to leave it.<p>And third, many easy problems generate numbers too big for our universe. That&#x27;s not unusual at all. Compare the question &quot;how many digits of pi do you need before the potential error in calculating the volume of a sphere the size of the visible universe is less than the volume of one hydrogen atom?&quot;. Can you imagine using more digits than that? You just involved a number too big for the universe.<p>The article passes over this point itself:<p>&gt; It’s physically impossible to write down all the digits of 2↑↑­­6 — a liability of living in such a small universe.
评论 #43723194 未加载
Leszek27 天前
Something I find fascinating is that we know that P != EXPTIME, and that P &lt;= NP &lt;= EXPTIME, but have managed to prove neither P != NP nor NP != EXPTIME. NP has to be somewhere between them but we have no idea where.
评论 #43718347 未加载
the-grump27 天前
Technically correct is the best kind of correct, and The Halting Problem is a fun head scratcher for a green computer scientist. I&#x27;m glad it was part of my introduction to NP hardness.<p>That said, you do make a great point OP, and I&#x27;ll think about it every time the Halting Problem comes up.
评论 #43715688 未加载
qsort26 天前
The million dollar question here is... a literal million dollar question.<p>The natural way to go up in complexity from NP is along the polynomial hierarchy, but since it could be the case that P=NP, those problems aren&#x27;t <i>provably</i> harder.For all we know it could even be the case that P=PSPACE.<p>You could invoke the nondeterministic variant of the time-hierarchy theorem.
ogogmad26 天前
Is the problem mentioned in the article equivalent to deciding whether there exists a solution to a system of linear equations in the positive integers?<p>I think no, because the vector additions are considered in sequence, and at no point are you allowed to leave the positive quadrant.<p>[Edit] Yeah, it&#x27;s more than just solving positive integer linear systems: <a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Vector_addition_system" rel="nofollow">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Vector_addition_system</a>
评论 #43720871 未加载
chad1n26 天前
To be honest, checking if there is a path between two nodes is a better example of NP-Hard, because it&#x27;s obvious why you can&#x27;t verify a solution in polynomial time. Sure the problem isn&#x27;t decidable, but it&#x27;s hard to give problems are decidable and explain why the proof can&#x27;t be verified in P time. Only problems that involve playing optimally a game (with more than one player) that can have cycles come to mind. These are the &quot;easiest&quot; to grasp.
评论 #43718786 未加载
waynecochran26 天前
Halting problem is not even decidable. To mention it in the context of NP is a categorical fouxpas.
评论 #43777002 未加载
johanvts27 天前
&gt; NP-hard is the set all problems at least as hard as NP-complete<p>Im a bit confused by this. I thought NP-complete was the intersection of NP-hard and NP. Maybe this is stating the same?
评论 #43716558 未加载
评论 #43715007 未加载
ykonstant27 天前
I am confused about the precise statement of the problem that is claimed to be provably NP-hard, decidable and not in NP. Any clarification?
评论 #43714727 未加载
评论 #43714692 未加载
nyrikki26 天前
The problem is that topics like descriptive complexity theory are typically reserved for graduate level courses, and what the author has access to is basically a survey.<p>There are entire hierarchies that describe what is &quot;NP-Harder&quot; specifically the second level of the polynomial hierarchy, where NP == Σ_1^p<p>IMHO one of the most useful parts of the <i>-complete concepts is as a meet-me where one can find possible reductions that may work in your use case, but even with just P and NP you can find useful mappings like:<p><pre><code> P = FO(LFP)=FO(n^O(1))=SO(Horn) NP = PCP(0,poly(n)) = PCP(log n, log n) = PCP(log n, 1) = Σ^1 = SO(∃) </code></pre> There are entire hierarchies that describe what is &quot;NP-Harder&quot; specifically the second level of the polynomial hierarchy, where NP == Σ_1^p<p>The arithmetic and exponential hierarchies, which the author mentions are actually nearly just as big as a jump to HALT from the polynomial hierarchy.<p>The reason that PSPACE is invoked (class of decision problems solvable by a Turing machine in polynomial space).<p>Is because is because PSPACE contains PH, the Polynomial-Time Hierarchy[1] which is what the author seems to have been looking for. The PSPACE-complete problems[2] are also a great meet-me space for either looking for some special case reduction, or understanding that complexity from your preferred abstract model.<p>As </i>space* is always more valuable then <i>time</i>, because you have to read, which takes time, it is common to have that transition. But then things get crazy too.<p>HALT and NP are very closely related in a practical method because of the Entscheidungsproblem, which is the <i>decision problem</i> issue.<p>But you have to think in the <i>General</i> case, not a restricted problem.<p>You can verify any NP problem in poly time, just as you can tell that a machine halts, but you cannot <i>pre-guess</i> that.<p>A possibly useful lens for this is the generalization of HALT, Rice&#x27;s Theorem[3]<p>&gt; Rice&#x27;s theorem states that all non-trivial semantic properties of programs are undecidable.<p>&gt; Given a program P which takes a natural number n and returns a natural number P(n), the following questions are undecidable: * Does P terminate on a given n? (This is the halting problem.) * Does P terminate on 0? * Does P terminate on all n (i.e., is P total)? * Does P terminate and return 0 on every input? * Does P terminate and return 0 on some input? * Does P terminate and return the same value for all inputs? * Is P equivalent to a given program Q?<p>If you quit thinking about NP as something that can be brute forced, as yes NP can be simulated on a TM, and think about a <i>decider program</i> running and deciding <i>without running</i> the actual program this will help connect the dots.<p>Understanding that this decision has to happen without access to the <i>semantic properties</i> (runtime behavior) but only has access to the syntax of a program will open lots of concepts for you.<p>If moving past the oversimplified &quot;survey&quot; level explanations is of interest there are many resources, but here is one play list that some trusted people I know claimed was useful[4]. One of the more common descriptive complexity books is &quot;Descriptive Complexity&quot; by Neil Immerman, and even complexityzoo references[1] can help.<p>To be clear, I can understand why these oversimplified introduction explanations can be frustrating, and the curriculum could and should be improved.<p>[1]<a href="https:&#x2F;&#x2F;complexityzoo.net&#x2F;Complexity_Zoo:P#ph" rel="nofollow">https:&#x2F;&#x2F;complexityzoo.net&#x2F;Complexity_Zoo:P#ph</a> [2]<a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;List_of_PSPACE-complete_problems" rel="nofollow">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;List_of_PSPACE-complete_prob...</a> [3]<a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Rice%27s_theorem" rel="nofollow">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Rice%27s_theorem</a> [4]<a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;playlist?list=PLm3J0oaFux3b8Gg1DdaJOzYNsaXYLAOKH" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;playlist?list=PLm3J0oaFux3b8Gg1DdaJO...</a>
graycat27 天前
Well, for a computer that is a <i>finite state machine</i> there are only finitely many <i>states</i>. So, in finite time the machine will either (a) halt or (b) return to an earlier state and, thus, be in an <i>infinite loop</i>. So, in this case can tell if the &quot;program will stop&quot; and, thus, <i>solve</i> &quot;the halting problem&quot;.<p>Uh, we also assume that before we start, we can look at the design of &quot;the machine&quot; and know how many <i>states</i> there can be and from the speed of the machine how many new states are visited each second. So, we will know how long we have to wait before we see either (a) or (b).
评论 #43714742 未加载
评论 #43714273 未加载
评论 #43714402 未加载
评论 #43717019 未加载
评论 #43714513 未加载
评论 #43714285 未加载
meindnoch27 天前
For any function f(n) the problem &quot;compute 2^f(n)&quot; is going to be Ω(f(n)), because the output is f(n) bits; so merely writing down the answer takes Ω(f(n)) steps.<p>Note, that the number n is the input here, which is k = log(n) bits long. So the runtime is actually Ω(f(2^log(n))) = Ω(f(2^k)).
评论 #43714700 未加载
评论 #43717124 未加载