Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

EECS 510 Midterm 1

Total questions: 69

Worksheet time: 47mins

Name
Class
Date
1.

 A(n) (a)   is a finite, nonempty set of symbols usually denoted by 

 Σ.\Sigma.  

2.

 Σ = {0, 1}\Sigma\ =\ \left\{0,\ 1\right\}  is the (a)   alphabet.

3.

True or False:

The set of all UTF-8 characters, or the set of all printable UTF-8 characters is a common alphabet.

a)

True

b)

False

4.

A(n) (a)   is a finite sequence of symbols chosen from an alphabet.

5.

True or False:

A string is sometimes called a 'word'

a)

True

b)

False

6.

The (a)   is a string with zero symbols.

7.

True or false:

The empty string is denoted by θ\theta  


a)

True

b)

False

8.

True or False: 

The empty string is denoted by ϵ\epsilon  


a)

True

b)

False

9.

The length of a string is denoted by:

a)

∣s∣\left|s\right|

b)

∣ϵ∣\left|\epsilon\right|

c)

ss

d)

s1+s2s_1+s_2

10.

The concatenation of strings  s1s_1  and  s2s_2  is denoted by:

a)

 s1 ⋅ s2s_1\ \cdot\ s_2  

b)

 s1s2s_1s_2  

c)

 s1 + s2s_1\ +\ s_2  

d)

 s1 × s2s_1\ \times\ s_2  

11.

True or False: The empty string ϵ\epsilon  is a string over all alphabets, and is the identity for concatenation:  ϵs = sϵ = s\epsilon s\ =\ s\epsilon\ =\ s  


a)

True

b)

False

12.

 Σ0 = {ϵ}\Sigma^0\ =\ \left\{\epsilon\right\}  
 Σ1 = {0, 1}\Sigma^1\ =\ \left\{0,\ 1\right\}  
 Σ2 = {00, 01, 10, 11}\Sigma^2\ =\ \left\{00,\ 01,\ 10,\ 11\right\}  
 Σ3 = {000,001,010,011,100,101,110,111}\Sigma^3\ =\ \left\{000,001,010,011,100,101,110,111\right\}  
 Σn \Sigma^n\   are the strings of length n over the (a)   alphabet

13.

The ___________ of  Σ\Sigma  is the set of all strings over an alphabet Σ \Sigma\   


a)

Kleene closure

b)

concatenation

c)

word

d)

language

14.

 Σ? \Sigma^?\   is the set of all strings over an alphabet, while  Σ?\Sigma^?  is the set of all non-empty strings over an alphabet.

a)

+, -

b)

-, +

c)

*, +

d)

+, *

15.

A subset of Σ\Sigma * is called a (a)   .

16.

Select the correct ordering of the 5-tuple DFA:

a)

(Q, Σ, δ, q0, F)\left(Q,\ \Sigma,\ \delta,\ q_0,\ F\right)

b)

(Q, Σ, F, δ, q0)\left(Q,\ \Sigma,\ F,\ \delta,\ q_0\right)

c)

(Q, Σ, q0, δ, F)\left(Q,\ \Sigma,\ q_0,\ \delta,\ F\right)

d)

(Σ, Q, q0, δ, F)\left(\Sigma,\ Q,\ q_0,\ \delta,\ F\right)

17.

Select the correct variable from the 5-tuple DFA:


_____ is a finite, non-empty set of states

a)

Σ\Sigma

b)

QQ

c)

δ\delta

d)

q0q_0

e)

FF

18.

Select the correct variable from the 5-tuple DFA:


_____ is an alphabet of input symbols

a)

Σ\Sigma

b)

QQ

c)

δ\delta

d)

q0q_0

e)

FF

19.

Select the correct variable from the 5-tuple DFA:


_____:  Q×E⟶QQ\times E\longrightarrow Q  is a transition function

a)

Σ\Sigma

b)

QQ

c)

δ\delta

d)

q0q_0

e)

FF

20.

Select the correct variable from the 5-tuple DFA:


_____  ∈Q\in Q  is the initial state

a)

Σ\Sigma

b)

QQ

c)

δ\delta

d)

q0q_0

e)

FF

21.

Select the correct variable from the 5-tuple DFA:


_____  ⊆Q\subseteq Q  is the set of accepting states

a)

Σ\Sigma

b)

QQ

c)

δ\delta

d)

q0q_0

e)

FF

22.

The (a)   of a DFA A=(Q, Σ, δ, q0, F)A=\left(Q,\ \Sigma,\ \delta,\ q_0,\ F\right)  is denoted by  L(A)L\left(A\right)  and is defined as:

 L(A) :={w ∈Σ⋅ ∣ δ‘(q0, w)∈F ∣}L\left(A\right)\ :=\left\{w\ \in\Sigma^{\cdot}\ \left|\ \delta`\left(q_0,\ w\right)\in F\ \right|\right\}  

23.

For any language L, if there is a DFA AA  for which  L=L(A)L=L\left(A\right)  , then  LL  is said to be a (a)   .


24.

(a)   is like the deterministic variety except with the ability to explore multiple states "in parallel".

25.

The transition function δ\delta  for an NFA will take a state and a symbol and return a ____________.


a)

set of states

b)

single symbol

c)

set of symbols

d)

single state

26.

An NFA is a 5-tuple (Q, Σ, δ, q0, F)\left(Q,\ \Sigma,\ \delta,\ q_0,\ F\right) , like its DFA counterpart, with the one exception being ____, which maps a state and a symbol into the powerset of  Q.Q.  

___:  Q×Σ⟶P(Q)Q\times\Sigma\longrightarrow P\left(Q\right)   


a)

 QQ  

b)

 Σ\Sigma  

c)

 δ\delta  

d)

 q0q_0  

e)

 FF  

27.

The (a)   of the NFA AA  is  L(A)L\left(A\right)  and is defined as  L(A):={w∈Σ⋅∣δ′(q0, w )∩F≠0∣}L\left(A\right):=\left\{w\in\Sigma^{\cdot}\left|\delta'\left(q_0,\ w\ \right)\cap F\ne0\right|\right\}  


28.

For any language LL  , if  L=L(A)L=L\left(A\right)  , then we will also say that the language is (a)   by the NFA  AA  .

29.

The goal of (a)   is to build a DFA D=(QD, ΣD, δD, {q0}, FD)D=\left(Q_D,\ \Sigma_D,\ \delta_D,\ \left\{q_0\right\},\ F_D\right)  from a given NFA  N=(QN, ΣN, δN, q0, FN)N=\left(Q_N,\ \Sigma_N,\ \delta_N,\ q_0,\ F_N\right)  such that  L(D)=L(N)L\left(D\right)=L\left(N\right)  


30.

In subset construction, the initial state DD  is the (a)   set containing only the initial state for  NN  .


31.

A language  LL  is accepted by some DFA if and only if it is accepted by some (a)   .

32.

A(n) (a)   -transition is one which can be triggered with or without consuming any input.

33.

True or False: In an  ϵ\epsilon  -transition,  ϵ\epsilon  can be a symbol in  Σ\Sigma  .

a)

True

b)

False

34.

A(n) (a)   -NFA is a regular NFA with the transition function augmented to operate on a state and a symbol, or ϵ, δ : Q×(Σ∪{ϵ})⟶P(Q)\epsilon,\ \delta\ :\ Q\times\left(\Sigma\cup\left\{\epsilon\right\}\right)\longrightarrow P\left(Q\right)  


35.

The ϵ\epsilon -closure of a state q is (a)   (q) 


36.

The ________ case of an ϵ\epsilon -closure of a state  qq   is defined as  q∈ECLOSE(q)q\in ECLOSE\left(q\right)   


a)

base

b)

recursive

37.

The ________ case of an ϵ\epsilon -closure of a state  qq   is defined as  δ(p, ϵ)⊆ECLOSE(q)\delta\left(p,\ \epsilon\right)\subseteq ECLOSE\left(q\right)   for every  p∈ECLOSE(q)p\in ECLOSE\left(q\right)  


a)

base

b)

recursive

38.

A language LL is accepted by some  ϵ\epsilon -NFA if and only if  LL  is accepted by some (a)   .  


39.

 LnL^n  is the language of  nn  words from  LL  ____________ together.

a)

concatenated

b)

added

c)

unioned

40.

 LL * is the language of _______ or more words from  LL  concatenated together. 

a)

zero

b)

one

c)

two

d)

three

41.

A language accepted by some DFA/NFA/ ϵ\epsilon -NFA is called a (a)   language. 


42.

True or False:

Every DFA can be converted into a regular expression, but not every regular expression can be converted into an ϵ\epsilon -NFA. 


a)

True

b)

False

43.

True or False:

Every DFA can be converted into a regular expression, and every regular expression can be converted into an ϵ\epsilon -NFA. 


a)

True

b)

False

44.

True or False:

If LL  is the language accepted by some DFA  AA  , then there is a regular expression  EE  such that  L(R)=LL\left(R\right)=L  


a)

True

b)

False

45.

Every language defined by a regular expression RR is also defined by some __________ automaton. 


a)

finite

b)

infinite

46.

State the algebraic law:


  (R+S)+T = R+(S+T)\left(R+S\right)+T\ =\ R+\left(S+T\right)  

 (RS)T = R(ST)\left(RS\right)T\ =\ R\left(ST\right)  

a)

associativity

b)

distributive

c)

annihilator

d)

identity

e)

commutativity

47.

State the algebraic law:

 R+S=S+RR+S=S+R  


a)

commutativity

b)

associativity

c)

identity

d)

annihilator

e)

distributive

48.

State the algebraic law:

 0+R=R+0=R0+R=R+0=R  

 ϵR=Rϵ=R\epsilon R=R\epsilon=R  

a)

identity

b)

distributive

c)

annihilator

d)

associativity

e)

commutativity

49.

State the algebraic law:

 0R=R0=00R=R0=0  

a)

annihilator

b)

identity

c)

associativity

d)

commutativity

e)

distributive

50.

State the algebraic law:

 R(S+T)=RS+RTR\left(S+T\right)=RS+RT  


 (R+S)T=RT+ST\left(R+S\right)T=RT+ST  

a)

annihilator

b)

identity

c)

associativity

d)

commutativity

e)

distributive

51.

State the algebraic law:

 R+R=RR+R=R  

a)

idempotent

b)

closure laws

52.

State the algebraic law:
( RR *)* =  RR *   


 00 * =  ϵ\epsilon  

 ϵ\epsilon * =  ϵ\epsilon    

a)

idempotent

b)

closure laws

53.

Syntactic sugar for one or more copies:

a)

 R+ :=RRR^{+\ }:=RR *  =R=R * RR    

b)

 R? := R+ϵR?\ :=\ R+\epsilon  

c)

 R{0} := ϵR\left\{0\right\}\ :=\ \epsilon  
 R{n+1}=RR{n}R\left\{n+1\right\}=RR\left\{n\right\}  

54.

Syntactic sugar for zero or one copies:

a)

 R+ :=RRR^{+\ }:=RR *  =R=R * RR    

b)

 R? := R+ϵR?\ :=\ R+\epsilon  

c)

 R{0} := ϵR\left\{0\right\}\ :=\ \epsilon  
 R{n+1}=RR{n}R\left\{n+1\right\}=RR\left\{n\right\}  

55.

Syntactic sugar for exactly  nn  copies:

a)

 R+ :=RRR^{+\ }:=RR *  =R=R * RR    

b)

 R? := R+ϵR?\ :=\ R+\epsilon  

c)

 R{0} := ϵR\left\{0\right\}\ :=\ \epsilon  
 R{n+1}=RR{n}R\left\{n+1\right\}=RR\left\{n\right\}  

56.

Let LL be a regular language. There exists a constant  nLn_L  such that for every string  w∈Lw\in L  with  ∣w∣≥nL\left|w\right|\ge n_L  , we can break  ww  into 3 parts  w=w=   (a)   such that (1) y≠ϵy\ne\epsilon  , (2)  ∣xy∣≤nL\left|xy\right|\le n_L , and (3)  xykz∈Lxy^kz\in L  for every  k∈Nk\in N    


57.

In the following two-player scheme, we use the (a)   to show that languages are not regular:

1. We pick that language LL  which we believe is not regular.

2. The opponent chooses a value for  nLn_L  


3. We choose the word  ww  whose length is at least  nLn_L  
4. The opponent gets to split  ww  into 3 parts  x, y,x,\ y,  and zz  , but we know that  y≠ϵy\ne\epsilon  and  ∣xy∣≤nL\left|xy\right|\le n_L  
5. Finally, we must show that some string of the form  xykz ∉Lxy^kz\ \notin L  for some k∈Nk\in N  

58.

If LL  and  MM  are regular languages over an alphabet  Σ\Sigma  , then so is  L L\   ___ MM  


a)

 ∪\cup  

b)

 ∩\cap  

59.

True or False:

If LL  and MM  are regular languages over the same alphabet, then so are  L⋅ML\cdot M  and  LL * 


a)

True

b)

False

60.

True or False:

If LL  is a regular language, then so is it complement  LCL^C  

a)

True

b)

False

61.

If LL  and  MM  are regular languages over the same alphabet, then so are  LL __ MM  and  LL __ MM   


a)

 ∪; \cup;\   \

b)

 ∪; ∩\cup;\ \cap  

c)

 ∩; \cap;\   \

62.

By DeMorgan's laws,

 LL __ M = (LC∪MC)CM\ =\ \left(L^C\cup M^C\right)^C   


a)

 ∩\cap  

b)

 ∪\cup  

c)

\

63.

 LL  __ M = L∩MCM\ =\ L\cap M^C  

a)

\

b)

 ∪\cup  

c)

 ∩\cap  

64.

The _________ of a string a1a2...ana_1a_2...a_n  is the string  an...a2a1a_n...a_2a_1  . We denote the ________ of string  ww  as  wRw^R  




(a)  

65.

The (a)   of language LL is  LRL^R  which is the language whose strings are the reverse of strings in  LL   


66.

True or False:
If LL  is a regular language, then so is  LRL^R  

a)

True

b)

False

67.

For alphabets Σ\Sigma and  TT , a function  h : Σ⟶Th\ :\ \Sigma\longrightarrow T * induces a (a)   on strings  h : Σh\ :\ \Sigma * ⟶T\longrightarrow T * defined as  h(w) := h(a1)h(a2)...h(an)h\left(w\right)\ :=\ h\left(a_1\right)h\left(a_2\right)...h\left(a_n\right)  for any string  w = a1a2...anw\ =\ a_1a_2...a_n  over  Σ\Sigma       

68.

True or False:
If LL  is a regular language over  Σ\Sigma , and  hh  is a string homomorphism from  Σ\Sigma , then  h(L):={h(w)∣w∈L∣}h\left(L\right):=\left\{h\left(w\right)\left|w\in L\right|\right\}  is also a regular language.

a)

True

b)

False

69.

True or False:
Let hh  be a string homomorphism from alphabet  Σ\Sigma  to  TT . If  LL  is a regular language over  TT , then  h−1(L)h^{-1}\left(L\right)  is also regular over  Σ\Sigma    

a)

True

b)

False