• 沒有找到結果。

Example 1.11 I

N/A
N/A
Protected

Academic year: 2022

Share "Example 1.11 I"

Copied!
14
0
0

加載中.... (立即查看全文)

全文

(1)

Example 1.11 I

Fig 1.12

(2)

Example 1.11 II

s

q1

q2

r1

r2

a b

a

b b

a

b a

a b

(3)

Example 1.11 III

L(M) =?

a . . . a, b . . . b

where “. . .” can be any string of a and b First we check that any string accepted by the machine must be

a . . . a, b . . . b Second we check that any

a . . . a, b . . . b can be recognized by the machine

(4)

Example 1.11 IV

This machine handles strings with the same character in the beginning and in the end

(5)

Example 1.13 I

Figure 1.14

(6)

Example 1.13 II

q0

q1

q2 2,⟨reset

⟩ 1

0, ⟨reset⟩

0

1 2

0 2

1, ⟨reset⟩

(7)

Example 1.13 III

Σ = {⟨reset⟩, 0, 1, 2}

L(M) = . . . ⟨reset⟩ . . . ⟨reset⟩ . . .

= {sum of the last segment mod 3 = 0}

Example:

10⟨reset⟩22⟨reset⟩012

(8)

Example 1.13 IV

An example of running a string

q0 −→ q1 1 −→ q0 1 −−−→ q⟨reset⟩ 0 −→ q2 2 −→ q2 1

⟨reset⟩

−−−→ q0 −→ q0 0 −→ q1 1 −→ q2 0 Accepted

Each node stores the sum of the current segment mod 3

(9)

Formal Definition of Computation I

M accepts w = w1· · · wn if ∃ states r0· · · rn such that

1 r0 = q0

2 δ(ri, wi +1) = ri +1, i = 0, . . . , n − 1

3 rn ∈ F

Definition: a language is regular if recognized by some automata

This is a very important definition

Examples described earlier are regular languages We say some automata, so it’s possible to have several automata for the same language

(10)

Formal Definition of Computation II

As long as there is one, then the language is regular

(11)

Designing Automata I

Given a language, how do we construct a machine to recognize it?

Basically we need to get a state diagram (where the number of states is finite)

Earlier we had the opposite: a machine is given and we check the corresponding language

Example: an automaton recognizing {0, 1} strings with an odd # of 1’s

Fig 1.20

(12)

Designing Automata II

qe qo

1

0 0

1 Sample strings

01

qe −→ q0 e −→ q1 o 010101

q −→ q0 −→ q1 −→ q0 −→ q1 −→ q0 −→ q1

(13)

Designing Automata III

Two ways to think about the design

After the first 1, we go to qo. Subsequently, every 1, . . . , 1 pair is cancelled out by

qo −→ q1 e → · · · → qe −→ q1 o qe, qo respectively remember whether the number of 1’s so far is even or odd

Example 1.21

Language: strings containing 001 Fig 1.22

(14)

Designing Automata IV

q q0 q00 q001

1

0

1

0

0

1

0, 1 q0, q00 indicate that before the current input

character, we have 0 and 00, respectively

參考文獻

相關文件

Figure 10 depicts the resulting average CI, and Figure 11 shows the corresponding message overhead, where we observe: (1) With a larger peer set size, the average CI of both LLP-P

For example, if we use summation of characters of a string, which is a word or a sentence written in English, as the hash function, then two strings with same characters set always

(i) [5%] Give an example of a nondegenerate symmetric bilinear form of Witt index 1 on a two- dimensional real vector space.. (ii) [5%] Give an example of nonzero quadratic form on

An n×n square is called an m–binary latin square if each row and column of it filled with exactly m “1”s and (n–m) “0”s. We are going to study the following question: Find

Now given the volume fraction for the interface cell C i , we seek a reconstruction that mimics the sub-grid structure of the jump between 0 and 1 in the volume fraction

Abstract: I will begin with a brief recollection of the theory of spherical harmonics and explain how this example can be viewed within the framework of an

(a) At the right we sketch an example of a region  that can be described as lying between the graphs of two continuous functions of  (a type I region) but not as lying between

To get the inteval of convergence , we need to check the end points, 1