{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

FA - Harvard CS 121 and CSCI E-207 Lecture 4 Languages and...

Info icon This preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Harvard CS 121 and CSCI E-207 Lecture 4: Languages and Finite Automata Harry Lewis September 15, 2009 Reading: Sipser, § 1.1 and § 1.2.
Image of page 1

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

View Full Document Right Arrow Icon
Harvard CS 121 & CSCI E-207 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
Image of page 2
Harvard CS 121 & CSCI E-207 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 ∈ { 0 , 1 } * such that x is the binary representation of a prime number. All ‘C’ programs that do not go into an infinite loop. 2
Image of page 3

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

View Full Document Right Arrow Icon
Harvard CS 121 & CSCI E-207 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
Image of page 4
Harvard CS 121 & CSCI E-207 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
Image of page 5

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

View Full Document Right Arrow Icon
Harvard CS 121 & CSCI E-207 September 15, 2009 Deterministic Finite Automata (DFAs) Example: Home Stereo P = power button (ON/OFF) S = source button (CD/Radio/TV), only works when stereo is ON, but source remembered when stereo is OFF.
Image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern