CSE 105 THEORY OF COMPUTATION Fall 2016 - - PowerPoint PPT Presentation

cse 105
SMART_READER_LITE
LIVE PREVIEW

CSE 105 THEORY OF COMPUTATION Fall 2016 - - PowerPoint PPT Presentation

CSE 105 THEORY OF COMPUTATION Fall 2016 http://cseweb.ucsd.edu/classes/fa16/cse105-abc/ T oday's learning goals Sipser Ch 1.1 Design fjnite automata which accept a given language General Properties of Regular Languages Operations on


slide-1
SLIDE 1

CSE 105

THEORY OF COMPUTATION

Fall 2016 http://cseweb.ucsd.edu/classes/fa16/cse105-abc/

slide-2
SLIDE 2

T

  • day's learning goals Sipser Ch 1.1
  • Design fjnite automata which accept a given

language

  • General Properties of Regular Languages
  • Operations on languages
  • Closure properties
slide-3
SLIDE 3
  • Alphabet: nonempty fjnite set of symbols
  • String over an alphabet: fjnite sequence of symbols
  • Language over an alphabet: some set of strings
  • DFA over an alphabet: deterministic fjnite automaton
  • Input: fjnite string over a fjxed alphabet
  • Output: "accept" or "reject"
  • L(M) = {w | M accepts w}
  • Regular language

language that is L(M) for some DFA M

Recall terminology

Start state (triangle/arrow) Accept state (double circle)

slide-4
SLIDE 4

Building DFA

Typical questions e.g. HW2 Q1c, Q2 Defjne a DFA which recognizes the given language L.

  • r

Prove that the (given) language L is regular.

slide-5
SLIDE 5

Building DFA

Example Defjne a DFA which recognizes { w | w has at least 2 a’s }

slide-6
SLIDE 6

Building DFA

Example Defjne a DFA which recognizes { w | w has at most 2 a’s }

slide-7
SLIDE 7

Building DFA

Remember States are our only (computer) memory. Design ans pick states with specifjc roles / tasks in mind. “Have not see any of desired pattern yet” “Trap state”

slide-8
SLIDE 8

Regular languages: general facts

Is there an infjnite regular language?

  • A. No: all regular languages have to be fjnite.
  • B. Yes: all regular sets are infjnite.
  • C. Yes: all infjnite sets of strings over an alphabet are

regular.

  • D. Yes: some infjnite sets of strings over each

alphabet are regular and some are not.

  • E. I don't know.
slide-9
SLIDE 9

Regular languages: general facts

Is every fjnite language regular?

  • A. No: some fjnite languages are regular, and some

are not.

  • B. No: there are no fjnite regular languages.
  • C. Yes: every fjnite language is regular.
  • D. I don't know.
slide-10
SLIDE 10

Regular languages: general facts

T rue/ False: each DFA recognizes a unique language. I.e. if two DFA are difgerent (difgerent number of states

  • r difgerent initial state, or difgerent transition function,

etc.) then they recognize difgerent languages.

  • A. T

rue can you prove it?

  • B. False can you prove it?
  • C. I don't know.
slide-11
SLIDE 11

The regular operations

Sipser Def 1.23 p. 44

For A, B languages over same alphabet, defjne:

These are operations on sets of strings! These are operations on sets of strings!

slide-12
SLIDE 12

Closure of … under …

  • Z under addition.
  • Set of even ints under multiplication.
  • {0}* under concatenation.

Which of these is true?

  • A. The set of odd integers is closed under addition.
  • B. The set of positive integers is closed under

subtraction.

  • C. The set of rational numbers is closed under

multiplication.

  • D. The set of real numbers is closed under division.
  • E. I don't know.
slide-13
SLIDE 13

Complementation

Claim: If A is a regular language, then so is its complement A Same as: If A=L(M) for some DFA M, then A=L(M’) for some (possibly difgerent) DFA M’ Proof Strategy: Show that any DFA M can be transformed into a DFA M’ such that L(M’) = L(M)

slide-14
SLIDE 14

For next time

Homework 1 due tonight!

  • Set up course tools: Gradescope, Piazza, JFLAP, ieng6

Next Time: Class of regular languages is closed under complement, union, intersection, and several other

  • perations.

It is also closed under concatenation and Kleene star, but harder to prove (next week.)