• No results found

Automata Theory and Computability

N/A
N/A
Protected

Academic year: 2022

Share "Automata Theory and Computability"

Copied!
44
0
0

Loading.... (view fulltext now)

Full text

(1)

CS310 : Automata Theory 2020

Lecture 1: Automata Theory and Computability

Instructor: S. Akshay

IIT Bombay, India

13-01-2020

(2)

Automata Theory and Computability

What is this course about?

I Things that compute: Abacus, calculators

I Well, and Computers. How do we model them? I Mathematical models for computation and computers I Why mathematical? why theory?

I Limits of computers and computation I Can a computer do ANYTHING? I Are there things that cannot be solved?

(3)

Automata Theory and Computability

What is this course about?

I Things that compute: Abacus, calculators I Well, and Computers.

How do we model them? I Mathematical models for computation and computers I Why mathematical? why theory?

I Limits of computers and computation I Can a computer do ANYTHING? I Are there things that cannot be solved?

(4)

Automata Theory and Computability

What is this course about?

I Things that compute: Abacus, calculators I Well, and Computers. How do we model them?

I Mathematical models for computation and computers I Why mathematical? why theory?

I Limits of computers and computation I Can a computer do ANYTHING? I Are there things that cannot be solved?

(5)

Automata Theory and Computability

What is this course about?

I Things that compute: Abacus, calculators I Well, and Computers. How do we model them?

I Mathematical models for computation and computers

I Why mathematical? why theory? I Limits of computers and computation

I Can a computer do ANYTHING? I Are there things that cannot be solved?

(6)

Automata Theory and Computability

What is this course about?

I Things that compute: Abacus, calculators I Well, and Computers. How do we model them?

I Mathematical models for computation and computers I Why mathematical? why theory?

I Limits of computers and computation I Can a computer do ANYTHING? I Are there things that cannot be solved?

(7)

Automata Theory and Computability

What is this course about?

I Things that compute: Abacus, calculators I Well, and Computers. How do we model them?

I Mathematical models for computation and computers I Why mathematical? why theory?

I Limits of computers and computation

I Can a computer do ANYTHING? I Are there things that cannot be solved?

(8)

Automata Theory and Computability

What is this course about?

I Things that compute: Abacus, calculators I Well, and Computers. How do we model them?

I Mathematical models for computation and computers I Why mathematical? why theory?

I Limits of computers and computation I Can a computer do ANYTHING?

I Are there things that cannot be solved?

(9)

Course Outline

What we plan to cover

1. Finite automata and regular languages/expressions and more...

2. Pushdown automata, context-free grammars and other models of computation

3. Turing machines and computability: the extents and limits of computation

4. Efficient computation: basic complexity classes...

(10)

Logistics

Evaluation I Quizzes 30%

I Midsem 25%

I Endsem 40%

I Attendance/Pop quizzes 5%

Recommended text

I Intro to Automata Theory, Languages and Computation: Hopcroft, Motwani, Ullman

I Intro to Theory of Computation: Michael Sipser

(11)

Logistics

Evaluation I Quizzes 30%

I Midsem 25%

I Endsem 40%

I Attendance/Pop quizzes 5%

Recommended text

I Intro to Automata Theory, Languages and Computation: Hopcroft, Motwani, Ullman

I Intro to Theory of Computation: Michael Sipser

(12)

Logistics (Contd.)

Course material

See https://www.cse.iitb.ac.in/∼akshayss/teaching/cs310-2020

Discussions

I For online discussions: Piazza (To be set up).

I Weekly problem solving session: 1 hour per week (To be fixed by TAs).

I Office hours: by email appointment/weekly hour (TBA).

(13)

Module 1: Finite Automata and regular languages

Modeling a computing device :an automaton I Input

I Processing I Output

Example

I Consider a bulb with a switch. I Its input are: on/off

I Behavior during the day is: “on off on off” I When light is off, I can turn it on and vice versa.

(14)

Module 1: Finite Automata and regular languages

Modeling a computing device :an automaton I Input

I Processing I Output

Example

I Consider a bulb with a switch.

I Its input are: on/off

I Behavior during the day is: “on off on off” I When light is off, I can turn it on and vice versa.

(15)

Module 1: Finite Automata and regular languages

Modeling a computing device :an automaton I Input

I Processing I Output

Example

I Consider a bulb with a switch.

I Its input are: on/off

I Behavior during the day is: “on off on off”

I When light is off, I can turn it on and vice versa.

(16)

Module 1: Finite Automata and regular languages

Modeling a computing device :an automaton I Input

I Processing I Output

Example

I Consider a bulb with a switch.

I Its input are: on/off

I Behavior during the day is: “on off on off”

I When light is off, I can turn it on and vice versa.

(17)

Inputs

I Domain of inputs/actions: Σ ={on,off} I This is called theAlphabet.

I Elements areLetters.

I Inputs or behaviors are strings or sequences of letters, calledwords. I Example: “on off on off on off” is a word in Σ.

Set of words over Σ

I Σ =∪n≥0Σn , i.e., all finite words over alphabet Σ. I What is Σ0?

I What is the difference between Σ+ and Σ?

(18)

Inputs

I Domain of inputs/actions: Σ ={on,off} I This is called theAlphabet.

I Elements areLetters.

I Inputs or behaviors are strings or sequences of letters, calledwords.

I Example: “on off on off on off” is a word in Σ.

Set of words over Σ

I Σ =∪n≥0Σn , i.e., all finite words over alphabet Σ. I What is Σ0?

I What is the difference between Σ+ and Σ?

(19)

Inputs

I Domain of inputs/actions: Σ ={on,off} I This is called theAlphabet.

I Elements areLetters.

I Inputs or behaviors are strings or sequences of letters, calledwords.

I Example: “on off on off on off” is a word in Σ.

Set of words over Σ

I Σ =∪n≥0Σn , i.e., all finite words over alphabet Σ.

I What is Σ0?

I What is the difference between Σ+ and Σ?

(20)

Inputs

I Domain of inputs/actions: Σ ={on,off} I This is called theAlphabet.

I Elements areLetters.

I Inputs or behaviors are strings or sequences of letters, calledwords.

I Example: “on off on off on off” is a word in Σ.

Set of words over Σ

I Σ =∪n≥0Σn , i.e., all finite words over alphabet Σ.

I What is Σ0?

I What is the difference between Σ+ and Σ?

(21)

Inputs

I Domain of inputs/actions: Σ ={on,off} I This is called theAlphabet.

I Elements areLetters.

I Inputs or behaviors are strings or sequences of letters, calledwords.

I Example: “on off on off on off” is a word in Σ.

Set of words over Σ

I Σ =∪n≥0Σn , i.e., all finite words over alphabet Σ.

I What is Σ0?

I What is the difference between Σ+ and Σ?

(22)

Processing

Processing

I States: current information which allows to process the next letter/input.

start dark light

(23)

Processing

Processing

I States: current information which allows to process the next letter/input.

I Transitions: read an input and movefrom a state to another

start dark light

on

off

(24)

Where is the automaton?

start dark light

on

off

Whichstate is reachedafter reading the following words?

1. “on off on”

(25)

Where is the automaton?

start dark light

on

off

Whichstate is reachedafter reading the following words?

1. “on off on”

2. “off off”

(26)

Where is the automaton?

start dark light

off

on

off

on

Whichstate is reachedafter reading the following words?

1. “on off on”

2. “off off”

(27)

Where is the automaton?

start dark light

off

on

off

on

Whichstate is reachedafter reading the following words?

1. “on off on”

2. “off off”

3. “on (off on)

(28)

Outputs: accepting states

start dark light

off

on

off

on

1. Some states are designated “accept” or “final”

2. If an input word moves to accept state, then its accepted, else rejected.

3. What are the words accepted by above automaton?

(29)

Language of an automaton

I All words accepted by an automaton form itslanguage.

start dark light

off

on

off

on

(30)

Languages

Let Σ be a finite alphabet.

A language over Σ is a subset of Σ. Examples:

1. L1: words that end with 1

2. L2: words that haven 0s followed byn 1s, for each non-negative integer n.

3. L3: words of length a prime number.

I Give an example of a finite and infinite language.

I Give an example of a language that contains any language over Σ.

(31)

Languages

Let Σ be a finite alphabet.

A language over Σ is a subset of Σ. Examples:

1. L1: words that end with 1

2. L2: words that haven 0s followed byn 1s, for each non-negative integer n.

3. L3: words of length a prime number.

I Give an example of a finite and infinite language.

I Give an example of a language that contains any language over Σ.

(32)

Languages

Let Σ be a finite alphabet.

A language over Σ is a subset of Σ. Examples:

1. L1: words that end with 1

2. L2: words that haven 0s followed byn 1s, for each non-negative integer n.

3. L3: words of length a prime number.

I Give an example of a finite and infinite language.

I Give an example of a language that contains any language over Σ.

(33)

Languages

Let Σ be a finite alphabet.

A language over Σ is a subset of Σ. Examples:

1. L1: words that end with 1

2. L2: words that haven 0s followed byn 1s, for each non-negative integer n.

3. L3: words of length a prime number.

I Give an example of a finite and infinite language.

I Give an example of a language that contains any language over Σ.

(34)

Languages

Let Σ be a finite alphabet.

A language over Σ is a subset of Σ. Examples:

1. L1: words that end with 1

2. L2: words that haven 0s followed byn 1s, for each non-negative integer n.

3. L3: words of length a prime number.

I Give an example of a finite and infinite language.

I Give an example of a language that contains any language over Σ.

(35)

Languages as problems

Computing problems can be seen as languages!

Consider

I is n∈Na prime?

I with Σ ={a}, ask ifan∈L3.

I That is, all theyesinstances of the problem are in the language and only these are!

I Can there be an automaton for this?

We will go back-and-forth between languages and problems!

(36)

Languages as problems

Computing problems can be seen as languages!

Consider

I is n∈Na prime?

I with Σ ={a}, ask ifan∈L3.

I That is, all theyesinstances of the problem are in the language and only these are!

I Can there be an automaton for this?

We will go back-and-forth between languages and problems!

(37)

Languages as problems

Computing problems can be seen as languages!

Consider

I is n∈Na prime?

I with Σ ={a}, ask ifan∈L3.

I That is, all theyesinstances of the problem are in the language and only these are!

I Can there be an automaton for this?

We will go back-and-forth between languages and problems!

(38)

Languages as problems

Computing problems can be seen as languages!

Consider

I is n∈Na prime?

I with Σ ={a}, ask ifan∈L3.

I That is, all theyesinstances of the problem are in the language and only these are!

I Can there be an automaton for this?

We will go back-and-forth between languages and problems!

(39)

Languages as problems

Computing problems can be seen as languages!

Consider

I is n∈Na prime?

I with Σ ={a}, ask ifan∈L3.

I That is, all theyesinstances of the problem are in the language and only these are!

I Can there be an automaton for this?

We will go back-and-forth between languages and problems!

(40)

Languages and regular languages

I So, given a language, the question is:

I Can we define an automaton that accepts exactly that language!

Example

I Fix Σ ={a,b}

I Let Lbe all words over Σ that have odd number ofa’s.

I What automaton would acceptL?

start

b

a

a

b

(41)

Languages and regular languages

I So, given a language, the question is:

I Can we define an automaton that accepts exactly that language!

Example

I Fix Σ ={a,b}

I Let Lbe all words over Σ that have odd number ofa’s.

I What automaton would acceptL?

start

b

a

a

b

(42)

Languages and regular languages

I So, given a language, the question is:

I Can we define an automaton that accepts exactly that language!

Example

I Fix Σ ={a,b}

I Let Lbe all words over Σ that have odd number ofa’s.

I What automaton would acceptL?

start

b

a

a

b

(43)

Some more examples

Let Lbe set of all words over Σ ={a,b} which end withbb.

1. WriteL in set notation.

2. Give an automaton that accepts L.

LetL0 be set of all words over Σ ={0,1}which are binary representations of multiple of 3.

1. WriteL0 in set notation.

2. Give an automaton that accepts L0.

(44)

Some more examples

Let Lbe set of all words over Σ ={a,b} which end withbb.

1. WriteL in set notation.

2. Give an automaton that accepts L.

Let L0 be set of all words over Σ ={0,1}which are binary representations of multiple of 3.

1. WriteL0 in set notation.

2. Give an automaton that accepts L0.

References

Related documents

– Nondeterministic finite state automata (also with ε-transitions) – Kleene’s regular expressions, also appeared as Type-3 languages in.. Chomsky’s

If L is the language accepted of P by empty stack , there exists PDA P 0 such that its language accepted by final state is L.

I CS 433: Automated reasoning: advanced course more practical I CS 713: Specialized course on Automata & logic connections I CS 738/739: Model checking, cyber-physical systems. I

I Section 8.4, 8.5, Introduction to Automata Theory, Languages and Computation, Hopcroft, Motwani and Ullman.. I Section 3.2, 4.1, Introduction to the Theory of Computation,

The data pertaining to existing services may include information on existing water supply services (including daily consumption per household) can be used to estimate

Catch (kg), fishing effort (no. The big-eye scad, Selar crumenophthalmus, locally known as kannankozhuchala or kannan- para or peringampara, formed the bulk of the 10.. The

During the second I–V sweep at the negative side, when the RESET voltage reaches –1 ⋅ 2 V, the current decreases rapidly which shows switching from the ON state to the OFF state..

(ii) Type of output element(solid state relay, isolator) (iii) Controllers(on/off, proportional, PID).. A Bulb is used for heating and a fan is used for cooling purpose. When