1

  1. Give all computations and determine whether it is accepted.
    • is accepted.
      title: Correct answer.
    • is rejected
      title: Correct answer.
    • is rejected
      title: Correct answer.
  2. Any string without two consecutive s.
    title: Correct answer.
  3. $$
    	(\square^* (\Diamond \square)^*)^* \cup (\square^*(\Diamond\square^*))^*\Diamond
    $$

2

  1. Give all computations on input strings.

    • is accepted
      title: Correct answer.
    • is accepted
      title: Correct answer.
    • is rejected
      title: Correct answer.
    • is rejected
      title: Correct answer.

3

Transform the DFA into an NFA using subset construction.

States: Favourable states: Initial state:

There is an -jump from to which means by .

digraph {
	label="Full DFA"
	rankdir=LR
	init[shape=point]
	node[shape=doublecircle]; r, pr, sr, spr;
	node[shape=circle] 0, s, p, sp;
	init->sp
	
	0->0 [label=a]
	0->0 [label=b]
	s->0 [label=a]
	s->s [label=b]
	p->pr [label=a]
	p->r [label=b]
	r->s [label=a]
	r->0 [label=b]
	sp->pr [label=a]
	sp->sr [label=b]
	pr->spr [label=a]
	pr->r [label=b]
	sr->s [label=a]
	sr->s [label=b]
	spr->spr [label=a]
	spr->sr [label=b]
}
digraph {
	label="Final DFA"
	rankdir=LR
	init[shape=point]
	node[shape=doublecircle]; r, pr, sr, spr;
	node[shape=circle] 0, s, sp;
	init->sp
	
	0 [label="{}"]
	s [label="{s}"]
	r [label="{s}"]
	pr [label="{p,r}"]
	sr [label="{s,r}"]
	sp [label="{s,p}"]
	spr [label="{s,p,r}"]
	
	0->0 [label=a]
	0->0 [label=b]
	s->0 [label=a]
	s->s [label=b]
	r->s [label=a]
	r->0 [label=b]
	sp->pr [label=a]
	sp->sr [label=b]
	pr->spr [label=a]
	pr->r [label=b]
	sr->s [label=a]
	sr->s [label=b]
	spr->spr [label=a]
	spr->sr [label=b]
}

4

Design an NFA that consists of all the strings that start with and end with over .

digraph {
	rankdir=LR
	init[shape=point]
	node[shape=doublecircle]; e;
	node[shape=circle];
	init->a
	
	a->b [label=x]
	b->c [label=x]
	c->c [label=x]
	c->c [label=y]
	c->d [label=y]
	d->e [label=y]
	e->c [label=x]
}

5

Show that the language “all strings over the alphabet that contain as a substring and end with ” is regular.

Can be represented using regular expression:

6

Convert the following regular language to a finite automaton accepting it:

digraph {
	rankdir=LR
	init[shape=point]
	node[label="" shape=doublecircle] a, 0;
	node[shape=circle];
	init->a
	
	a->b [label=ε]
	b->c [label=a]
	c->a [label=ε]
	c->d [label=b]
	d->a [label=ε]
	
	a->0 [label=ε]
	
	z->x [label=a]
	x->y [label=a]
	y->x [label=a]
	y->w [label=b]
	
	1->2 [label=b]
	2->3 [label=a]
	
	0->z [label=ε]
	0->1 [label=ε]
	
	w->0 [label=ε]
	3->0 [label=ε]
}