CISC/CMPE 223 - Assignment 1 (Winter 2023) Due: Thursday January 26, 2:00 PM Regulations on assignments · The assignments are graded according to the correctness, preciseness and legibility of the solutions. All handwritten parts, including figures, should be clear and legible. This assignment is marked out of 20 possible marks. . Please submit your solution in onQ before the due time. The submission must be in one of formats: . PDF, .JPG, .PNG, .DOCX. · The assignment must be based on individual work. Copying solutions from other students is a violation of academic integrity. See the course onQ site for more information. 1. (2 marks) Let ? = {0, 1} and consider languages A = {01, 00, 1}, B = {10, 11, 0}. (a) Write down all strings in the set A . B. How many strings there are in A · B? (b) Write down all strings in the set B . A. How many string there are in B . A? 2. (3 marks) In this question the alphabet is 2 = {a, b}. Let R = (ba + bab)*a* and S = a*b(a*ba*b)*a *. (a) Give two examples of a string z that is both in R and in S (that is, z E Rn S). (b) Give two examples of a string x that is in R and is not in S (that is, x E RnS where S is the complement of S). (c) Give two examples of a string y that is in S and is not in R (that is, y E Rn S). In each case briefly explain (using natural language) why your example strings have the required property. 3. (5 marks) Show how to define the following languages over > = {0, 1} using only E, the alphabet symbols 0 and 1, and the operations of union, concatenation, and closure. Note: Your answer cannot use the intersection or complementation operation. Below "or" always means "inclusive or". (a) All strings that have both 000 and 111 as a substring.
(b) All strings that have 0000 or 1111 as a substring. (c) All strings that do not have 111 as a substring. (d) All strings of odd length that have 0000 as a substring. (e) All strings w satisfying condition (i) or condition (ii): (i) w has at most three occurrences of 0; (ii) w has at most three occurrences of 1. 4. (2 marks) Let 2 = {a, b} and consider the state-transition diagram given in Figure 1. a b A a B b a C b Figure 1: State-transition diagram for Question 4. (a) Give examples of three strings that are accepted by the state diagram and examples of three strings that are not accepted by the state diagram. (b) Write out explicitly the transition table (or transition function) that defines the state transitions of the diagram. 5. (3 marks) Let 2 = {a, b, c, d} and consider the nondeterministic state diagram with E- transitions given in Figure 2. Using