03 - Lecture 3 Languages and Regular Expressions Basic...

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

View Full Document Right Arrow Icon
Lecture 3: Languages and Regular Expressions Basic concepts Alphabet — a finite set of symbols, Σ. word (or string ) — a finite sequence of symbols from an alphabet. Alphabet Words { a, b, . . . , z } man, abc, . . . { 0, 1 } 000, 010101, . . . { #, $, a, b, c } #cb$, $$$, . . . • | w | length of a word w , i.e. the number of symbols in w . e — the empty word containing no symbols, i.e. the word of zero length. To avoid confusion, e should not be in any alphabet. 1
Image of page 1

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

View Full Document Right Arrow Icon
Languages A language is a set of words defined over an alphabet Σ. Examples: 1. Set of all English words — a language over { a, b, . . . , z } . 2. { 01, 0101, 010101, . . . } — a language over { 0 , 1 } . 3. { e } — a language over any alphabet. • ∅ — the empty language , i.e. the language contain- ing has no words. Σ — the set of all words over the alphabet Σ. It is called the universal language. Any language L is a subset of Σ . Note: = { e } . 2
Image of page 2
Operations on words Concatenation merges two given words to form a new word: e.g. abc 123 = abc 123 Properties: ew = we = w ( uv ) w = u ( vw ) Reversal reverses the order of all the symbols in a given w . w = a 1 · · · a n w R = a n · · · a 1 Inductive definition: (1) e R = e (2) ( au ) R = u R a , where a Σ , u Σ Power concatenates n copis of w to form a new word w n = n ww · · · w Inductive definition: (1) w 0 = e (2) w i
Image of page 3

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

View Full Document Right Arrow Icon
Image of page 4
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