Module 5 Atc
Module 5 Atc
Church-Turing thesis-1936
• Any algorithmic procedure that can be carried out by a human or a computer, can also be
carried out by a Turing machine.
• Now it is universally accepted by computer scientists that TM is a Mathematical model of an
algorithm.
• TM has an algorithm and an algorithm has a TM. If there is an algorithm problem is
decidable, TM solves that problem
• The statement of the thesis –
“ Every function which would naturally be regarded as computable can be
computed by a Turing machine”
Implies
• Any mechanical computation can be performed by a TM
• For every computable problem there is a TM
• If there is no TM that decides P there is no algorithm that can solve problem P.
• In our general life, we have several problems and some of these have solutions, but some
have not, we simply say a problem is decidable if there is a solution otherwise undecidable.
example:
• Does Sun rises in the East? YES
• Will tomorrow be a rainy day ? ( YES/NO ? )
Decidable and Undecidable Languages
• A problem is said to be decidable if its language is recursive OR it has solution.
Example:
Decidable :
-Does FSM accept regular language?
- is the power of NFA and DFA same
Undecidable:
- For a given CFG is L(G) ambiguous?
L is Turing decidable (or just decidable) if there exists a Turing machine M that accepts all strings in L
and rejects all strings not in L. Note that by rejection means that the machine halts after a finite
number of steps and announces that the input string is not acceptabl e.
1. (Recursive)
TMs that always halt, no matter accepting or
non-accepting DECIDABLE PROBLEMS
2. (Recursively enumerable)
TMs that are guaranteed to halt only on acceptance.
If non-accepting, it may or may not halt (i.e., could loop forever).
• Undecidable problems are those that are not recursive
Recursive languages
A Language L over the alphabet∑ is called recursive if there is a TM M that accepts every word in L
and rejects every word in L’
Accept (M)=L
Reject(M)=L’
loop(M)= ø
Example: b(a+b)*
3. Prove that
PCP is a combinatorial problem formulated by Emil Post in 1946. This problem has many applications
in the field theory of formal languages. A correspondence system P is a finite set of ordered pairs of
non empty strings over some alphabet. Let A w1 , w2 , , wn B v1 , v2 , , vn
i, j , , k
wi w j wk vi v j vk
Index wj Vi
1 100 001
2 11 111
3 111 11
Let W = w2w1w3 =v2v1v3 = 11100111 we have got a solution. But we may not get solution always
for various other combinations and strings of different length. Hence PCP is undecidable.
A w1 , w2 , , wn B v1 , v2 , , vn
1, i, j,, k
w1 wi w j wk v1vi v j vk
If the index start with 1 and then any other sequence then it is called MPCP
Time complexity
Space complexity
◦ Best case
◦ Worst case
Average case
Asymptotic analysis
The big-Oh notation is used widely to characterize running times and space bounds
The big-Oh notation allows us to ignore constant factors and lower order terms and focus on
the main components of a function which affect its growth
Given functions f(n) and g(n), we say that f(n) is O(g(n)) if there are positive constants
c and n0 such that
f(n) cg(n) for n n0
Example: 2n + 10 is O(n)
◦ 2n + 10 cn
◦ (c 2) n 10
◦ n 10/(c 2)
It is true for c = 3 and n0 = 10
7n-2 is O(n)
need c > 0 and n0 1 such that 7n-2 c•n for n n0
this is true for c = 7 and n 0 = 1
f(n)= O(g(n)) iff there exist positive constants c and n0 such that f(n) ≤ cg(n) for all n ≥ n0
O-notation to give an upper bound on a function
The big-Oh notation gives an upper bound on the growth rate of a function
The statement “f(n) is O(g(n))” means that the growth rate of f(n) is no more than the
growth rate of g(n)
We can use the big-Oh notation to rank functions according to their growth rate
f n a0 a1n a2 n 2 ... ad n d
If is f(n) a polynomial of degree d, then f(n) is O(nd), i.e.,
1. Drop lower-order terms
2. Drop constant factors
Use the smallest possible class of functions
1. Say “2n is O(n)” instead of “2n is O(n2 )”
Use the simplest expression of the class
Say “3n + 5 is O(n)” instead of “3n + 5 is O(3n)”
Following are the terms usually used in algorithm analysis:
1. Constant 1
2. Logarithmic log n
3. Linear n
4. N-Log-N n log n
5. Quadratic n2
6. Cubic n3
7. Exponential 2n
Class P Problems:
P stands for deterministic polynomial time. A deterministic machine at each time executes an
instruction. Depending on instruction, it then goes to next state which is unique. Hence time
complexity of DTM is the maximum number of moves made by M is processing any input string of
length n, taken over all input of length n.
The class P consists of those problems that are solvable in polynomial time.
More specifically, they are problems that can be solved in time O(n k) for some constant k,
where n is the size of the input to the problem
The key is that n is the size of input
Def: A language L is said to be in class P if there exists a DTM M such that M is of time complexity
P(n) for some polynomial P and M accepts L.
Class NP Problems
Def: A language L is in class NP if there is a nondeterministic TM such that M is of time complexity
P(n) for some polynomial P and M accepts L.
NP is not the same as non-polynomial complexity/running time. NP does not stand for not
polynomial.
NP = Non-Deterministic polynomial time
NP means verifiable in polynomial time
Verifiable?
◦ If we are somehow given a ‘certificate’ of a solution we can verify the legitimacy in
polynomial time
Quantum Computers
Computers are physical objects, and computations are physical processes. What
computers can or cannot compute is determined by the law of physics alone, and not by
pure mathematics. Computation with coherent atomic-scale dynamics.
The behavior of a quantum computer is governed by the laws of quantum mechanics.
In 1982 Richard Feynmann, a Nobel laurite in physics suggested to build computer based on
quantum mechanics.
Quantum mechanics arose in the early 1920s, when classical physics could not explain
everything.
QM will provide tools to fill up the gulf between the small and the relatively complex
systems in physics.
Bit ( 0 or 1 ) is the fundamental concept of classical computation and information. Classical
computer built from electronic circuits containing wires and gates.
Quantum bit and quantum circuits which are analogous to bits and circuits. Two possible
states of a qubit (Dirac)are 0 1
Quantum bit is qubit described mathematically (where (alpha) is complex number)
0 0 1 1
Qubit can be in infinite number of state other than dirac |0> or |1>
i 1
1 0 i 1 1 0 0 1 1 i 1
1 i
0 0 1 1 0 0 1 1 0
2 2 2 2 2 2 2 2
Any linear operation that takes states 0 1 satisfying and maps them to be UNITARY
0 1
i.e. 0 1 1
2 2
0 0 1 1 0 0 1 1
0 1 01 1 0 10 1 1 11
0 0 00
And it is describes the state as 0 0 00 0 1 01 10 10 11 11
Quantum computer is a system built from quantum circuits, containing wires and
elementary quantum gates, to carry out manipulation of quantum information.
1. Multiple tapes: It consists of finite control with k tape heads and k tapes each
tape is infinite in both directions. On a single move depending on the state of the
finite control and symbol scanned by each of the tape head the machine can
change state Or print new symbol on each of cell scanned etc..
2. With One tape but M ultiple heads: a K head TM has fixed k number of heads
and move of TM depends on the state and the symbol scanned by each head. (
head can move left, right or stationary).
3. Multidimensional TM: It has finite control but the tape consists of a K-
dime nsional array of cells infinite in all 2 k directions. Depending on the state
and symbol scanned , the device changes the state, prints a ne w symbol, and
moves its tape head in one of the 2 k directions, either positively of negatively
along one of the k axes.
4. Non deterministic TM: In the TM for a given state and tape symbol scanned by
the tape head, the machine has a finite numbe r of choices for the next move.
Each choice consists of new state, a tape symbol to print and direction of head
motion.
< a b a b a >
Left EM Right EM
Two extra symbols < and > are used left end marker and right
end marker.
Input lies between these markers