• Nem Talált Eredményt

Theory of Algorithms 2019 Practice session 2. Finite Automata 1. Let Σ =

N/A
N/A
Protected

Academic year: 2022

Ossza meg "Theory of Algorithms 2019 Practice session 2. Finite Automata 1. Let Σ ="

Copied!
1
0
0

Teljes szövegt

(1)

Theory of Algorithms 2019 Practice session 2.

Finite Automata

1. Let Σ = {0,1}. Give a deterministic finite automaton that accepts the words that contain an even number of zeros and an odd number of ones.

2. Let Σ = {0,1}. Give a deterministic finite automaton that accepts the words that contain an even number of zeros, while the number of ones is divisible by three.

3. Let Σ ={0,1}. Give a deterministic finite automaton that accepts the words that contain at least three1’s.

4. Let Σ ={0,1}. Give a deterministic finite automaton that accepts the words that do not contain subword 001.

5. Which words are accepted by this automaton? (Σ ={0,1})

A B C

0 1

1 0 0,1 6. Perform the following for both nondeter-

ministic finite automata

(a) Give the computation tree of word baabab.

(b) Create an equivalent DFA by the procedure studied in class.

(c) Which languages are recognized by these automata?

S A

B

C

D a,b

a b

a

b

a,b

a,b

A B

C a

a,b a,c

a,c b

b

a,b c

c

7. Give a nondeterministic finite automaton that accepts those words that have 10100 as subword.

8. Prove that the language that consists of those words that have two 1’s such that the number of 0’s between them is divisible by four, is regular. (There could be several 1’s between the two chosen1’s, besides the 4k 0’s.)

9. Design a finite automaton that accepts positive rational numbers written in decimal form. (Σ contains the decimal point and digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. The number to be accepted is either an integer without decimal point (e.g. 123), or it contains a decimal point. In this latter case numbers without integer part or fractional part must also be accepted, but at most one of these parts may be missing. (For example, 123.456, 123. and .456 are all accepted but a single decimal point is not.) It is also requested that a number cannot begin with dummy 0’s, however 0.456is OK.

10. Let Σ = {0,1}. The sequences are considered as binary numbers. Give a finite automaton that accepts exactly those words that represent numbers divisible by three in binary form. Take into consideration that a number does not begin with 0, except for number zero itself, and that the input number is read beginning with the most significant digit.

11. Let language Lk consist of those words over alphabet Σ ={a,b} that have character bon the kth position counting from backwards. (For example bbaa∈L3∩L4.)

(a) Prove that there exists a nondeterministic automaton of k+ 1 states recognizing language Lk for all k≥1.

(b) Prove that every deterministic automaton recognizing Lk has at least 2k states.

12. Prove that every NFA can be transformed so that the recognizes the same language, however it has a unique accept state.

13. The language LR is obtained from language Lso that every word in Lis reversed, that is the characters of the word are written in reverse order. Prove that L is regular ⇐⇒ LRis regular.

Hivatkozások

KAPCSOLÓDÓ DOKUMENTUMOK

Another interesting consequence of our result is that if the clone of a finite bounded poset is finitely generated, then it has a three element generating set that consists of

The required number of modes in the finite modal analysis is specified so that the numerical damping caused by the omitted modes does not change the periodic or non-periodic

Is there a grammar for all languages that contain nite number of

A finite automaton is said to be directable if it has an input word, a directing word, which takes it from every state into the same state.. For nondeterministic (n.d.)

The main feature of the SPS method is that it constructs a confidence region which has an exact probability of containing the true system parameter based on a finite number of

[8] minimized deterministic offline sensing top-down unranked tree automata, where an unambiguous nondeterministic finite state au- tomaton, associated with the state of the

The extended formula used in Kotorova and Nefedov’s (2015) Comprehensive Ket Dictionary includes all lexically fixed morpheme shapes, including detransitive P8,

While all functions (with a couple of trivial exceptions) from the set of subsets of a finite set S into itself can be defined if the number of resources is unrestricted, only