lect_02 - : Lecture 2: Strings, Languages, DFA s 24 January...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: : Lecture 2: Strings, Languages, DFA s 24 January 2010 This lecture covers material on strings and languages from Sipser chapter 0. Also, this lecture covers an account of countable and uncountable sets, and shows that C-programs cannot decide all languages. 1 Alphabets, strings, and languages 1.1 Alphabets An alphabet is any nite set of characters. Here are some examples for such alphabets: (i) { , 1 } . (ii) { a , b , c } . (iii) { , 1 , # } . (iv) { a ,... z , A ,... Z } : all the letters in the English language. (v) ASCII - this is the standard encoding schemes used by computers mappings bytes (i.e., integers in the range .. 255 ) to characters. As such, a is 65 , and the space character is 32 . (vi) { moveforward , moveback , rotate90 , reset } . 1.2 Strings This section should be recapping stu already seen in discussion section 1. A string over an alphabet is a nite sequence of characters from . Some sample strings with alphabet (say) = { a , b , c } are abc , baba , and aaaabbbbccc . The length of a string x is the number of characters in x , and it is denoted by | x | . Thus, the length of the string w = abcdef is | w | = 6 . The empty string is denoted by , and it (of course) has length . The empty string is the string containing zero characters in it. The concatenation of two strings x and w is denoted by xw , and it is the string formed by the string x followed by the string w . As a concrete example, consider x = cat , w = nip and the concatenated strings xw = catnip and wx = nipcat . Naturally, concatenating with the empty string results in no change in the string. For- mally, for any string x , we have that x = x . As such = . 1 For a string w , the string x is a substring of w if the string x appears contiguously in w . As such, for w = abcdef we have that bcd is a substring of w, but ace is not a substring of w. A string x is a su x of w if its a substring of w appearing in the end of w . Similarly, y is a pre x of w if y is a substring of w appearing in the beginning of w . As such, for w = abcdef we have that abc is a pre x of w, and def is a su x of w. Here is a formal de nition of pre x and substring. De nition 1.1 The string x is a pre x of a string w , if there exists a string z , such that w = xz . Similarly, x is a substring of w if there exist strings y and z such that w = yxz . 1.3 Languages A language is a set of strings. One special language is * , which is the set of all possible strings generated over the alphabet * . For example, if = { a , b , c } then * = { , a , b , c , aa , ab , ac , ba ,..., aaaaaabbbaababa ,... } . Namely, * is the full language made of characters of . Naturally, any language over is going to be a subset of * ....
View Full Document

Page1 / 6

lect_02 - : Lecture 2: Strings, Languages, DFA s 24 January...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online