Turing - Turing Machines The Language Hierarchy * a Regular...

Info iconThis preview shows pages 1–37. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Turing Machines The Language Hierarchy * a Regular Languages Context-Free Languages n n b a R ww n n n c b a ww ? * * b a ? * a Regular Languages Context-Free Languages n n b a R ww n n n c b a ww * * b a Languages accepted by Turing Machines A Turing Machine ...... ...... Tape Read-Write head Control Unit The Tape ...... ...... Read-Write head No boundaries -- infinite length The head moves Left or Right ...... ...... Read-Write head The head at each transition (time step): 1. Reads a symbol 2. Writes a symbol 3. Moves Left or Right ...... ...... Example: Time 0 ...... ...... Time 1 1. Reads 2. Writes a a c b a b k c a k 3. Moves Left ...... ...... Time 1 a b k c ...... ...... Time 2 a k c f 1. Reads 2. Writes b f 3. Moves Right The Input String ...... ...... Blank symbol head a b c a Head starts at the leftmost position of the input string Input string States & Transitions 1 q 2 q L b a , Read Write Move Left 1 q 2 q R b a , Move Right Example: 1 q 2 q R b a , ...... ...... a b c a Time 1 1 q current state ...... ...... a b c a Time 1 1 q 2 q R b a , ...... ...... a b c b Time 2 1 q 2 q ...... ...... a b c a Time 1 1 q 2 q L b a , ...... ...... a b c b Time 2 1 q 2 q Example: ...... ...... a b c a Time 1 1 q 2 q R g , ...... ...... g a b c b Time 2 1 q 2 q Example: Determinism 1 q 2 q R b a , Allowed Not Allowed 3 q L d b , 1 q 2 q R b a , 3 q L d a , No lambda transitions allowed Turing Machines are deterministic Partial Transition Function 1 q 2 q R b a , 3 q L d b , ...... ...... a b c a 1 q Example: No transition for input symbol c Allowed: Halting The machine halts in a state if there is no transition to follow Halting Example 1: ...... ...... a b c a 1 q 1 q No transition from HALT!!! 1 q Halting Example 2: ...... ...... a b c a 1 q 1 q 2 q R b a , 3 q L d b , No possible transition from and symbol HALT!!! 1 q c Accepting States 1 q 2 q Allowed 1 q 2 q Not Allowed Accepting states have no outgoing transitions The machine halts and accepts Acceptance Accept Input If machine halts in an accept state Reject Input If machine halts in a non-accept state or If machine enters an infinite loop string string Observation: In order to accept an input string, it is not necessary to scan all the symbols in the string Turing Machine Example Accepts the language: * a q R a a , L , 1 q Input alphabet } , { b a = a a Time 0 q a q R a a , L , 1 q a a Time 1 q a q R a a , L , 1 q a a Time 2 q a q R a a , L , 1 q a a Time 3 q a q R a a , L , 1 q a a Time 4 1 q a q R a a , L , 1 q Halt & Accept Rejection Example q R a a , L , 1 q b a Time 0 q a q R a a , L , 1 q b a Time 1 q a No possible Transition Halt & Reject Accepts the language: * a q but for input alphabet } { a = A simpler machine for same language a a Time 0 q a q Halt & Accept Not necessary to scan input Infinite Loop Example q R a a , L , 1 q L b b , A Turing machine for language * ) ( * b a b a + + b a Time 0 q a q R a a , L , 1 q L b b , b a Time 1 q a q R a a , L , 1 q L b b , b a Time 2 q a q R a a , L , 1 q L b b ,...
View Full Document

Page1 / 101

Turing - Turing Machines The Language Hierarchy * a Regular...

This preview shows document pages 1 - 37. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online