7regular - Introduction to Theoretical CS 7 Theory of...

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

View Full Document Right Arrow Icon
Introduction to Computer Science Sedgewick and Wayne Copyright © 2007 http://www.cs.Princeton.EDU/IntroCS 7. Theory of Computation 2 Introduction to Theoretical CS Two fundamental questions. ! What can a computer do? ! What can a computer do with limited resources? General approach. ! Don't talk about specific machines or problems. ! Consider minimal abstract machines. ! Consider general classes of problems. e.g., Pentium M running Linux kernel 2.6.15 3 Why Learn Theory? In theory … ! Deeper understanding of what is a computer and computing. ! Foundation of all modern computers. ! Pure science. ! Philosophical implications. In practice … ! Web search: theory of pattern matching. ! Sequential circuits: theory of finite state automata. ! Compilers: theory of context free grammars. ! Cryptography: theory of computational complexity. ! Data compression: theory of information. In theory there is no difference between theory and practice. In practice there is. - Yogi Berra Introduction to Computer Science Sedgewick and Wayne Copyright © 2007 http://www.cs.Princeton.EDU/IntroCS Regular Expressions and DFAs
Image of page 1

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

View Full Document Right Arrow Icon
5 Pattern Matching Applications Test if a string matches some pattern. ! Process natural language. ! Scan for virus signatures. ! Search for information using Google. ! Access information in digital libraries. ! Retrieve information from Lexis/Nexis. ! Search-and-replace in a word processors. ! Filter text (spam, NetNanny, ads, Carnivore, malware). ! Validate data-entry fields (dates, email, URL, credit card). ! Search for markers in human genome using PROSITE patterns. Parse text files. ! Compile a Java program. ! Crawl and index the Web. ! Read in data stored in TOY input file format. ! Automatically create Java documentation from Javadoc comments. 6 Pattern Matching in Google Google. Supports * for full word wildcard and | for union. 7 Pattern Matching in TiVo TiVo. WishList has very limited pattern matching. Reference: page 76, Hughes DirectTV TiVo manual 8 Describing a Pattern PROSITE. Huge database of protein families and domains. Q. How to describe a protein motif? Ex. [signature of the C2H2-type zinc finger domain] ! C ! Between 2 and 4 amino acids. ! C ! 3 more amino acids. ! One of the following amino acids: LIVMFYWCX . ! 8 more amino acids. ! H ! Between 3 and 5 more amino acids. ! H C AAS C GGP Y ACGGWAGY H AGW H
Image of page 2
9 Regular Expressions: Basic Operations Regular expression. Notation to specify a set of strings. every other string aabaab aabaab Concatenation every other string aaaab abaab a(a|b)aab Parentheses (ab)*a ab*a aa | baab .u.u.u. Regular Expression aa abbba a ababababa ab ababa aa abbba Closure Union Wildcard Operation every other string aa baab succubus tumultuous cumulus jugulum No Yes 10 Regular Expressions: Examples Regular expression. Notation is surprisingly expressive. b bb baabbbaa bbb aaa bbbaababbaa a* | (a*ba*ba*ba*)* multiple of three b s 111111111 403982772 1000234 98701234 .*0 ....
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