Section 11.4 Language Classes Based On Randomization

Slides:



Advertisements
Similar presentations
Computational Complexity
Advertisements

Measuring Time Complexity
Part VI NP-Hardness. Lecture 23 Whats NP? Hard Problems.
Variants of Turing machines
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
Cook’s Theorem The Foundation of NP-Completeness.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Variants.
Measuring Time Complexity Sipser 7.1 (pages )
Courtesy Costas Busch - RPI1 A Universal Turing Machine.
P, NP, PS, and NPS By Muhannad Harrim. Class P P is the complexity class containing decision problems which can be solved by a Deterministic Turing machine.
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata are like Turing Machines with a restriction: The working space of the tape is the space of the.
CS5371 Theory of Computation Lecture 11: Computability Theory II (TM Variants, Church-Turing Thesis)

Computability and Complexity 20-1 Computability and Complexity Andrei Bulatov Class NL.
Fall 2004COMP 3351 Reducibility. Fall 2004COMP 3352 Problem is reduced to problem If we can solve problem then we can solve problem.
1 Decidability continued. 2 Undecidable Problems Halting Problem: Does machine halt on input ? State-entry Problem: Does machine enter state halt on input.
CS5371 Theory of Computation Lecture 10: Computability Theory I (Turing Machine)
Computability and Complexity 3-1 Turing Machine Computability and Complexity Andrei Bulatov.
Fall 2004COMP 3351 A Universal Turing Machine. Fall 2004COMP 3352 Turing Machines are “hardwired” they execute only one program A limitation of Turing.
1 Reducibility. 2 Problem is reduced to problem If we can solve problem then we can solve problem.
1 Turing Machines. 2 A Turing Machine Tape Read-Write head Control Unit.
CS 461 – Nov. 21 Sections 7.1 – 7.2 Measuring complexity Dividing decidable languages into complexity classes. Algorithm complexity depends on what kind.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Randomized Turing Machines
Theory of Computing Lecture 15 MAS 714 Hartmut Klauck.
The Complexity of Primality Testing. What is Primality Testing? Testing whether an integer is prime or not. – An integer p is prime if the only integers.
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 15-1 Mälardalen University 2012.
Turing Machines – Decidability Lecture 25 Section 3.1 Fri, Oct 19, 2007.
Computation Model and Complexity Class. 2 An algorithmic process that uses the result of a random draw to make an approximated decision has the ability.
. CLASSES RP AND ZPP By: SARIKA PAMMI. CONTENTS:  INTRODUCTION  RP  FACTS ABOUT RP  MONTE CARLO ALGORITHM  CO-RP  ZPP  FACTS ABOUT ZPP  RELATION.
A Universal Turing Machine
1 More About Turing Machines “Programming Tricks” Restrictions Extensions Closure Properties.
Measuring complexity Section 7.1 Giorgi Japaridze Theory of Computability.
1 Linear Bounded Automata LBAs. 2 Linear Bounded Automata (LBAs) are the same as Turing Machines with one difference: The input string tape space is the.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Turing Machines.
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
NP-Completness Turing Machine. Hard problems There are many many important problems for which no polynomial algorithms is known. We show that a polynomial-time.
Lecture 17 Undecidability Topics:  TM variations  Undecidability June 25, 2015 CSCE 355 Foundations of Computation.
1 Section 13.1 Turing Machines A Turing machine (TM) is a simple computer that has an infinite amount of storage in the form of cells on an infinite tape.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
Fall 2013 CMU CS Computational Complexity Lecture 2 Diagonalization, 9/12/2013.
Overview of the theory of computation Episode 3 0 Turing machines The traditional concepts of computability, decidability and recursive enumerability.
Lecture 24UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 24.
1 Introduction to Turing Machines
1 Chapter 9 Undecidability  Turing Machines Coded as Binary Strings  Universal Turing machine  Diagonalizing over Turing Machines  Problems as Languages.
Turing Machines Sections 17.6 – The Universal Turing Machine Problem: All our machines so far are hardwired. ENIAC
1 8.4 Extensions to the Basic TM Extended TM’s to be studied: Multitape Turing machine Nondeterministic Turing machine The above extensions make no increase.
1 Design and Analysis of Algorithms Yoram Moses Lecture 13 June 17, 2010
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Theory of Computation Automata Theory Dr. Ayman Srour.
Recursively Enumerable and Recursive Languages. Definition: A language is recursively enumerable if some Turing machine accepts it.
CSCI 2670 Introduction to Theory of Computing November 15, 2005.
1 A Universal Turing Machine. 2 Turing Machines are “hardwired” they execute only one program A limitation of Turing Machines: Real Computers are re-programmable.
Design and Analysis of Approximation Algorithms
Time complexity Here we will consider elements of computational complexity theory – an investigation of the time (or other resources) required for solving.
Part VI NP-Hardness.
Busch Complexity Lectures: Turing Machines
COSC 3340: Introduction to Theory of Computation
Jaya Krishna, M.Tech, Assistant Professor
فصل سوم The Church-Turing Thesis
Decidability Turing Machines Coded as Binary Strings
Decidability Turing Machines Coded as Binary Strings
CLASSES P AND NP.
CSC 4170 Theory of Computation Time complexity Section 7.1.
Recall last lecture and Nondeterministic TMs
CS21 Decidability and Tractability
Subject Name: FORMAL LANGUAGES AND AUTOMATA THEORY
CSC 4170 Theory of Computation Time complexity Section 7.1.
Presentation transcript:

Section 11.4 Language Classes Based On Randomization

Introduction We shall look at a Turing Machine that models the generation of random numbers and the use of those numbers in algorithms. We shall also discuss two classes of languages, RP and ZPP, that use randomness and a polynomial time bound in different ways.

Section 11.4.1 Quicksort: A Randomized Algorithm Given a list of elements, randomly select one element. Split the list into those above and those below the selected element. Recursively repeat the process on each new list. Put the new lists back together, resulting in a completely sorted list. Complexity Range: O(n log n) to O(n2).

Section 11.4.2 A Turing Machine Using Randomization Use a multitape Turing Machine. The first tape contains the input. The second tape is called the random tape. When blanks are scanned, they are filled with randomly chosen 0’s and 1’s with a probability of ½ (“coin-flip”) and never changed. The third and subsequent tapes are blank scratch tapes.

Quicksort On A Randomized Turing Machine Step 1 Select Pivot (Random Aspect Of The Algorithm) The first tape contains the delineated sublist of length m. Use O(log m) new random bits from tape 2 to select a random number. Since the selected value may not be a power of 2, we may not be able to select every integer between 1 and m with equal probability. Take ┌2 log2 m┐ bits from tape 2, divide by m, and add 1. This yields a value between 1 and m with a probability close to 1/m.

Quicksort On A Randomized Turing Machine Steps 2 – 6 Place Pivot on Tape 3 Copy Values ≤ Pivot To Tape 4 (Sub-Sublist) Copy Values > Pivot To Tape 5 (Sub-Sublist) Copy The Sub-Sublists From Tapes 4 & 5 Back To The Space on Tape 1 That Held The Sublist, Placing A Marker Between The Two Sub-Sublists. If The Size of Either or Both Sub-Sublists > 1, Recursively Perform Quicksort On Those Sub-Sublists.

Section 11.4.3 Language of A Randomized Turing Machine When considering the response to input w of a randomized TM M, all possible contents of the random tape must also be considered. Some of the strings on the random tape may result in an accept state while others a reject state. Any sequence of moves that leads to acceptance uses only a finite section of the infinite random tape. If m is the number of random tape cells scanned, the probability of what is seen there is 2-m.

Example of A Randomized Turing Machine Transition Function of a Randomized Turing Function Each row corresponds to a state and each column to a pair of XY symbols where X is from the input tape and Y is from the random tape. The table entries qUVDE means the Turing Machine enters state q, writes U on the input tape, writes V on the random tape, moves the input head in direction D, and moves the random head in direction E.

Section 11.4.4 The Class RP (Random Polynomial) For a language L to be in the Random Polynomial (RP) class, it must be accepted by a randomized TM M in the following sense: If w is not in L, then the probability that M accepts w is 0. If w is in L, then the probability that M accepts w is at least ½. There is a polynomial T(n) such that if input w is of length n, then all runs of M, regardless of the contents of the random tape, halt after at most T(n) steps. Points 1 and 2 define a randomized Turing Machine of a special type, sometimes called a Monte-Carlo algorithm. Regardless of running time we may say that a randomized Turing Machine is “Monte-Carlo” if it either accepts with probability 0 or accepts with probability at least 1/2, with nothing in between. Point 3 simply addresses the running time, which is independent of whether or not the Turing Machine is “Monte-Carlo”.

Example of RP Class Consider the language L that describes a graph. The question is whether or not L contains at least one triangle, i.e., that the graph contains at least three nodes, the pairs of which are connected by edges. Condition 1 – Probability of Acceptance = 0: There are a finite number choices of edge and node for the Turing Machine to determine if the graph has a triangle. If the graph has no triangle then the probability of acceptance is 0, meeting condition 1.

Example of RP Class - Continued Condition 2 – Probability of Acceptance ≥ ½: Supposing the L has n nodes, e edges, and at least one triangle. The probability that the three nodes forming a triangle on any one of k samples is 1 – (1 – (3/(e(n – 2)))k For small values of x, a commonly used approximation of (1 – x)k is e–kx , where e is the base of the natural logrithms (2.718…). If we pick k such that kx = 1, then 1 – e–kx will be about 0.63, i.e., greater than ½. Thus k can be picked such that the probability of acceptance of a graph with a triangle is at least ½, meeting condition 2.

Example of RP Class - Continued Condition 3 – Runs In Polynomial Time: Values e (edges) and n (nodes) are no greater than the input length, and k is no more than the square of the input length. Each sample is linear in the input length since it scans the input at most four times to pick a random edge, a node, and then to check for the presence of two more edges. Therefore the Turing Machine halts in at most cubic time of the input length and thus runs in polynomial time, meeting condition 3. Because L meets all three of the conditions, it is a member of the RP class.