SlideShare a Scribd company logo
1 of 19
1
Undecidability that is RE
Deepak.M
1VE21CA010
CSE-AI
SRI VENKATESHWARA
COLLEGE
OF ENGINEERING
2
9.2 An Undecidable Problem
That Is RE
 Concepts to be taught:
 RE languages are accepted (recognized) by TM’s.
 RE languages may be grouped into two classes:
 Class 1 (recursive language) --- each language L
in this class has a TM (thought as an algorithm)
which not only accepts strings of L, but also tells
us what strings are not in L by halting.
 Class 2 (RE but not recursive) --- each language L
in this class has a TM (not thought as an algorithm)
which accepts strings of L, but may not halt when
a given input string is not in L.
3
9.2 An Undecidable Problem
That Is RE
 9.2.1 Recursive Languages
 Formally, a language L is recursive if L = L(M)
for some TM M such that:
(1) If wL, then M accepts (and therefore
halts).
(2) If wL, then M eventually halts, although it
never enters an accepting state (i.e., “reject”) .
 A TM of this type corresponds to the formal
notion of algorithm.
4
9.2 An Undecidable Problem
That Is RE
9.2.1 Recursive Languages
 A given language L, regarded as a problem,
is called decidable if L is a recursive
language; and undecidable if not.
 The existence or nonexistence of an
algorithm to solve a problem (i.e., the
problem is decidable or undecidable) is more
important than the existence or nonexistence
of a TM to solve the problem.
5
9.2 An Undecidable Problem
That Is RE
9.2.1 Recursive Languages
 A given language L, regarded as a
problem, is called decidable if L is a
recursive language; and undecidable if not.
Decidable prob.  recursive lang. L
 there is a TM M halts
with L as input
6
9.2 An Undecidable Problem
That Is RE
 9.2.1 Recursive Languages
 Relationships among three classes of
languages (only Ld is studied so far)
Recursive
RE but not
Recursive Not RE
Ld
LuLd Lne
Figure 9.2
Le
Lu
7
9.2 An Undecidable Problem
That Is RE
 9.2.1 Recursive Languages
 Lu, the universal language, will soon
be defined and proved not to be
recursive, though it is an RE
language.
 9.2.2 Complements of Recursive and
RE Languages
 A powerful tool of proving is language
complementation.
 We will show that the recursive language
is closed under complementation.
8
9.2 An Undecidable Problem That
Is RE
 9.2.2 Complements of Recursive & RE Langs.
 Theorem 9.3: If a language L is recursive, so isL.
Proof. Prove by constructing a halting TM to acceptL.
Let TM M accepts L, which always halts. Construct a new
TMM for M as follows (illustrated by Fig. 9.3).
M
w
Accept
Reject
Accept
Reject
Figure 9.3
M
9
9.2 An Undecidable Problem
That Is RE
 9.2.2 Complements of Recursive & RE langs.
Proof. (cont’d).
1. The accepting states of M are made
nonaccepting with no transitions, i.e., in these
states M will halt without accepting.
2.M has a new accepting state r & no transition
from r.
3. For each combination of a nonaccepting state of
M & a tape symbol of M such that M has no
transition (i.e., M halts without accepting), add a
transition to the accepting state r.
 Then if M halts, so isM, andM accepts strings
not accepted by M.
10
9.2 An Undecidable Problem
That Is RE
 9.2.2 Complements of Recursive
& RE Languages
 Theorem 9.4
If a language L and its complement are RE,
then L is recursive, and so isL (by
Theorem 9.3).
Proof. See the text book. (Easy by Fig. 9.4 in
the next page.)
11
9.2 An Undecidable Problem
That Is RE
 9.2.2 Complements of Recursive & RE
Languages
 Theorem 9.4
M1
w
Accept Accept
Reject
M2
Accept
Fig. 9.4.
Accept  halt
12
9.2 An Undecidable Problem
That Is RE
 9.2.2 Complements of Recursive & RE langs.
 Of the 9 possibilities of placing L andL in Fig. 9.2,
only the following 4 are valid by Theorems 9.3 and
9.4:
 Both L andL are recursive (both in the inner ring
of Fig. 9.2)
 Neither L norL is RE. (both in the outer ring)
 L is RE but not recursive, andL is not in RE (one
in the middle ring, and the other in the outer ring)
 L is RE but not recursive, and L is not in RE (a
swap of above)
13
9.2 An Undecidable Problem
That Is RE
 9.2.2 Complements of Recursive & RE langs.
 Of the 9 possibilities of placing L andL in Fig. 9.2,
only the following 4 are valid by Theorems 9.3 and
9.4:
Recursive
RE but not
Recursive Not RE
Recursive
RE but not
Recursive Not RE
Recursive
RE but not
Recursive Not RE
 
 


Case 1 Case 2 Cases 3 & 4
14
9.2 An Undecidable Problem
That Is RE
 9.2.2 Complements of Recursive & RE langs.
 Example 9.5
Ld is not RE as shown before.
So,Ld cannot be recursive (not in the four
cases above). (Otherwise, Ld is recursive by Thm
9.4 and so is RE too by definition, contradiction!)
It can be shown thatLd is RE (omitted), just
like the way we show the universal language
Lu to be RE (shown next).
Note thatLd is the set of strings wi such that
the corresponding Mi accepts wi.
15
9.2 An Undecidable Problem
That Is RE
 9.2.2 Complements of Recursive & RE langs.
 Example 9.5
 It can be shown thatLd is RE (omitted) but not recursive.
Recursive
RE but not
Recursive Not RE
Ld
LuLd Lne
Figure 9.2
Le
Lu
16
9.2 An Undecidable Problem
That Is RE
 9.2.2 Complements of Recursive & RE langs.
 In conclusion,Ld is RE but not recursive and so
undecidable
 That is, although there is a TM forLd, the problem
defined byLd is undecidable (there is no
algorithm for it).
 The universal language Lu has the same property,
as proved next.
17
9.2 An Undecidable Problem
That Is RE
 9.2.3 The Universal Language
 Definition:
The universal language Lu is the set of binary strings,
each of which encodes, in the notation of 9.1.2, a pair
(M, w), where M is a TM with the binary alphabet,
and w is a string in (0 + 1)*, such that w is in L(M).
Compare:Ld is the set of strings wi such that the
corresponding Mi accepts wi (note the numbering i
here)
18
9.2 An Undecidable Problem
That Is RE
 9.2.4 Undecidability of the Universal
Language (cont’d)
Recursive
RE but not
Recursive Not RE
Ld
LuLd Lne
Figure 9.2
Le
Lu
THANK YOU
19

More Related Content

Similar to Undecidable problem.pptxUndecidable problemUndecidable problem

Busy week • Lab 9 due Thursday at 5 pm L = { M,s s.docx
Busy  week • Lab 9 due Thursday at 5 pm L = { M,s  s.docxBusy  week • Lab 9 due Thursday at 5 pm L = { M,s  s.docx
Busy week • Lab 9 due Thursday at 5 pm L = { M,s s.docxjasoninnes20
 
Busy week • Lab 9 due Thursday at 5 pm L = { M,s s.docx
Busy  week • Lab 9 due Thursday at 5 pm L = { M,s  s.docxBusy  week • Lab 9 due Thursday at 5 pm L = { M,s  s.docx
Busy week • Lab 9 due Thursday at 5 pm L = { M,s s.docxclairbycraft
 

Similar to Undecidable problem.pptxUndecidable problemUndecidable problem (6)

Re1 (3)
Re1 (3)Re1 (3)
Re1 (3)
 
re1.ppt
re1.pptre1.ppt
re1.ppt
 
re1.ppt
re1.pptre1.ppt
re1.ppt
 
Busy week • Lab 9 due Thursday at 5 pm L = { M,s s.docx
Busy  week • Lab 9 due Thursday at 5 pm L = { M,s  s.docxBusy  week • Lab 9 due Thursday at 5 pm L = { M,s  s.docx
Busy week • Lab 9 due Thursday at 5 pm L = { M,s s.docx
 
Busy week • Lab 9 due Thursday at 5 pm L = { M,s s.docx
Busy  week • Lab 9 due Thursday at 5 pm L = { M,s  s.docxBusy  week • Lab 9 due Thursday at 5 pm L = { M,s  s.docx
Busy week • Lab 9 due Thursday at 5 pm L = { M,s s.docx
 
QB104545.pdf
QB104545.pdfQB104545.pdf
QB104545.pdf
 

More from DeepakM509554

osi-tcp.pptx..................................
osi-tcp.pptx..................................osi-tcp.pptx..................................
osi-tcp.pptx..................................DeepakM509554
 
pumping-lemma-181ptx01 mmmmmmmmmmmmmm1153118.p
pumping-lemma-181ptx01 mmmmmmmmmmmmmm1153118.ppumping-lemma-181ptx01 mmmmmmmmmmmmmm1153118.p
pumping-lemma-181ptx01 mmmmmmmmmmmmmm1153118.pDeepakM509554
 
Online EC- Citizen User Manual for Karnataka
Online EC- Citizen User Manual for KarnatakaOnline EC- Citizen User Manual for Karnataka
Online EC- Citizen User Manual for KarnatakaDeepakM509554
 
DATABASE MANAGEMENT SYSTEM ARCHITECTURE
DATABASE    MANAGEMENT SYSTEM	 ARCHITECTUREDATABASE    MANAGEMENT SYSTEM	 ARCHITECTURE
DATABASE MANAGEMENT SYSTEM ARCHITECTUREDeepakM509554
 
Heart_Circulation.pptx
Heart_Circulation.pptxHeart_Circulation.pptx
Heart_Circulation.pptxDeepakM509554
 
quick sort by deepak.pptx
quick sort by deepak.pptxquick sort by deepak.pptx
quick sort by deepak.pptxDeepakM509554
 
scheduling-algorithms.pdf
scheduling-algorithms.pdfscheduling-algorithms.pdf
scheduling-algorithms.pdfDeepakM509554
 
CSE680-07QuickSort.pptx
CSE680-07QuickSort.pptxCSE680-07QuickSort.pptx
CSE680-07QuickSort.pptxDeepakM509554
 

More from DeepakM509554 (9)

osi-tcp.pptx..................................
osi-tcp.pptx..................................osi-tcp.pptx..................................
osi-tcp.pptx..................................
 
pumping-lemma-181ptx01 mmmmmmmmmmmmmm1153118.p
pumping-lemma-181ptx01 mmmmmmmmmmmmmm1153118.ppumping-lemma-181ptx01 mmmmmmmmmmmmmm1153118.p
pumping-lemma-181ptx01 mmmmmmmmmmmmmm1153118.p
 
Online EC- Citizen User Manual for Karnataka
Online EC- Citizen User Manual for KarnatakaOnline EC- Citizen User Manual for Karnataka
Online EC- Citizen User Manual for Karnataka
 
DATABASE MANAGEMENT SYSTEM ARCHITECTURE
DATABASE    MANAGEMENT SYSTEM	 ARCHITECTUREDATABASE    MANAGEMENT SYSTEM	 ARCHITECTURE
DATABASE MANAGEMENT SYSTEM ARCHITECTURE
 
Heart_Circulation.pptx
Heart_Circulation.pptxHeart_Circulation.pptx
Heart_Circulation.pptx
 
quick sort by deepak.pptx
quick sort by deepak.pptxquick sort by deepak.pptx
quick sort by deepak.pptx
 
scheduling-algorithms.pdf
scheduling-algorithms.pdfscheduling-algorithms.pdf
scheduling-algorithms.pdf
 
quicksort.ppt
quicksort.pptquicksort.ppt
quicksort.ppt
 
CSE680-07QuickSort.pptx
CSE680-07QuickSort.pptxCSE680-07QuickSort.pptx
CSE680-07QuickSort.pptx
 

Recently uploaded

ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...tanu pandey
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01KreezheaRecto
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Christo Ananth
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 

Recently uploaded (20)

ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
 

Undecidable problem.pptxUndecidable problemUndecidable problem

  • 1. 1 Undecidability that is RE Deepak.M 1VE21CA010 CSE-AI SRI VENKATESHWARA COLLEGE OF ENGINEERING
  • 2. 2 9.2 An Undecidable Problem That Is RE  Concepts to be taught:  RE languages are accepted (recognized) by TM’s.  RE languages may be grouped into two classes:  Class 1 (recursive language) --- each language L in this class has a TM (thought as an algorithm) which not only accepts strings of L, but also tells us what strings are not in L by halting.  Class 2 (RE but not recursive) --- each language L in this class has a TM (not thought as an algorithm) which accepts strings of L, but may not halt when a given input string is not in L.
  • 3. 3 9.2 An Undecidable Problem That Is RE  9.2.1 Recursive Languages  Formally, a language L is recursive if L = L(M) for some TM M such that: (1) If wL, then M accepts (and therefore halts). (2) If wL, then M eventually halts, although it never enters an accepting state (i.e., “reject”) .  A TM of this type corresponds to the formal notion of algorithm.
  • 4. 4 9.2 An Undecidable Problem That Is RE 9.2.1 Recursive Languages  A given language L, regarded as a problem, is called decidable if L is a recursive language; and undecidable if not.  The existence or nonexistence of an algorithm to solve a problem (i.e., the problem is decidable or undecidable) is more important than the existence or nonexistence of a TM to solve the problem.
  • 5. 5 9.2 An Undecidable Problem That Is RE 9.2.1 Recursive Languages  A given language L, regarded as a problem, is called decidable if L is a recursive language; and undecidable if not. Decidable prob.  recursive lang. L  there is a TM M halts with L as input
  • 6. 6 9.2 An Undecidable Problem That Is RE  9.2.1 Recursive Languages  Relationships among three classes of languages (only Ld is studied so far) Recursive RE but not Recursive Not RE Ld LuLd Lne Figure 9.2 Le Lu
  • 7. 7 9.2 An Undecidable Problem That Is RE  9.2.1 Recursive Languages  Lu, the universal language, will soon be defined and proved not to be recursive, though it is an RE language.  9.2.2 Complements of Recursive and RE Languages  A powerful tool of proving is language complementation.  We will show that the recursive language is closed under complementation.
  • 8. 8 9.2 An Undecidable Problem That Is RE  9.2.2 Complements of Recursive & RE Langs.  Theorem 9.3: If a language L is recursive, so isL. Proof. Prove by constructing a halting TM to acceptL. Let TM M accepts L, which always halts. Construct a new TMM for M as follows (illustrated by Fig. 9.3). M w Accept Reject Accept Reject Figure 9.3 M
  • 9. 9 9.2 An Undecidable Problem That Is RE  9.2.2 Complements of Recursive & RE langs. Proof. (cont’d). 1. The accepting states of M are made nonaccepting with no transitions, i.e., in these states M will halt without accepting. 2.M has a new accepting state r & no transition from r. 3. For each combination of a nonaccepting state of M & a tape symbol of M such that M has no transition (i.e., M halts without accepting), add a transition to the accepting state r.  Then if M halts, so isM, andM accepts strings not accepted by M.
  • 10. 10 9.2 An Undecidable Problem That Is RE  9.2.2 Complements of Recursive & RE Languages  Theorem 9.4 If a language L and its complement are RE, then L is recursive, and so isL (by Theorem 9.3). Proof. See the text book. (Easy by Fig. 9.4 in the next page.)
  • 11. 11 9.2 An Undecidable Problem That Is RE  9.2.2 Complements of Recursive & RE Languages  Theorem 9.4 M1 w Accept Accept Reject M2 Accept Fig. 9.4. Accept  halt
  • 12. 12 9.2 An Undecidable Problem That Is RE  9.2.2 Complements of Recursive & RE langs.  Of the 9 possibilities of placing L andL in Fig. 9.2, only the following 4 are valid by Theorems 9.3 and 9.4:  Both L andL are recursive (both in the inner ring of Fig. 9.2)  Neither L norL is RE. (both in the outer ring)  L is RE but not recursive, andL is not in RE (one in the middle ring, and the other in the outer ring)  L is RE but not recursive, and L is not in RE (a swap of above)
  • 13. 13 9.2 An Undecidable Problem That Is RE  9.2.2 Complements of Recursive & RE langs.  Of the 9 possibilities of placing L andL in Fig. 9.2, only the following 4 are valid by Theorems 9.3 and 9.4: Recursive RE but not Recursive Not RE Recursive RE but not Recursive Not RE Recursive RE but not Recursive Not RE       Case 1 Case 2 Cases 3 & 4
  • 14. 14 9.2 An Undecidable Problem That Is RE  9.2.2 Complements of Recursive & RE langs.  Example 9.5 Ld is not RE as shown before. So,Ld cannot be recursive (not in the four cases above). (Otherwise, Ld is recursive by Thm 9.4 and so is RE too by definition, contradiction!) It can be shown thatLd is RE (omitted), just like the way we show the universal language Lu to be RE (shown next). Note thatLd is the set of strings wi such that the corresponding Mi accepts wi.
  • 15. 15 9.2 An Undecidable Problem That Is RE  9.2.2 Complements of Recursive & RE langs.  Example 9.5  It can be shown thatLd is RE (omitted) but not recursive. Recursive RE but not Recursive Not RE Ld LuLd Lne Figure 9.2 Le Lu
  • 16. 16 9.2 An Undecidable Problem That Is RE  9.2.2 Complements of Recursive & RE langs.  In conclusion,Ld is RE but not recursive and so undecidable  That is, although there is a TM forLd, the problem defined byLd is undecidable (there is no algorithm for it).  The universal language Lu has the same property, as proved next.
  • 17. 17 9.2 An Undecidable Problem That Is RE  9.2.3 The Universal Language  Definition: The universal language Lu is the set of binary strings, each of which encodes, in the notation of 9.1.2, a pair (M, w), where M is a TM with the binary alphabet, and w is a string in (0 + 1)*, such that w is in L(M). Compare:Ld is the set of strings wi such that the corresponding Mi accepts wi (note the numbering i here)
  • 18. 18 9.2 An Undecidable Problem That Is RE  9.2.4 Undecidability of the Universal Language (cont’d) Recursive RE but not Recursive Not RE Ld LuLd Lne Figure 9.2 Le Lu