Clicker question 0 Which of the following statements is not true? A. - - PowerPoint PPT Presentation

clicker question 0
SMART_READER_LITE
LIVE PREVIEW

Clicker question 0 Which of the following statements is not true? A. - - PowerPoint PPT Presentation

Clicker question 0 Which of the following statements is not true? A. L 1 ( L 2 L 3 ) = ( L 1 L 2 ) ( L 1 L 3 ) B. ( L R ) = ( L ) R C. ( L 1 L 2 ) L 3 = ( L 1 L 3 ) ( L 2 L 3 ) D. { }


slide-1
SLIDE 1

Clicker question 0

Which of the following statements is not true?

  • A. L1 ⋅ (L2 ∪ L3) = (L1 ⋅ L2) ∪ (L1 ⋅ L3)
  • B. (LR)∗ = (L∗)R
  • C. (L1 ∪ L2)∗ ⋅ L3 = (L∗

1 ⋅ L3) ∪ (L∗ 2 ⋅ L3)

  • D. {ε}∗ = {ε} and ∅∗ ≠ ∅

for some alphabet Σ and L1,L2,L3,L4 ⊆ Σ∗

slide-2
SLIDE 2

A play of tennis

game, set, match love, 15, 30, 40, game winning also requires at least two scores more deuce, advantage-in, advantage-out

slide-3
SLIDE 3

A tennis automaton

love 15-love love-15 s

  • 30-love

15-all love-30 s s

  • 40-love

30-15 15-30 love-40 s s s

  • game-in

game-out s

  • 40-15

30-all 15-40 s s s

  • 40-30

30-40 deuce s s s s

  • s
  • adv-in

adv-out s

  • s

s

slide-4
SLIDE 4

A tennis automaton (cont.)

love 15-love love-15 s

  • 30-love

15-all love-30 s s

  • 40-love

30-15 15-30 love-40 s s s

  • game-in

game-out s

  • 40-15

30-all 15-40 s s s

  • 40-30

30-40 deuce s s s s

  • s
  • adv-in

adv-out s

  • s

s

  • single initial state
  • ne or more final states

many labeled transitions

slide-5
SLIDE 5

A tennis automaton (cont.)

love 15-love love-15 s

  • 30-love

15-all love-30 s s

  • 40-love

30-15 15-30 love-40 s s s

  • game-in

game-out s

  • 40-15

30-all 15-40 s s s

  • 40-30

30-40 deuce s s s s

  • s
  • adv-in

adv-out s

  • s

s

  • accepted strings like sososs and soossosooo
slide-6
SLIDE 6

Clicker question 1

Which string is not accepted by the tennis automaton?

love 15-love love-15 s

  • 30-love

15-all love-30 s s

  • 40-love

30-15 15-30 love-40 s s s

  • game-in

game-out s

  • 40-15

30-all 15-40 s s s

  • 40-30

30-40 deuce s s s s

  • s
  • adv-in

adv-out s

  • s

s

  • A. sossooososoo
  • B. ssssos
  • C. ooosssss
  • D. all are accepted
slide-7
SLIDE 7

Deterministic Finite Automata 2IT70 Finite Automata and Process Theory

Technische Universiteit Eindhoven April 23, 2014

slide-8
SLIDE 8

Deterministic finite automaton

DFA D = (Q, Σ, δ, q0, F) Q finite set of states Σ finite alphabet δ ∶ Q × Σ → Q transition function q0 ∈ Q initial state F ⊆ Q set of final states

2 IT70 (2014) Section 2.1 8 / 19

slide-9
SLIDE 9

The tennis example

love 15-love love-15 s

  • 30-love

15-all love-30 s s

  • 40-love

30-15 15-30 love-40 s s s

  • game-in

game-out s

  • 40-15

30-all 15-40 s s s

  • 40-30

30-40 deuce s s s s

  • s
  • adv-in

adv-out s

  • s

s

  • 2 IT70 (2014) Section 2.1

9 / 19

slide-10
SLIDE 10

An example DFA?

love 15-love love-15 s

  • 30-love

15-all love-30 s s

  • 40-love

30-15 15-30 love-40 s s s

  • game-in

game-out s

  • 40-15

30-all 15-40 s s s

  • 40-30

30-40 deuce s s s s

  • s
  • adv-in

adv-out s

  • s

s

  • set of states {love, 15–love, love–15, ... }

game-in, game-out, deuce, adv-in, adv-out } alphabet {s,o} transitions love

s

  • → 15–love, love
  • → love–15, ...

initial state love set of final states {game-in, game-out }

2 IT70 (2014) Section 2.1 10 / 19

slide-11
SLIDE 11
  • ne-step and multi-step yield

configuration (q,w) for state q and string w

  • ne-step yield

(q,w) ⊢D (q′,w′) iff ∃a∶w = aw′, δ(q,a) = q′ multi-step yield (q,w) ⊢∗

D (q′,w′)

iff ∃n ⩾ 0∃w0,... ,wn ∈ Σ∗ ∃q0,... ,qn ∈ Q ∶ (q,w) = (q0,w0), (qi−1,wi−1) ⊢D (qi,wi), for i = 1..n (qn,wn) = (q′,w′) (q,w) = (q0,w0) ⊢D (q1,w1) ⊢D ⋯ ⊢D (qn,wn) = (q′,w′) for suitable n, w0,... ,wn, q0,... ,qn

2 IT70 (2014) Section 2.1 11 / 19

slide-12
SLIDE 12

Another example DFA

q0 q1 q2 q3 b a a a,b b a b (q0,abaa) ⊢ (q1,baa) ⊢ (q0,aa) ⊢ (q1,a) ⊢ (q2,ε) (q0,bbaa) ⊢ (q0,baa) ⊢ (q0,aa) ⊢ (q1,a) ⊢ (q2,ε) (q1,aa) ⊢∗ (q2,ε) and (q1,aaaa) ⊢∗ (q2,ε) (q0,aab) ⊢∗ (q3,ε), (q0,baab) ⊢∗ (q3,ε), and (q0,baaaabaabb) ⊢∗ (q3,ε)

2 IT70 (2014) Section 2.1 12 / 19

slide-13
SLIDE 13

Language accepted by DFA

L(D) = {w ∈ Σ∗ ∣ ∃q ∈ F∶(q0,w) ⊢∗

D (q,ε)}

q0 q1 q2 q3 b a a a,b b a b

accepted language {w ∈ {a,b}∗ ∣ w has a substring aab }

2 IT70 (2014) Section 2.1 13 / 19

slide-14
SLIDE 14

Clicker question 2

Which language is the language accepted by the this automaton?

ee

  • e
  • eo

a b a b b a a b

  • A. {a,b,aba,bab}
  • B. {a(bb)n ∣ n ⩾ 0} ∪ {b(aa)n ∣ n ⩾ 0}
  • C. {w ∈ {a,b}∗ ∣ #a(w) is odd}
  • D. {w ∈ {a,b}∗ ∣ #a(w) + #b(w) is odd }

2 IT70 (2014) Section 2.1 14 / 19

slide-15
SLIDE 15

Path sets

DFA D, state q pathsetD(q) = {w ∈ Σ∗ ∣ (q0,w) ⊢∗

D (q,ε)}

even

  • dd

a a pathsetD(even) = {an ∣ n ⩾ 0, n even} pathsetD(odd) = {an ∣ n ⩾ 0, n odd}

2 IT70 (2014) Section 2.1 15 / 19

slide-16
SLIDE 16

Yet another example DFA

q0 q1 q2 1 1 0,1 L = {w ∈ {0,1}∗ ∣ w has no substring 11 } state pathset regular expressions q0 no substring 11 and no last symbol 1 0∗(10+)∗ q1 no substring 11 and last symbol 1 0∗(10+)∗1 q2 substring 11 (0 + 1)∗11(0 + 1)∗

regular expressions will be explained later

2 IT70 (2014) Section 2.1 16 / 19

slide-17
SLIDE 17

Another example DFA (rev.)

ee

  • e
  • eo

a b a b b a a b

state pathset ee {w ∣ #a(w) even, #b(w) even}

  • e

{w ∣ #a(w) odd, #b(w) even} eo {w ∣ #a(w) even, #b(w) odd}

  • {w ∣ #a(w) odd, #b(w) odd}

L(D) = pathsetD(eo) ∪ pathsetD(oe) = {w ∣ #a(w) odd, #b(w) even } ∪ {w ∣ #a(w) even, #b(w) odd} = {w ∣ #a(w) + #b(w) odd} = {w ∣ ∣w ∣ odd }

2 IT70 (2014) Section 2.1 17 / 19

slide-18
SLIDE 18

Language accepted by DFA (revisited)

q0 q1 q2 q3 b a a a,b b a b state pathset q0 {w ∣ no substring aa, not ending in a } q1 {w ∣ no substring aa, ending in a } q2 {w ∣ ending in aa } q3 {w ∣ substring aab } accepted language {w ∈ {a,b}∗ ∣ w has a substring aab }

2 IT70 (2014) Section 2.1 18 / 19

slide-19
SLIDE 19

Clicker question 3

Why does the following not represent a DFA?

q0 q1 q2 1 2 3

  • A. The alphabet has more than 2 letters.
  • B. It accepts the empty string ε.
  • C. It has a transition relation, but not a transition function.
  • D. It does represent a DFA.

2 IT70 (2014) Section 2.1 19 / 19