Kanan Sasaki
38399655
Professor Goodrich
13 January 2017
CS 162 Homework #1
.10
1.
2.
3.
4.
5.
6.
7.
a=b
a * a = b * a = a2 = ab
a2 b2 = ab b2
(a + b) (a -b) = b (a b)
(a + b) (a b) / (a b) = b (a b)
CS 162
Fall 2015
Homework 4 Problems
October 21, 2015
Timothy Johnson
1. Let L = cfw_0n 12n |n > 0 Give a CFG for L.
The following CFG will produce L.
S 0S11 | 011 |
2. Show that every regular languag
CS 162
Fall 2015
Homework 3 Problems
October 13, 2015
Timothy Johnson
1. Let L be the language of all string of balanced parentheses, that is, all strings of the characters
( and ) such that each ( ha
CS 162
Fall 2015
Midterm 1 Study Questions - Solutions
October 14, 2015
Timothy Johnson
1. Give a DFA for the following languages over the alphabet cfw_0, 1.
(a) cfw_w|w has at least three 0s and an o
CS 162
Fall 2015
Homework 1 Problems
September 30, 2015
Timothy Johnson
1. Exercise 2.2.4 on page 53 of Hopcroft et al.
Give DFAs accepting the following languages over the alphabet cfw_0, 1.
(a) The
Homework 1
0.10 Find the error in the following proof that 2 = 1. Consider the equation a = b. Multiply both
sides by a to obtain a^2 = ab. Subtract b^2 from both sides to get a^2b^2 = abb^2. Now fact
2.18
a. Let C be a context-free language and R be a regular language. Prove that the language C
R is context free.
b. Let A = cfw_w|w cfw_a, b, c and w contains equal numbers of as, bs, and cs. Use p
Homework 2
1.7 Give state diagrams of NFAs with the specified number of states recognizing each
of the following languages. In all parts, the alphabet is cfw_0,1.
b. The language of Exercise 1.6c with
Homework 5
1. For n=1, 2n-1 = 2(1) - 1 = 1
For n=k, 2n-1 = 2k-1
For n=k+1, since n>1, a language in CNF would be S->BC, B->*a, C->*a
So the length of the string with starting symbol S is |w|=ab where
Kanan Sasaki
38399655
Professor Goodrich
10 January 2017
Homework #4
1. Terminals cfw_0, 1
Variables = cfw_S
Start Symbol = cfw_S
Productions =
S -> 011
S -> 0S11
2. Base case: A single character x, w
Kanan Sasaki
38399655
Professor Goodrich
27 January 2017
Homework #3
Use this for questions 1 and 2
By the Pumping Lemma, the language L must satisfy the following conditions:
|xy| <= n
|y| > 0
Xyiz L
Kanan Sasaki
38399655
Professor Goodrich
20 January 2017
Homework #2
1.7b
1.7c
1.7e
1.7h
1.14a
The reason that the complement of the original M recognizes the complement B is that both M and the
compl