Theory: Goals - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

Theory: Goals

Description:

We will construct a model of computation. Simple, functional description of a computer ... We can construct a Turing Machine for any algorithm. ... – PowerPoint PPT presentation

Number of Views:48
Avg rating:3.0/5.0
Slides: 28
Provided by: CDTL
Category:

less

Transcript and Presenter's Notes

Title: Theory: Goals


1
Theory Goals
  • Reason about feasibility of device without
    actually building it.
  • We can reason about what is going to happen in an
    experiment, without actually doing an experiment
  • Readings Chapter 11 Sections 11.1 11.5

2
Theory Goals
  • To give a model of computation, to be able to
    reason about the capabilities of computers
  • To study the properties of computation rather
    than being lost in the details of the machine
    hardware/software
  • To study what computers may be able to do, and
    what they cannot do
  • To study what can be done quickly and what cannot
    be done quickly

3
Theory Goals
  • We will construct a model of computation.
  • Simple, functional description of a computer
  • --- to capture essence of computation
  • --- suppress details
  • --- easy to study and reason about
  • Turing Machine (there are several other models)

4
Turing Machine
  • (a) One sided infinite tape consisting of cells
    on which letters from a fixed FINITE alphabet may
    be written
  • (b) A FINITE set of states. Machine may be in any
    one of the states at any particular time.
  • (c) A head which can read/write one cell at a
    time.

5
Turing Machine

0
0
1
0
0
1
0
M
6
Turing Machine
  • In one step TM
  • (a) reads the cell being scanned by the head
  • Then based on its CURRENT state and symbol read
  • (b) writes something on the cell being scanned
  • (c) moves the head left or right (or stay where
    it is)
  • (d) changes its current state
  • Simple, As powerful (computation wise) as any
    computer

7
Example
  • Suppose initially on the tape we have
  • 11111 B 111111111 BBBBBBBBBB.
  • We want the TM to convert first set of 1s to 0s
    and second set of 1s to 2s and then return to
    the initial left most cell ().

8
Example
  • 1) Initially it is reading , and moves the head
    right, and goes to step 2.
  • 2) If the symbol being read is 1, then write a 0,
    move the head right, and repeat step 2.
  • If the symbol being read is B, then move
    right and go to step 3.
  • 3) If the symbol begin read is 1, then write a 2,
    move the head right, and repeat step 3.
  • If the symbol being read is B, then go to
    step 4.
  • 4) If the symbol being read is 0, 1, 2 or B, then
    move left.
  • If the symbol being read is , then stop.

9
Example
  • Alphabet ,0,1,2,B
  • StatesQ1,Q2,Q3,Q4
  • Q1 is the starting state
  • Transition Table

10
(No Transcript)
11
Church Turing Thesis
  • We can construct a Turing Machine for any
    algorithm.
  • (Partial) Functions which take strings to strings
  • Algorithms/Programs we saw before can be encoded
    as string to string operations.
  • Sound/Video etc. are all coded into
    numbers/strings.
  • Interpret strings/numbers appropriately.
  • NOT a Theorem, only a Thesis.
  • Definition of computing device not clear.
  • Speed Slow,but not too bad. Within polynomial
    factor of current day computers.

12
Model Some points
  • FINITE set of states
  • FINITE vs INFINITE tape

13
Computability
  • Can we solve every problem?
  • In Mathematics
  • Godels Theorem Not every true theorem about
    natural numbers can be proven.
  • In Computer Science Not every problem can be
    solved.
  • Halting Problem

14
Computability
  • Given as input a program P, and input x for P
  • Does program P stop when run on input x?
  • There is no uniform way to solve the above
    problem.
  • That is there is no algorithm SOLVE(P,x) such that

15
Informal Proof
  • SuperSolve(P,x)
  • 1. Run SOLVE(P,x)
  • 2. If SOLVE(P,x) never stops, then program P also
    never stops.
  • 3. If SOLVE(P,x) outputs NO, then stop.
  • 4. If SOLVE(P,x) outputs YES, then go to step 5.
  • 5. Go to step 5.
  • End

16
Complexity
  • Suppose problem can be solved by the computer.
  • Question How much time does it take?
  • Searching Linear Search, Binary Search
  • Order of Growth The order of complexity is more
    important than constant factors
  • 0.5 n vs 1000 log n

17
Complexity Number of Operations
18
Execution time
  • Assuming a fast computer (1GigaHz) (1 billion
    operations per second)

19
(No Transcript)
20
Complexity
  • Slow may not be of much use
  • What is feasible?
  • Polynomial time Run time polynomial in the
    length of the input.
  • n2, n3, n7, 20n2 n5, etc.
  • P Class of problems which can be solved in
    polynomial time.
  • Note that P is invariant under different types of
    current day machines/TM. So if you can solve some
    problem in polynomial time on a supercomputer,
    then you can solve it in polynomial time on TM.

21
Complexity
  • Exponential time 2n
  • Some problems are inherently exponential or worse
    time.

22
  • Travelling Salesman Problem
  • Want to visit some cities New York, London,
    Tokyo,
  • and come back to Singapore.
  • Each city visited exactly once (except first and
    last city is both Singapore)
  • Cost of travel between each pair of cities is
    given.
  • Aim To minimize the cost.
  • Find tour of cost less than X.

23
  • Difficult to solve.
  • No polynomial time algorithm known.
  • However, if given a tour, one can verify if the
    cost is less than X.
  • Easy to verify answers. Difficult to find
    answers.
  • Easy ---gt polynomial time
  • Difficult --gt not polynomial time.
  • NP Class of problems for which it is easy to
    verify the answers.

24
  • Many natural problems such as travelling salesman
    are in NP but not known to be in P.
  • Much of cryptography is based on these kind of
    problems.

25
Recasting/Abstraction/Reduction
  • Travelling Salesman minimize cost of travel.
  • What if we want to minimize time of travel?
  • Distance travelled?
  • All are essentially the same problem.
  • Reduction A?B
  • One can solve A quickly using a subprogram for
    B
  • If we can solve B quickly, then we can solve A
    quickly
  • If one cannot solve A quickly, then we cannot
    solve B quickly

26
Recasting/Abstraction/Reduction
  • Thus methods of converting (or reducing in
    computer science terminology) can often be used
    for studying complexity of problems.

27
Model
  • How good is our model.
  • Does it capture main concerns well?
  • Can we have similar model for humans/brain?
  • If so can we compare the two models?
  • Are Humans essentially another kind of machine?
Write a Comment
User Comments (0)
About PowerShow.com