1. Trang chủ
  2. » Công Nghệ Thông Tin

DM2 automata BK TPHCM

3 305 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 3
Dung lượng 120,14 KB

Nội dung

Exercise for chapter 4 (Part 2) Determinisation 1 Introduction In this exercise, we will pratice mainly on automata determinisation from NFA (nondeterministic finite automata) to DFA (deterministic finite automata). Students should review the slide and related documents for chapter 4 before doing the exercises below.

Hồ Chí Minh City University of Technology Faculty of Computer Science and Engineering Exercise for chapter (Part 2) Determinisation Introduction In this exercise, we will pratice mainly on automata determinisation - from NFA (nondeterministic finite automata) to DFA (deterministic finite automata) Students should review the slide and related documents for chapter before doing the exercises below Example Question Give an execution of the following DFA on 0001, 01001, and 0110 0 1 A B C Solution • (A, 0001) → (A, 001) → (A, 01) → (A, 1) → (B, −) ⇒ 0001 is a valid word • (A, 01001) → (A, 1001) → (B, 001) → (C, 01) → (C, 1) → (B, −) Then, 01001 is a valid word • (A, 0110) → (A, 110) → (B, 10) → (A, 0) → (A, −) Since A is not an accepting state, then 0110 is an invalid word ✷ Question Convert the following NFA into DFA Give an execution of the DFA on aaba, bbabbbaa, bababaa and bbabbbabbbabba a, b a, b A a B b C Solution First, we need define transition table containing useful sets of states as follows → {A} {A, B} {C}∗ a {A, B} − {C} b {A} {C} {C} DFA could be determined in which each state refers a useful sets of NFA state Discrete Mathematics II Page 1/3 Hồ Chí Minh City University of Technology Faculty of Computer Science and Engineering a, b b {A} a {A, B} b {C} ✷ Exercise Question Convert the following NFA into DFA b b a, b A a B b a C b D Question Convert the following NFA into DFA a, b C a b a A b, ε B b b b D b Question Find a regular expression for the set {an bm : (n + m) is even } Determine the corresponding DFA (or NFA and then convert NFA to DFA) Question Give a regular expression for the language on Σ = {a, b, c} containing no run of a’s of length greater than two Determine the corresponding DFA (or NFA and then convert NFA to DFA) Discrete Mathematics II Page 2/3 Hồ Chí Minh City University of Technology Faculty of Computer Science and Engineering Question Give a regular expression for the language on Σ = {a, b} containing all strings not ending in ab Determine the corresponding DFA (or NFA and then convert NFA to DFA) Question Give a DFA that accepts L = ((a + b)∗ b(a + ab)∗ ) Question Let Σ = {a, b, c} Give complet DFA’s for the sets consisting of a) all strings with exactly one ’a’ b) all strings of even length c) all strings which the number of appearances of ’b’ is divisible by d) all strings ending with ’a’ e) all strings not ending with ’a’ f) all non-empty strings not ending with ’a’ g) all strings with at least one ’a’ h) all strings with at most one ’a’ i) all strings without any ’a’ j) all strings including at least one a and whose the first appearance of ’a’ is not followed by a ’c’ Discrete Mathematics II Page 3/3

Ngày đăng: 14/07/2016, 22:36

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN