Markov Algorithms An Alternative Model of Computation.

27
Markov Algorithms An Alternative Model of Computation

Transcript of Markov Algorithms An Alternative Model of Computation.

Page 1: Markov Algorithms An Alternative Model of Computation.

Markov Algorithms

An Alternative Model of Computation

Page 2: Markov Algorithms An Alternative Model of Computation.

An Algorithm Scheme

Example 4.1.1. Let be alphabet {a, b, c, d}. By a Markov algorithm scheme or schema we shall mean a finite sequence of productions or rewrite rules. As a first example, consider the following two-member sequence of productions. 

(i) a c(ii) b

Page 3: Markov Algorithms An Alternative Model of Computation.

Another Example

Example 4.1.2. Let be alphabet {a, b, c, d}. Next, consider the following three-member sequence of productions.

(i) a c(ii) bc cb(iii) b .cd

Page 4: Markov Algorithms An Alternative Model of Computation.

Appends ab

Example 4.1.3. Let input alphabet = {a, b}. Let work alphabet be {#}. We see that the Markov algorithm scheme consisting of the four-member production sequence  

(i) #a a#(ii) #b b#(iii) # .ab(iv) #

 has the effect of appending string ab to any word over .

Page 5: Markov Algorithms An Alternative Model of Computation.

Reverse Word

• Input word w over = {a, b} transformed by AS into output word wR

Page 6: Markov Algorithms An Alternative Model of Computation.

Markov Algorithms

• We can implement each of our three computational paradigms

• Language acceptance (recognition)

• Function computation

• Transduction

Page 7: Markov Algorithms An Alternative Model of Computation.

A Formal Definition

• Markov algorithm schema S = any triple , , nonempty input alphabet finite work alphabet with finite, ordered sequence of productions of form

or of form . and (possibly empty) words over

Page 8: Markov Algorithms An Alternative Model of Computation.

Language Acceptance

• Example 4.2.1

• Input alphabet = {a, b}

• Work alphabet = {@, %, $, 1}.

• Six productions/one of them terminal

• Transforms all and only words in language {anbm|n 0, m 1} to word 1

Page 9: Markov Algorithms An Alternative Model of Computation.

Some Conventions

• S a Markov algorithm schema

• Input alphabet

• work alphabet with 1.

• S accepts word w if w * 1

Page 10: Markov Algorithms An Alternative Model of Computation.

Markov-Acceptable Language

• Schema S accepts language L if S accepts all and only words in L.

• A language that is accepted by some Markov algorithm is said to be a Markov-acceptable language.

Page 11: Markov Algorithms An Alternative Model of Computation.

Example

• Language {anbm|n 0, m 1} is accepted by Example 4.2.1

Page 12: Markov Algorithms An Alternative Model of Computation.

Language Recognition

• Input alphabet and work alphabet such that both 0, 1 \

• S recognizes language L over • S transforms w L into 1, that is, w * 1

(accepting 1)• S transforms w L into 0, that is, w * 0

(rejecting 0)• Language recognized by some Markov algorithm

S is said to be Markov-recognizable•

Page 13: Markov Algorithms An Alternative Model of Computation.

Resources (Time)

• Definition

• timeS(n) = the maximum number of steps

in any terminating computation of S for input of length n

Page 14: Markov Algorithms An Alternative Model of Computation.

Resources (Space)

• Computation of a Markov algorithm = sequence of computation words

• Definition

• spaceS(n) = the maximum length of any

computation word in any terminating computation of S for input of length n

Page 15: Markov Algorithms An Alternative Model of Computation.

Resource Analysis

• Example 4.2.3 accepts language {w*|na(w) = nb(w)} with = {a, b}

• timeS(n) = (n/2)2 + n + 2 for even n so O(n2)

• spaceS(n) = n + 1 so O(n)

• Compare single-tape Turing machine Same Number of as and bs

Page 16: Markov Algorithms An Alternative Model of Computation.

Function Computation

• Example

• One terminal production 1 .11

• Computes unary successor function

Page 17: Markov Algorithms An Alternative Model of Computation.

Formal Definition

• S computes unary partial number-theoretic function f

• S applied to input 1n + 1 yields output 1f(n) + 1

• If S applied to input 1n + 1, where function f is not defined for n, then either S’ computation never terminates or its output is not of form 1m

Page 18: Markov Algorithms An Alternative Model of Computation.

Two More Examples

• log n computes f(n) = log2n if n > 0 and

undefined otherwise

• Example 4.3.6 computes binary function f(n, m) = .|n m| mod 3

Page 19: Markov Algorithms An Alternative Model of Computation.

Labeled Markov Algorithm That Accepts {w|

na(w) = nb(w) = nc(w)} L1: a ; L2

; L4

L2: b ; L3

; L5

L3: c ; L1

; L5

L4: b ; L5

c ; L5

1 ; L5L5: .

Page 20: Markov Algorithms An Alternative Model of Computation.

Other Examples

• Palindromes

• m divides n

• log n – labeled algorithms

Page 21: Markov Algorithms An Alternative Model of Computation.

Equivalence Result

• Let S be labeled Markov algorithm with input alphabet . Then there exists standard Markov algorithm S´ with input alphabet that is computationally equivalent to S.

• Converse obvious

Page 22: Markov Algorithms An Alternative Model of Computation.

Equivalence Result

• Class of Markov-computable functions Is identical to the class of Turing-computable functions

• Function f is Markov-computable iff f is Turing-computable

Page 23: Markov Algorithms An Alternative Model of Computation.

Proof

• Example 4.5.1/Turing machine that simulates a Markov algorithm

• For the other direction, see Example 4.5.2/Markov algorithm that simulates a Turing machine

• Generalizations

Page 24: Markov Algorithms An Alternative Model of Computation.

• Given Turing machine M accepting L, there exists Markov algorithm AS that accepts L in

O(timeM(n)) steps

• Given Markov algorithm AS accepting L,

there exists Turing machine M that accepts L in O([timeAS

(n)]4) steps

Page 25: Markov Algorithms An Alternative Model of Computation.

Another Example

= and single production 11 1

• Computes unary constant-0 function

C01(n) = 0 for all n

• So C01 is Markov-computable

Page 26: Markov Algorithms An Alternative Model of Computation.

Another Example

 

2n 1 if n 1f(n) =

0 if n = 0  computed by

$1 11$111$ .111$ .1 $

 

Page 27: Markov Algorithms An Alternative Model of Computation.

Computing k-ary Functions

• if S applied to input 1n1 + 11n2 + 1…1nk + 1

then S yields output word 1f(n1, n2, …, nk) + 1

• if S applied to input 1n1 + 11n2 + 1…1nk + 1

where function f is not defined for arguments n1, n2, …, nk, then either S never halts or

output word not of form 1m for m 1