• No results found

6: lX lY 5: 4: 3: 2: 1:

N/A
N/A
Protected

Academic year: 2021

Share "6: lX lY 5: 4: 3: 2: 1:"

Copied!
1
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

LIACS

Leiden University

Examination Fundamentele Informatica

2

16 March 2018, l4:00

-

17:00

Question

1:

[2 points]

a)

Give a regular expression

fbr

the language consisting

of all

strings over the alphabet

{

a,

b,

c}

that contain exactly two b's and ending with one c.

b)

Give a regular expression

for

the language consisting

of all

strings over the alphabet

{

a, b, c}

that do notbegin with bb.

c)

Give a deterministic

finite

automaton

M

accepting the language consisting

of all

strings over the alphabet

{

a, b,

c}

that contain exactly two b's and at most one c.

Question

2:

[2 points]

Consider the following non-deterministic fìnite automaton

M

over the alphabet

{

a,b }:

a)

Give a non-deterministic finite automaton N without r\-transitions such that

L(N)

=

L(M).

b)

Give a regular grammar G such that L(G) =

L(M).

c)

Construct a de.temúnisfic

finite

automaton accepting the same language.

d)

Use c'rne of the method taught in class to find a regular expression r such that

L(r)

=

L(M).

Question

3:

[1'5 points]

Give counterexamples showing that the

lbllowing

statements on languages over the alphabet

{

a,b }

are wrong:

a)

Any subset of a regular language is regular.

b)

The infinite union of regular languages is regular.

c) If Lr

and Lz arc different regular languages and

is not regular then

LtLzLt

is regular.

Question

4:

[1

point]

Give agrammarGsuch

thatL(G) = {

anbanb'akln, m,k >

0

andm <

k

}.

Question

5:

[1.5 points]

Consider a context-free grammar G with starting symbol S and productions:

S

-+

aSa

lX X+

aYa

lY Y-+

bYb I a

a)

Show that G is ambiguous.

b)

Give another grammar in Chomsky normal form generating the same language of G.

Question

6:

[2 points]

a)

Draw a pushdown automaton accepting by empty stack

with

one single stack symbols

{X}

(that

is thus also the

initial

stack symbol) which recognizes the language consisting

of all

strings over the alphabet

{

a, b,

c}

with c appearing only as the fìrst, the last and the middle symbol.

b)

Use the pumping lemma to show that L cannol be a regular language.

a

b

The final score is given by the sum of the points obtained.

Referenties

GERELATEERDE DOCUMENTEN

Maar schepen konden niet snel genoeg naar de Noordzee?. Daarom groef men

In één van deze landen is nu heel veel toerisme.. Dat komt door de lange,

Aan het einde van de lessen bespelen de kinderen de basis van een instrument of instrumenten, hebben ze een liedje met eigen stijl en kunnen ze het uitvoeren.. Omschrijving

BURGER ONION CHICKENBURGER - OM JE VINGERS VAN AF

Uit een online onderzoek van AXA Bank naar de huidige en toekomstige leefsituatie van de Belg, blijkt het bezitten van een woning gelukkiger te maken (88%) dan er één te huren

bestek nr:.

bestek nr:.

1 Wees je ervan bewust dat alles wat je online zet, voor altijd terug te vinden is.. Denk dus na voor je