Professional Documents
Culture Documents
Computational Problem
1
distinguishes computational complexity from computability theory: the latter
theory asks what kind of problems can, in principle, be solved algorithmically.
Problem instances
2
Decision problems as formal languages
A decision problem has only two possible outputs, yes or no (or alternately 1 or 0)
on any input. Decision problems are one of the central objects of study in
computational complexity theory. A decision problem is a special type of
computational problem whose answer is either yes or no, or alternately either 1 or
0. A decision problem can be viewed as a formal language, where the members of
the language are instances whose output is yes, and the non-members are those
instances whose output is no. The objective is to decide, with the aid of an
algorithm, whether a given input string is a member of the formal language under
consideration. If the algorithm deciding this problem returns the answer yes, the
algorithm is said to accept the input string, otherwise it is said to reject the input.
An example of a decision problem is the following. The input is an arbitrary
graph. The problem consists in deciding whether the given graph is connected, or
not. The formal language associated with this decision problem is then the set of all
connected graphs—of course, to obtain a precise definition of this language, one
has to decide how graphs are encoded as binary strings.
Function problems
A function problem is a computational problem where a single output (of a total
function) is expected for every input, but the output is more complex than that of a
3
decision problem, that is, it isn't just yes or no. Notable examples include the
traveling salesman problem and the integer factorization problem.
It is tempting to think that the notion of function problems is much richer than the
notion of decision problems. However, this is not really the case, since function
problems can be recast as decision problems. For example, the multiplication of
two integers can be expressed as the set of triples (a, b, c) such that the relation a ×
b = c holds. Deciding whether a given triple is a member of this set corresponds to
solving the problem of multiplying two numbers.
4
Turing Machine
A Turing machine consists of a line of cells known as the "tape", together with a
single active cell, known as the "head". The cells on the tape can have a certain set
of possible colors, and the head can be in a certain set of possible states.
Any particular Turing machine is defined by a rule which specifies what the head
should do at each step. The rule looks at the state of the head, and the color of the
cell that the head is on. Then it specifies what the new state of the head should be,
what color the head should "write" onto the tape, and whether the head should
move left or right.
The prize Turing machine has two possible states of its head, and three possible
colors on its tape. The animation below shows the operation of the machine, with
the states of the head represented by the orientation of the arrows. In the example
shown, the Turing machine starts from a
"blank" tape in which every cell is white. In the analogy with a computer, the "tape" of the
Turing machine is the computer memory, idealized to extend infinitely in each direction.
The initial arrangement of colors of cells on the tape corresponds to the input given
to the computer. This input can contain both a "program" and "data". The steps of
the Turing machine correspond to the running of the computer.
The rules for the Turing machine are analogous to machine-code instructions for
the computer. Given particular input, each part of the rule specifies what
"operation" the machine should perform.
The remarkable fact is that certain Turing machines are "universal", in the sense
that with appropriate input, they can be made to perform any ordinary computation.
5
Not every Turing machine has this property; many can only behave in very simple
ways. In effect, they can only do specific computations; they cannot act as
"general-purpose computers".
This prize is about determining how simple the rules for a Turing machine can be,
while still allowing the Turing machine to be "universal".
A universal Turing machine has the property that it can emulate any other Turing
machine---or indeed any computer or software system. Given rules for the thing to
be emulated, there is a way to create initial conditions for the universal Turing
machine that will make it do the emulation.
Turing machines are widely used in theoretical computer science for proving
abstract theorems. Studying specific Turing machines has been rare.
6
Complexity measures
For a precise definition of what it means to solve a problem using a given amount
of time and space, a computational model such as the deterministic Turing machine
is used. The time required by a deterministic Turing machine M on input x is the
total number of state transitions, or steps, the machine makes before it halts and
outputs the answer ("yes" or "no"). A Turing machine M is said to operate within
time f(n), if the time required by M on each input of length n is at most f(n). A
decision problem A can be solved in time f(n) if there exists a Turing machine
operating in time f(n) that solves the problem. Since complexity theory is interested
in classifying problems based on their difficulty, one defines sets of problems
based on some criteria. For instance, the set of problems solvable within time f(n)
on a deterministic Turing machine is then denoted by DTIME(f(n)).
Analogous definitions can be made for space requirements. Although time and
space are the most well-known complexity resources, any complexity measure can
be viewed as a computational resource. Complexity measures are very generally
defined by the Blum complexity axioms. Other complexity measures used in
complexity theory include communication complexity, circuit complexity, and
decision tree complexity. The complexity of an algorithm is often expressed using
big O notation.
7
Communication complexity tries to quantify the amount of communication
required for such distributed computations.
Of course they can always succeed by having Alice send her whole n-bit string to
Bob, who then computes the function, but the idea here is to find clever ways of
calculating f with fewer than n bits of communication.
This abstract problem is relevant in many contexts: in VLSI circuit design, for
example, one wants to minimize energy used by decreasing the amount of electric
signals required between the different components during a distributed
computation. The problem is also relevant in the study of data structures, and in the
optimization of computer networks.
Alan Turing’s analysis attempting to formalize the class of all effective procedures
was carried out in 1936, resulting in the notion of a Turing machine. Its importance
is that it was the first really general analysis to understand how it is that
computation takes place, and that it led to a convincing and widely accepted
abstraction of the concept of effective procedure.
It is worth noting that Turing’s analysis was done before any computers more
powerful than desk calculators had been invented. His insights led, more or less
directly, to John von Neumann’s invention in the 1940’s of the stored program
digital computer, a machine with essentially the same underlying architecture as
today’s computers.
Any other changes can be split up into simple changes of this kind. The situation in
regard to the squares whose symbols may be altered in this way is the same as in
regard to the observed squares. We may, therefore, without loss of generality,
assume that the squares whose symbols are changed are always “observed”
squares. Besides these changes of symbols, the simple operations must include
8
changes of distribution of observed squares. The new observed squares must be
immediately recognizable by the computer.
9
this is because Σ* is the set of all strings (of all possible length
including 0) over the given alphabet Σ Examples:
1. Let L be the language of all strings consisting of n 0’s followed by n 1’s:
L = {ε,01, 0011, 000111,…}
Let L be the language of all strings of with equal number of 0’s
and 1’s: L = {ε,01, 10, 0011, 1100, 0101, 1010, 1001,
…}
Existing Problems
- Decision Problem
- Search Problem
- Optimization Problem
10
- Counting Problem
There are many questions that raise the problem concern on the social life and
make a complex status of computability like:
Let’s start with the multiplication of two Integers. There may be two possible
operations for the multiplication of the integers, First method is repeated addition
and second is grade school algorithm.
it needs 422 times addition using the first method but using grade school algorithm
it need only 3 multiplication and 3 addition.
It shows that the size of inputs is the number of digits in the number.
The number of basic operation used to multiply two digit number is at most 2n 2 for
the grade school algorithm and at least n10n-1 for repeated addition.
Model of Computation
12
For finalizing computability, Turing assumed that, while computing, a person
writes symbols on a one-dimensional paper (instead of a two dimension paper as is
usually done) which can be viewed as a tape divided into cells.
One scans the cells one at a time and usually performs one of the three simple
operations, namely (i) writing a new symbol in the cell being currently scanned,
(ii) moving to the cell left of the present cell and (iii) moving to the cell light of the
present cell. With these observations in mind, Turing proposed his 'computing
machine.'
a1 a2 a3 ….. b b …..
R/W head
Finite Control
Fig. 1 Turing machine model.
Each cell can store only one symbol. The input to and the output from the finite
state automaton are effected by the R/W head which can examine one cell at a
time. In one move, the machine examines the present symbol under the R/W head
on the tape and the present state of an automaton to determine
(i)a new symbol to be written on the tape in the cell under the RAY head,
(ii) a motion of the RAY head along the tape: either the head moves one cell left
(L), or one cell right (R),
(iii) the next state of the automaton, and (iv) Whether to halt or not.
The above model can be rigorously defined as follows:
14
Definition of Turing Machines
A Turing Machine M is a 7-tuple
(Q, Σ, Γ, δ, qo , # , F )
Where,
Q is a set of states
Σ is a finite set of symbols, “input alphabet”.
Γ is a finite set of symbols on “tape alphabet”, including the blank: ϵ , Γ;
δ is the partial transition function, mapping (q, x) onto (qt, y, D) where D denotes
the direction of movement of R!W head: D =L or R according as the movement
is to the left or right.
δ : (Q - F) × Γ Q × Γ × { R, N, L }:
qo is the initial state, q0 ϵ Q;
F is the set of final states, F subset Q;
Turing Machines are like simplified computers containing: A
tape to read/write on
Contains squares with one symbol each
Is used for input, output and temporary storage
Unbounded
A read/write head
Can change the symbol on the tape at current position
Moves step by step in either direction
A finite state machine
Including an initial state and final states
• Looks simple, but is very powerful
• Standard model for the rest of the course
Operation:
• Start in state q0, input w is on tape, head over its _rst symbol
15
• Each step:
Read current state q and symbol a at current position
Lookup δ (q, a) = (p, b, D )
Change to state p, write b, move according to D
• Stop as soon as q ϵ F. Left on tape: Output
- Conguration (w, q, v) denotes status after each step:
Tape contains wv (with innately many around)
Head is over first symbol of v
Machine is in state q
- Start conguration: (e, q0, w) if input is w
- End conguration: (v; q; z) for a q 2 F
Output is z, denoted by M(w)
In case machine doesn't halt (!): M(w) = %
16
U ( ( M), w) = M(w)
In particular, U does not halt iff M does
not halt.
Example
b a4 a1 a2 a1 a2 a2 a1 a4 a2 b b
R/W head
State q3
17
Solution
The present symbol under the RJW head is a 1. The present state is q3' So al is
written to the right of q3. The nonblank symbols to the left of al form the string
a4a1a2a1a2a2, which is written to the left of q3' The sequence of nonblank
symbols to the right of a1 is a4a2. Thus the ID is as
given in Figure below a4a1a2a1a2a2 q3 a1 a4a2
Figure: Representation of ID
Notes: (1) For constructing the ID, we simply insert the current state in the input
string to the left of the symbol under the RIW head.
(2) We observe that the blank symbol may occur as part of the left or right
substring.
Moves in a TM
18
X1X2……Xj-1qXi……..Xn
After processing Xi, the resulting ID is
19