1. Introduction
To answer such questions: which problems can be solved by computer? Is there an advantage between languages? Can you determine whether the program will stop (terminate) or run forever before running a program? How long does it take to solve a problem in a specific language? We turn to a discipline: computational theory.
2. Simple language
With simple language you can see that the minimum number of statements required by the computer to solve any problem is three. They are increment statements, decrement statements, and loop statements.
We can prove that this simple language can simulate multiple statements in some popular languages. We refer to each simulation as a macro, which can be used in other simulations without the need for repeated coding.
① macros in a simple language
② Input and output
3. Turing
1 Turing is used to solve computable problems. It is the foundation of modern computers.
2 Turing machine consists of three parts: tape, read/write head, controller (finite state automaton)
3 Simulation of simple language: Increment statement, decrement statement and Loop statement.
4 Turing can solve any problem that modern programs can solve.
5 Chiuzi-Turing thesis:
If there is an algorithm that can complete a symbolic manipulation task, there is also a Turing machine that accomplishes this task.
4. Number of Goethe
1 in Computer science theory, an unsigned number can be assigned to any program written in a particular language, which is often referred to as the Goethe number.
2 indicates a program is a number
3 translating a number into a program
5, downtime problems
A typical programming problem:
Can we write a program to test that any program that can be represented by the Goethe-number will terminate?
It has been proved that such a procedure cannot exist, that is, the downtime problem cannot be solved. (contradiction can be used as an unofficial proof)
6. Solvable problems and non-solvable problems
1 Non-solvable problems
2 solvable problems: polynomial problems and non-polynomial problems
① the complexity of solvable problems
Large O notation
The complexity of the non-polynomial problem program is far more complex than the polynomial problem.
This article is from the "11094276" blog, please be sure to keep this source http://11104276.blog.51cto.com/11094276/1734815
The basic knowledge of computational theory in introduction to Computer science