0% found this document useful (0 votes)
18 views2 pages

Comp3702 - ps1

Theory of Computation

Uploaded by

Durand Tim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views2 pages

Comp3702 - ps1

Theory of Computation

Uploaded by

Durand Tim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

COMP3702–Theory of Computation, Sem II, 2023—Assignment 1 1

UNIVERSITY OF THE WEST INDIES


Department of Computing
COMP3702–Theory of Computation
Sem II, 2023
Lecturer: Dr. Daniel Coore
Assignment 1

Due Friday, February 10, 2023

Instructions: There are three problems on this assignment, worth a total of 50 points. You
should attempt all problems.

Notation and Conventions:

ˆ For a string x, let [x]k denote the integer value of x treated as a number written in base k.
For example [101]2 = 5 and [0210]3 = 21. For any k, We define []k = 0.

ˆ When asked to present an FA, unless explicitly asked, you do not need to prove that your FA
is correct, but you should, instead, provide a brief explanation of how it was designed, and
an argument for its correctness by describing what the states accomplish (including why only
the appropriate strings end in accepting states). If you wish you may offer a proof sketch, if
you feel comfortable doing so. Do not tell me what it does on each transition – I can read
that from the diagram.

Problem 1: Automata [20]


nh i h i h i h io
0 0 1 1
a. Let Σ2 = 0 , 1 , 0 , 1 be the set of all 2-element column vectors of binary digits. A
h ih ih ih i
string over Σ2 is interpreted as 2 rows of binary strings. For example the string 01 11 10 10
h i
would be interpreted as the two strings 0111
1100 .

Let
A = {[uv] ∈ Σ∗2 | [v]2 = 5[u]2 }
Show that A is regular. [10]

b. The finite field of size 2, denoted F2 contains only two members 0 and 1. The polynomial ring
F2 [x] is the set of all polynomials in x that have coefficients from F2 . Addition, subtraction
and multiplication in F2 [x] works just like it would with a usual polynomial with rational
coefficients. Importantly though, coefficients are never allowed to leave the field F2 , so they
are always reduced modulo 2. So, for example, in F2 [x], adding x2 + x and x + 1 gives x2 + 1
and not x2 + 2x + 1 (since 2x is equivalent to 0x in F2 [x]). For any w ∈ {0, 1}∗ , where
w = wn−1 . . . w1 w0 , let p(w) represent the polynomial wn−1 xn−1 + . . . + w1 x + w0 in F2 [x].
Show that
B = {w ∈ {0, 1}∗ | p(w) is divisible by x2 + x + 1 in F2 [x]}
COMP3702–Theory of Computation, Sem II, 2023—Assignment 1 2

is a regular language by presenting a DFA to recognise it. [10]


1
(This is the basis of CRC checksums . This question illustrates how CRC checksums can be
efficiently tested.).

Problem 2: Regular Expressions [10]

a. Use the GNFA method to obtain an equivalent regular expression for the language recognised
by the NFA given in Figure 1. [10]

0


s0 s2

1 0 1
0
0
s1

Figure 1: NFA for conversion to an equivalent regular expression

Problem 3: Generalised Automata [20]

a. Recall in class the discussion that for a given NFA, N1 = hQ, Σ, δ, q1 , F i, if we wanted to
construct an NFA, N , such that L(N ) = L(N1 )∗ then it was necessary to create a new start
state q0 that was also an accepting state. Then we added -transitions from q0 to q1 and from
each state of F back to q0 .
A student proposes omitting q0 and simply putting -transitions from F back to q1 and making
q1 be an accepting state so that N would accept . Explain why q0 is necessary by providing
a counter example to the student’s proposed construction. (That is, present an NFA N1 such
that the student’s proposed NFA N does not recognise the appropriate language. Note in
showing that the NFA recognises the wrong language, you need to present a string that it
either should accept, but doesn’t or vice-versa.) [7]

b. (i) Given DFAs DA and DB , that recognise languages A and B respectively, give a direct
construction for a DFA D that accepts strings that are either in both A and B or in
neither. Give a brief “proof” that your construction is correct. [8]
(ii) Use the result from the previous part to construct a DFA that accepts all and only
strings that either contain two consecutive 0’s or two consecutive 1’s or neither. [5]

1
CRC checksums are defined by treating the data as a polynomial in F2 [x] and obtaining their residue modulo
some fixed irreducible polynomial.

You might also like