1 / 4

Figure 1. A directed graph with 9 nodes and a path of length 9.

Homework #1 (Models of Computation, Spring, 2001) Due: Section 1: January 25 (Thursday) Section 2: January 26 (Friday). 1 . Show the result of each of the following set operations in terms of set property. Write your sets as simple as possible.

zizi
Download Presentation

Figure 1. A directed graph with 9 nodes and a path of length 9.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Homework #1 (Models of Computation, Spring, 2001)Due: Section 1: January 25 (Thursday) Section 2: January 26 (Friday) 1.Show the result of each of the following set operations in terms of set property. Write your sets as simple as possible. (a) L0 L4 (b) L0 L1 (c) L3  L5 (d) (L2 - L1)  L4 (e) L0L5 ,where L0 = {aibjck | i, j, k > 0, j  k }, L1 = { aibjck | i, j, k  0, i  j }, L2 = {a, b, c}*, L3 = {x | x  {a, b, c}* and x = xR}, L4 = { aibjck | i,j,k  0 }, L5 = {aibjak | i,j,k  0 } 2. We proved that the Sperner’s lemma is true, i.e., the number of good label blocks is always odd. Define a bad label block as a block which is not a good label block (i.e., either 1-1 or 2-2). Can we claim similar lemma for the number of bad label blocks? In other words, is the number of bad label blocks always odd, always even, or can be both? Justify your answer.

  2. 2 3 1 8 7 6 6 9 4 5 3.Let G be a directed graph (see an example below) of n nodes (vertices). Using the pigeonhole principle, we could simply proved that every path of length greater than or equal to n has a cycle. In this homework we will prove the same problem using the proof by induction technique. (Please review the proof by induction technique and the application examples.) (a) What is the base case? Prove that the statement is true for the base case. (b) Write the induction hypothesis. (c) Complete the induction step using the information provided on the following page. Figure 1. A directed graph with 9 nodes and a path of length 9.

  3. For a graph G which has n nodes, the following figures (a) – (d) illustrates four typical cases depending on how the path oflength n goes through the nodes. • How can we apply the induction hypothesis for cases (a) through (c), and say that there should be a cycle? • What can we say for case (d)? (c) (d) (b) (a) Fig. (a) – (c) There is a node that the path does not go through. (d) The path goes through every node.

  4. 4.What is the language generated by each of the following grammars, where S is the start symbol, the capital letters are nonterminal symbols and the lower case letters are terminal symbols. Show the languages in terms of a set using properties. Try to express the set as simple as possible. (a) S  aS | bS |  (b) S  aA | bB A  Sa |a B  Sb | b (c) S  aSb | A A  aA | a (d) S DF F  bAFc | bEc bA  Ab bE  Eb DA  aaD DE  aa 5. Construct regular (i.e., type 3) grammar for each of the following languages. (a) L1 = {ab, abb, abbb} (b) L2 = { x | x {0, 1}+} (c) L3 = { x | x is an integer, possibly with leading zeros } 6. Construct context-free (type 2) grammar for each of the following languages. (a) L4 = {aibj | i > j > 0} (b) L5 = {aibj | j > i > 0} (c ) L6 = {aibj | i, j > 0 and i  j} (d) L7 = {xxR | x  {a, b, c}*} 7. Construct any grammar for each of the following languages. You should briefly describe how your grammar generates the language. (Hint: Examine how the grammar in problem 3-(d) above and the example for type 1 grammar in your handout generates the language.) (a) L8 = {a2nb2nc2n | n  1 } (b) L9 = {anbncndn | n  1 }

More Related