Presentation is loading. Please wait.

Presentation is loading. Please wait.

Transparency No. 1 Formal Language and Automata Theory Homework 1.

Similar presentations


Presentation on theme: "Transparency No. 1 Formal Language and Automata Theory Homework 1."— Presentation transcript:

1 Transparency No. 1 Formal Language and Automata Theory Homework 1

2 Deterministic Finite Automata Transparency No. 2 Problems 1.1 Let A = {0.11} and B = {00.11}. Find each of theses sets (a) AB, (b) BA(c)A 2 (d) B 3. 1.2 Find all pairs of languages A and B for which AB = {10,111,1010,1000,10111,101000}. 1.3 Determine whether the string 11101 is in each of these languages : (a) {0,1}*(b) {1}* {0}* {1}*(c) {11}{0}*{01} (d) {11}* {01}*(e) {111}*{0}*{1} (f) {11,0} {00,101}

3 Deterministic Finite Automata Transparency No. 3 [Preliminary definitions] A string x over a set (or alphabet)  of symbols is a finite sequence : x 1 x 2 … x n with n  0 and x i   for all 1  i  n, or alternatively, a function x : [n]  , where [n] = def {0,1,…,n}, with x(i) = x i for all 1  i  n. For a string x :[n]  , n is called the length of x and is denoted |x|. The minimum value of string length is 0 and there is exactly one string, denoted , with zero length (|  | = 0). If a  is a symbol, and y is a string y 1,…,y m, we use ay to denote the string: a y 1,…,y m., and ya to denote the string y 1,…,y m,a. More generally, if x = x 1 x 2 … x n and y = y 1,…,y m, then we use xy to denote the string: x 1 x 2 … x n, y 1,…,y m. Now the set  * = def {x 1 x 2 … x n | n  0 and x i   for all 1  i  n } of all strings over  can be defined to be the least subset of sequences satisfying the rules : Basis :  is a member of  *, closure: for each a  and member y of  *, ay is member of  *.

4 Deterministic Finite Automata Transparency No. 4 2. According to the inductive definition of  *, give a recursive definition for each of the following functions over strings. 2.1 len :  *  N such that len(x) = |x|. (ex: len(aba) = 3 ). 2.2 concat :  * x  *   * such that concat(x,y) = x y. 2.3 reverse :  *   * such that reverse(x 1 x 2 … x n ) = x 1n x n-1 … x 1. 3. According to your definition given at problem 2, Show that the following equations hold using structural induciton. 3.1 for all x, y, len(concat(x,y)) = len(x) + len(y). 3.2 for all x, y, len(reverse(x)) = len(x) 3.3 for all x, y, reverse(reverse(x)) = x, 3.4 for all x,y, reverse(concat(x,y)) = concat(reverse(y), reverse(x))

5 Deterministic Finite Automata Transparency No. 5 Note that if  is an alphabet and A     is a language (string set) over , then : A* = def {x 1 x 2 …x n | n  0 and all x i  A } = {  } U A U A 2 U A 3 U … A + = def {x 1 x 2 …x n | n > 0 and all x i  A } = A U A 2 U A 3 U … 4. Show that the following equalities holds for all languages A,B,C: 4.1. A (B  C) = AB  AC. 4.2 A*A* = A* 4.3. A** = A* 4.4. AA* = A*A.

6 Deterministic Finite Automata Transparency No. 6 5. Let B be any set of strings over an alphabet . We say B is transitive if BB  B. Prove that for any set of strings A, A + is the smallest transitive set containing A. That is, show that 5.1. A + is a transitive set containing A, and 5.2. if B is another transitive set containing A, then A*  B. 6. Show that if (S,  ) is a well-founded poset, then 6.1 (S 2,  2 ) is well-founded, but 6.2 (S*,  * ) is not well-founded provided there are a, b in S such that a < b. Here  2 and  * are the lexicographical order induced by , Namelylexicographical order (1) (x1,x2)  2 (y1,y2) iff (x1 < y1) or (x1=y1 and x2  y2)), and (2) (x1,x2,…,xm)  * (y1,y2,…,yn) iff (x1 < y1) or (x1=y1 and x2<y2) or (x1=y1,x2=y2, x3 < y3) or … iff (m  n and (y1,y2,…,ym) = (x1,x2,…,xm) ) or there is k  m such that x k < y k and x t =y t for all t < k.


Download ppt "Transparency No. 1 Formal Language and Automata Theory Homework 1."

Similar presentations


Ads by Google