SlideShare a Scribd company logo
1 of 28
Download to read offline
Theory of Computation
SANGEETH N.
Syllabus
Theory of Computation: Regular languages and finite automata,
context-free languages & pushdown automata, recursively
enumerable sets & Turing machines, undecidability
Topics
● Basic Terminologies
● Regular Expression
Basic Terminologies
● Symbol: A symbol is the smallest building block, which can be any
alphabet, letter, or picture.
● Alphabets: They are a set of symbols, which are always finite.
Example: Alphabets of binary digits, decimal digits.
Basic Terminologies
● String: A string is a finite sequence of symbols from some alphabet.
● A string is generally denoted as w and the length of a string is denoted
as |w|.
● List out strings having length in the alphabet set containing {a,b}.
Basic Terminologies
● For alphabet {a, b} with length n, number of strings can be generated = 2n
● General case: If the number of symbols in the alphabet Σ is represented by |Σ|,
then a number of strings of length n, possible over Σ is |Σ|n
Basic Terminologies
● Closure Representation
○ L+: It is a Positive Closure that represents a set of all strings
except Null or ε-strings.
Basic Terminologies
● Closure Representation
○ L*: It is “Kleene Closure”, that represents the occurrence of certain
alphabets for given language alphabets from zero to the infinite
number of times.
Basic Terminologies
● List out the string accepted by a*
Basic Terminologies
● List out the string accepted by a+
Basic Terminologies
● List out the string accepted by {a,b}*
Basic Terminologies
● A language is a set of strings, chosen from some Σ*
● A language is a subset of Σ* ‘.
● A language that can be formed over ‘ Σ ‘ can be Finite or
Infinite.
Basic Terminologies
● Finite – List out string of length 2 in the alphabet {a,b}*
● Infinite – List out string starting with a in the alphabet {a,b}*
Regular Expression
● Regular Expressions are patterns that are used to denote
languages.
● An expression is regular if:
○ ɸ is a regular expression for regular language ɸ.
○ ɛ is a regular expression for regular language {ɛ}.
○ If a ∈ Σ , a is regular expression with language {a}.
Regular Expression
● An expression is regular if:
○ If a and b are regular expression, a + b is also a regular
expression with language {a,b}.
○ If a and b are regular expression, ab (concatenation of a
and b) is also regular.
○ If a is regular expression, a* (0 or more times a) is also
regular.
Regular Expression
● Write the regular expression for strings starting with a in the
alphabet set {a,b}
Regular Expression
● Write the regular expression for strings end with b in the
alphabet set {a,b}
Regular Expression
● Write the regular expression for strings start with a and end
with b in the alphabet set {a,b}
Regular Expression
● Write the regular expression for strings start with a or end
with b in the alphabet set {a,b}
Regular Expression
● Write the regular expression for strings contain a substring
abb in the alphabet set {a,b}
Regular Expression
● Find the language obtained from regular express 1*01*.
Question - 1
Which one of the following languages over the alphabet {0,1} is
described by the regular expression?
(0+1)*0(0+1)*0(0+1)*
(A) The set of all strings containing the substring 00.
(B) The set of all strings containing at most two 0’s.
(C) The set of all strings containing at least two 0’s.
(D) The set of all strings that begin and end with either 0 or 1.
Question - 1
Which one of the following languages over the alphabet {0,1} is
described by the regular expression?
(0+1)*0(0+1)*0(0+1)*
(A) The set of all strings containing the substring 00.
Question - 1
Which one of the following languages over the alphabet {0,1} is
described by the regular expression?
(0+1)*0(0+1)*0(0+1)*
(B) The set of all strings containing at most two 0’s.
Question - 1
Which one of the following languages over the alphabet {0,1} is
described by the regular expression?
(0+1)*0(0+1)*0(0+1)*
(D) The set of all strings that begin and end with either 0 or 1.
Question - 1
Which one of the following languages over the alphabet {0,1} is
described by the regular expression?
(0+1)*0(0+1)*0(0+1)*
(C) The set of all strings containing at least two 0’s.
Question - 1
Which one of the following languages over the alphabet {0,1} is
described by the regular expression?
(0+1)*0(0+1)*0(0+1)*
(A) The set of all strings containing the substring 00.
(B) The set of all strings containing at most two 0’s.
(C) The set of all strings containing at least two 0’s.
(D) The set of all strings that begin and end with either 0 or 1.
THANK YOU

More Related Content

Similar to theory of computation notes. introduction and mcq points

Theory of computing
Theory of computingTheory of computing
Theory of computing
Ranjan Kumar
 

Similar to theory of computation notes. introduction and mcq points (20)

Lesson 02
Lesson 02Lesson 02
Lesson 02
 
Lesson 02
Lesson 02Lesson 02
Lesson 02
 
theory of computation lecture 02
theory of computation lecture 02theory of computation lecture 02
theory of computation lecture 02
 
Chapter2CDpdf__2021_11_26_09_19_08.pdf
Chapter2CDpdf__2021_11_26_09_19_08.pdfChapter2CDpdf__2021_11_26_09_19_08.pdf
Chapter2CDpdf__2021_11_26_09_19_08.pdf
 
L_2_apl.pptx
L_2_apl.pptxL_2_apl.pptx
L_2_apl.pptx
 
To lec 03
To lec 03To lec 03
To lec 03
 
Lesson 04
Lesson 04Lesson 04
Lesson 04
 
Theory of computing
Theory of computingTheory of computing
Theory of computing
 
Module 1 TOC.pptx
Module 1 TOC.pptxModule 1 TOC.pptx
Module 1 TOC.pptx
 
Mod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxMod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptx
 
Handout Regular expression with examples and lecture
Handout Regular expression with examples  and lecture Handout Regular expression with examples  and lecture
Handout Regular expression with examples and lecture
 
Theory of Automata ___ Basis ...........
Theory of Automata ___ Basis ...........Theory of Automata ___ Basis ...........
Theory of Automata ___ Basis ...........
 
Automata theory - CFG and normal forms
Automata theory - CFG and normal formsAutomata theory - CFG and normal forms
Automata theory - CFG and normal forms
 
regular expressions (Regex)
regular expressions (Regex)regular expressions (Regex)
regular expressions (Regex)
 
Syntax Analyzer.pdf
Syntax Analyzer.pdfSyntax Analyzer.pdf
Syntax Analyzer.pdf
 
Lecture 1,2
Lecture 1,2Lecture 1,2
Lecture 1,2
 
Lecture 7
Lecture 7Lecture 7
Lecture 7
 
01 alphabets strings and languages
01 alphabets strings and languages01 alphabets strings and languages
01 alphabets strings and languages
 
Language
LanguageLanguage
Language
 
2_2Specification of Tokens.ppt
2_2Specification of Tokens.ppt2_2Specification of Tokens.ppt
2_2Specification of Tokens.ppt
 

Recently uploaded

會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
中 央社
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
Peter Brusilovsky
 
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfContoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
cupulin
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MysoreMuleSoftMeetup
 

Recently uploaded (20)

Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdfContoh Aksi Nyata Refleksi Diri ( NUR ).pdf
Contoh Aksi Nyata Refleksi Diri ( NUR ).pdf
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 

theory of computation notes. introduction and mcq points

  • 2. Syllabus Theory of Computation: Regular languages and finite automata, context-free languages & pushdown automata, recursively enumerable sets & Turing machines, undecidability
  • 4. Basic Terminologies ● Symbol: A symbol is the smallest building block, which can be any alphabet, letter, or picture. ● Alphabets: They are a set of symbols, which are always finite. Example: Alphabets of binary digits, decimal digits.
  • 5. Basic Terminologies ● String: A string is a finite sequence of symbols from some alphabet. ● A string is generally denoted as w and the length of a string is denoted as |w|. ● List out strings having length in the alphabet set containing {a,b}.
  • 6. Basic Terminologies ● For alphabet {a, b} with length n, number of strings can be generated = 2n ● General case: If the number of symbols in the alphabet Σ is represented by |Σ|, then a number of strings of length n, possible over Σ is |Σ|n
  • 7. Basic Terminologies ● Closure Representation ○ L+: It is a Positive Closure that represents a set of all strings except Null or ε-strings.
  • 8. Basic Terminologies ● Closure Representation ○ L*: It is “Kleene Closure”, that represents the occurrence of certain alphabets for given language alphabets from zero to the infinite number of times.
  • 9. Basic Terminologies ● List out the string accepted by a*
  • 10. Basic Terminologies ● List out the string accepted by a+
  • 11. Basic Terminologies ● List out the string accepted by {a,b}*
  • 12. Basic Terminologies ● A language is a set of strings, chosen from some Σ* ● A language is a subset of Σ* ‘. ● A language that can be formed over ‘ Σ ‘ can be Finite or Infinite.
  • 13. Basic Terminologies ● Finite – List out string of length 2 in the alphabet {a,b}* ● Infinite – List out string starting with a in the alphabet {a,b}*
  • 14. Regular Expression ● Regular Expressions are patterns that are used to denote languages. ● An expression is regular if: ○ ɸ is a regular expression for regular language ɸ. ○ ɛ is a regular expression for regular language {ɛ}. ○ If a ∈ Σ , a is regular expression with language {a}.
  • 15. Regular Expression ● An expression is regular if: ○ If a and b are regular expression, a + b is also a regular expression with language {a,b}. ○ If a and b are regular expression, ab (concatenation of a and b) is also regular. ○ If a is regular expression, a* (0 or more times a) is also regular.
  • 16. Regular Expression ● Write the regular expression for strings starting with a in the alphabet set {a,b}
  • 17. Regular Expression ● Write the regular expression for strings end with b in the alphabet set {a,b}
  • 18. Regular Expression ● Write the regular expression for strings start with a and end with b in the alphabet set {a,b}
  • 19. Regular Expression ● Write the regular expression for strings start with a or end with b in the alphabet set {a,b}
  • 20. Regular Expression ● Write the regular expression for strings contain a substring abb in the alphabet set {a,b}
  • 21. Regular Expression ● Find the language obtained from regular express 1*01*.
  • 22. Question - 1 Which one of the following languages over the alphabet {0,1} is described by the regular expression? (0+1)*0(0+1)*0(0+1)* (A) The set of all strings containing the substring 00. (B) The set of all strings containing at most two 0’s. (C) The set of all strings containing at least two 0’s. (D) The set of all strings that begin and end with either 0 or 1.
  • 23. Question - 1 Which one of the following languages over the alphabet {0,1} is described by the regular expression? (0+1)*0(0+1)*0(0+1)* (A) The set of all strings containing the substring 00.
  • 24. Question - 1 Which one of the following languages over the alphabet {0,1} is described by the regular expression? (0+1)*0(0+1)*0(0+1)* (B) The set of all strings containing at most two 0’s.
  • 25. Question - 1 Which one of the following languages over the alphabet {0,1} is described by the regular expression? (0+1)*0(0+1)*0(0+1)* (D) The set of all strings that begin and end with either 0 or 1.
  • 26. Question - 1 Which one of the following languages over the alphabet {0,1} is described by the regular expression? (0+1)*0(0+1)*0(0+1)* (C) The set of all strings containing at least two 0’s.
  • 27. Question - 1 Which one of the following languages over the alphabet {0,1} is described by the regular expression? (0+1)*0(0+1)*0(0+1)* (A) The set of all strings containing the substring 00. (B) The set of all strings containing at most two 0’s. (C) The set of all strings containing at least two 0’s. (D) The set of all strings that begin and end with either 0 or 1.