c - PowerPoint PPT Presentation

About This Presentation
Title:

c

Description:

... are still tokens after running out of b's; clear tape, write 0 and halt. ... Define M' so that it clears the input tape, writes x on it and then behaves like ... – PowerPoint PPT presentation

Number of Views:18
Avg rating:3.0/5.0
Slides: 5
Provided by: Muf7
Category:
Tags: clears

less

Transcript and Presenter's Notes

Title: c


1
Alg3 Computability Tutorial Sample Answers
1i
a
a
a
b
a
b
b
b
c
c
c
c
(abc)n anu bnu cn
1ii
a
a
b
b
c
c
1iii Assume unary representation of numbers and
at least one operator.
1
1
1

1


-
-

2
  • 2i)
  • S0,lt S1,-gt mv to beginning
  • S1,0 S2,- delete hd
  • S1,1 S2,-
  • S1, - H,-
  • S2,- S3, -gt mv R
  • S3,0 S4,- read ch and blank
  • S3,1 S4,-
  • S3,- H, -
  • S4,- S5,lt- mv L
  • S4,- S5,lt-
  • S5,- S6,0 write ch
  • S5,- S6,1
  • S6,0 S7,-gt
  • S6,1 S7,-gt mv 2 R
  • S7,- S8,-gt
  • S8,0 S4,-
  • S8,1 S4,- loop
  • S8,- H,-

3
  • 2iii)
  • For every a, write a token onto the tape
  • mv L back to lt
  • for every b, check there is a token on the tape
    if you run out of tokens, or there are still
    tokens after running out of bs clear tape,
    write 0 and halt.
  • mv L back to lt
  • for every c, check there is a token on the tape,
    if you run out of tokens, or there are still
    tokens after running out of cs clear tape,
    write 0 and halt.
  • clear tape, write 1, and halt.

4
  • 3.
  • i)HP -gt eHP
  • M x converter Me
  • Instance of HP instance of eHP
  • Define M so that it writes x on its tape and
    then behaves like M.
  • ii) HP -gt UHP
  • M x converter Ms
  • Instance of HP instance of UHP
  • Define M so that it clears the input tape,
    writes x on it and then behaves like M.
Write a Comment
User Comments (0)
About PowerShow.com