Hmk5 - w ∈ A where A is an alphabet The reversal of w denoted w R is defined recursively based on | w | 1 If | w | = 0 i.e if w = (the empty

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
COT 3100 Homework # 5 Spring 2000 Assigned: 4/6/00 Due: 4/20,21 in recitation 1) Give regular expressions for each of the following languages: (Note: each language is over the alphabet L = {a,b} a) The language of all strings containing at least one a and one b. b) The language of all strings of length 2. c) The language of all strings with exactly 4 a’s. d) The set of all strings where contiguous letters are ALWAYS different. 2) Create a DFA to recognize the following languages over the alphabet L = {a,b}. a) The language of all strings of even length. b) The language of all strings that contain exactly 3n a’s where n is an integer. c) The language of all strings that have the same number of substrings ab as substring ba. (So, for example, abaaabbba would be in this language since there are 2 occurences of ab and 2 occurences of ba.) 3) Consider the following recursive definition of string reversal: Let
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: w ∈ A * where A is an alphabet. The reversal of w , denoted w R , is defined recursively based on | w |: 1. If | w | = 0, i.e., if w = λ (the empty string), then w R = λ R = λ ; 2. If | w | > 0, let w = ua where u ∈ A * and a ∈ A (i.e., a is the last symbol and u is the prefix), then define w R = ( ua ) R = au R . Based on this recursive definition, prove that for any two strings x , y ∈ A *, ( xy ) R = y R x R . (Hint: Use induction on | y | ≥ 0.) 4) Let T, W, and X be sets of strings over the alphabet L = {a,b}. Prove or disprove the following statement: if (T ∩ W)* = (T ∩ X)* then W = X. 5) Let T and W be sets of strings over the alphabet L = {a,b}. Prove or disprove the following statement: if T ⊆ W, then (WT)* ⊆ W*...
View Full Document

This document was uploaded on 07/14/2011.

Ask a homework question - tutors are online