This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Harvard CS 121 and CSCI E207 Lecture 4: Languages and Finite Automata Harry Lewis September 15, 2009 Reading: Sipser, § 1.1 and § 1.2. Harvard CS 121 & CSCI E207 September 15, 2009 Languages • A language L over alphabet Σ is a set of strings over Σ (i.e. L ⊆ Σ * ) Computational problem: given x ∈ Σ * , is x ∈ L ? Any YES/NO problem can be cast as a language. 1 Harvard CS 121 & CSCI E207 September 15, 2009 Examples of languages • All words in the American Heritage Dictionary • ∅ • Σ * • Σ • { x ∈ Σ * :  x  = 3 } = { aaa,aab,aba,abb,baa,bab,bba,bbb } • The set of strings x ∈ { a,b } * such that x has more a ’s than b ’s. • The set of strings x ∈ { , 1 } * such that x is the binary representation of a prime number. • All ‘C’ programs that do not go into an infinite loop. 2 Harvard CS 121 & CSCI E207 September 15, 2009 The highly abstract and metaphorical term “language” • A language can be either finite or infinite • A language need not have any “internal structure” 3 Harvard CS 121 & CSCI E207 September 15, 2009 Be careful to distinguish ε The empty string (a string) ∅ The empty set (a set, possibly a language) { ε } The set containing one element, which is the empty string (a language) {∅} The set containing one element, which is the empty set (a set of sets, maybe a set of languages) 4 Harvard CS 121 & CSCI E207 September 15, 2009 Deterministic Finite Automata (DFAs) Example: Home Stereo • P = power button (ON/OFF)...
View
Full
Document
This document was uploaded on 12/24/2011.
 Fall '09

Click to edit the document details