0% found this document useful (0 votes)
255 views

CSI 3104 Introduction To Formal Languages Winter 2020 Assignment 4

This document outlines an assignment for an introduction to formal languages course. It contains 5 problems related to finite automata and regular languages: 1) Construct a Mealy machine to convert binary to octal. 2) Construct a Moore machine to check for divisibility of 1s in input by 3. 3) Analyze and convert a given Mealy machine. 4) Find a regular expression and automaton for the intersection of two regular languages. 5) Use the pumping lemma to prove a language of balanced strings is nonregular.

Uploaded by

john
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)
255 views

CSI 3104 Introduction To Formal Languages Winter 2020 Assignment 4

This document outlines an assignment for an introduction to formal languages course. It contains 5 problems related to finite automata and regular languages: 1) Construct a Mealy machine to convert binary to octal. 2) Construct a Moore machine to check for divisibility of 1s in input by 3. 3) Analyze and convert a given Mealy machine. 4) Find a regular expression and automaton for the intersection of two regular languages. 5) Use the pumping lemma to prove a language of balanced strings is nonregular.

Uploaded by

john
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/ 1

CSI 3104 Introduction to Formal Languages

Winter 2020
Assignment 4
Assigned February 8, due Friday, March 6 at 12:00 (noon)

1. Let Σ = {0, 1} and let Γ = {0, 1, 2, 3, 4, 5, 6, 7, #}. Construct a Mealy machine that
considers the input as a binary number and outputs the number in octal format (base 8)
with 2 occurrences of # between each octal digit. For example, if the input is 100110, the
output is ##4##6. Assume that the length of the input word is always divisible by 3.
For example, if the input is 010110, the output is ##2##6.

2. Let Σ = {0, 1} and let Γ = {0, 1}. Construct a Moore machine such that the output string
ends in 1 if the total number of occurrences of 1 in the input word is divisible by 3, and
ends in 0 if the total number of occurrences of 1 in the input word is not divisible by 3.
(The rest of the output is ignored.)

3. Consider Mealy machine below. Σ = {a, b} and Γ = {0, 1}.

a/0
a/0
q0 q1
b/0
b/1

(a) Describe (in English phrases) what this Mealy machine is computing.
(b) Convert this Mealy machine into a Moore machine.
(c) For input baba, what is the output of the original Mealy machine?
(d) For input baba, what is the output of your Moore machine?

4. Let L1 be language((aa + ab + ba + bb)∗ ) and let L2 be language((a + b)∗ aa(a + b)∗ ).


Find a regular expression and an FA that each define L1 ∩ L2 . You may use the algorithms
in Chapters 7 and 9, but you don’t have to.

5. Let Σ = {a, b, c}. Let L be the language of all words containing any string s of a’s and b’s
followed by a number of c’s equal to length(s).

L = {(a + b)n cn | n ≥ 1} = {ac, bc, aacc, abcc, bacc, bbcc, aaaccc, aabccc, abaccc, . . .}

Prove that L is nonregular by using the first version of the pumping lemma (Theorem 13).

You might also like