Can a computer decide?
यह पृष्ठ अभी हिन्दी में अनूदित नहीं है, इसलिए इसे English में दिखाया जा रहा है।
अनुवाद में मदद करें →प्रश्न
Some programs stop and some loop forever. Could someone write one clever program that looks at any program, together with its input, and always correctly says whether it will stop?
आगे पढ़ने से पहले प्रयोग करके देखें। खोजबीन का कोई गलत तरीका नहीं है।
प्रयोग
विकर्ण मशीन
यह 0 और 1 के अनंत अनुक्रमों की एक सूची है (हम केवल शुरुआत दिखा सकते हैं)। सुनहरा अनुक्रम d विकर्ण को पलट देता है।
| s1 | … | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| s2 | … | ||||||||||
| s3 | … | ||||||||||
| s4 | … | ||||||||||
| s5 | … | ||||||||||
| s6 | … | ||||||||||
| d | 1 | 0 | 1 | 0 | 0 | 1 | ? | ? | ? | ? | … |
किसी पंक्ति पर पॉइंटर ले जाएँ (या टैब से वहाँ पहुँचें) ताकि दिखे कि d उससे कहाँ भिन्न है। सूची बदलने के लिए किसी भी अंक पर क्लिक करें।
d को सूची में जोड़ें, तो एक नया d प्रकट होता है जो फिर से भिन्न है। कोई भी सूची — चाहे कितनी भी लंबी हो — हर अनुक्रम को समाहित नहीं कर सकती।
संकेत, यदि आप चाहें
क्या हो रहा है
क्या हो रहा है
In 1936 Alan Turing proved that no such checker can exist. The argument is short.
Suppose a program could take any program and input and always answer correctly " stops on " or " runs for ever on ". Build a new program : given a program , it asks whether stops when given its own text as input, and then does the opposite — if says "stops", loops for ever; if says "runs for ever", stops.
Now run on its own text. If stops, then said " runs for ever" — wrong. If runs for ever, then said " stops" — wrong again. Either way makes a mistake, so the perfect checker cannot exist. This is the halting problem, and it is undecidable.
This is the same diagonal trick Cantor used to show that some infinities are bigger than others, and Gödel used to show that no consistent formal system can prove every true statement about whole numbers. It does not say that we can never tell whether a particular program stops — often we can — only that no single program can do it for all programs. Henry Rice later showed that the same holds for every non-trivial question about what programs compute.
उपमा, औपचारिक रचना नहीं: The experiment shows Cantor's diagonal argument for 0–1 sequences. The halting proof below uses the same diagonal idea, applied to programs; the experiment is an illustration of the idea, not the halting proof itself.
यह कहाँ ले जाता है
- स्नातक (उन्नत) · पाठ उपलब्धComputabilityTuring machines and other models of computation, the Church–Turing thesis, decidable and recursively enumerable sets, the undecidability of the halting problem, reductions and Rice's theorem.
- स्नातकोत्तर प्रथम वर्ष · पाठ उपलब्धGödel's incompleteness theoremsArithmetisation of syntax, representability of computable functions, the diagonal lemma, Gödel's first and second incompleteness theorems and Tarski's undefinability of truth.
- स्नातक (उन्नत) · पाठ उपलब्धComputational complexityTime and space complexity classes, P and NP, polynomial-time reductions, NP-completeness and the Cook–Levin theorem, and the status of the P versus NP problem.