CISC 223 - Assignment 1 (Winter 2024) Due: Thursday January 25, 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. · Important: Assignments are evaluated based only on the files you submit in onQ. Please be careful that you submit the correct files and please verify your submission. Any additional material sent retroactively by email cannot be considered. · 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 2 = {a, b} and consider languages A = {ab, aa, b}, B = {ba, bb, a}. (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 ? = {0,1}. Let R = (01 + 001)*0* and S = (0*10*1)*O *. (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 11011 as a prefix or have 000 as a suffix. (b) All strings that have prefix 101 and have suffix 101. Note that the prefix and suffix may overlap. (c) All strings of even length that have at least one occurrence of the symbol 0. (d) All strings that have both 01 and 10 as substrings. Note that the substrings can occur in either order and possibly overlap. (e) All strings that do not have 000 as a substring. 4. (3 marks) Let 2 = {0, 1} and consider the state-transition diagram given in Figure 1. 0 A 0 1 1 0 C B 1 1 D 0 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