1 / 12

Strings and Languages

Strings and Languages. Jim Skon Mount Vernon Nazarene College. Sequences and Strings. alphabet - a set of symbols , denoted by  string (or word) - a finite sequence of elements from  example:  = {a, b} possible strings include: a aa ab ba abaa bbb aaaa

cardea
Download Presentation

Strings and Languages

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Strings and Languages Jim Skon Mount Vernon Nazarene College Sets - Elementary Discrete Math

  2. Sequences and Strings • alphabet - a set of symbols, denoted by  • string (or word) - a finite sequence of elements from  • example: •  = {a, b} • possible strings include: • a aa ab ba abaa bbb aaaa • bbaa abab abbbababbbabbababa • "abba" is a string over • empty word -  (lambda) • * is set of all words over  • - * = {x | x is a word over } • - always includes  • - * is always infinite if  has elements • other interesting alphabets • -  = {0, 1} (binary words) • -  = {1} • -  = {a,b,c,d, . . ., z} • word length • - number of symbols in word (or string) Sets - Elementary Discrete Math

  3. n where n is an integer • - set of all strings of length n • - let ={0, 1}, find: • 1 • 2 • 3 • 0 • - let  = {a, b, c} • For any n it must be true that n*. • - 1* • - 5* • - 65* Sets - Elementary Discrete Math

  4. n where n is an integer • - set of all strings over  with length at most n • - let  = {0, 1}, find: • 1 • 2 • 0 • For any n it must be true that n*. • - 1* • - 4* • - 77* • For a given alphabet , what is the relationship • between n and n? (First think about 2 and 2) Sets - Elementary Discrete Math

  5. Any subset of * is called a language over . • ex: let  = {0,1} • L1 = {x | 2  length(x)  4 and x * } Sets - Elementary Discrete Math

  6. L2 = {x | same number of 0s as 1s and x * } Sets - Elementary Discrete Math

  7. L3 = {x | no leading zeros and x * } Sets - Elementary Discrete Math

  8. n and nare languages over. Sets - Elementary Discrete Math

  9. SET OPERATORS • Sets with no common elements are called disjoint • - If A  B = Ø, then A and B are disjoint. • - ex: n and m are disjoint if n m. • Are n and n disjoint? • What about n and n+1? Sets - Elementary Discrete Math

  10. SET OPERATORS • If A1, A2, . . . An are sets, and no two have a common element, then we say they are mutually disjoint. • Ai  Aj = Ø for all i,j  n and i  j • ex: 0, 1, 2, 3 ,... are all mutually disjoint • 0, 1, 2, 3 ,... are these mutually disjoint? Sets - Elementary Discrete Math

  11. Sets - Elementary Discrete Math

  12. Sets - Elementary Discrete Math

More Related