0% found this document useful (0 votes)
109 views1 page

Assignment No.1 PDF

This document is an assignment from the Department of Computer Sciences at Bahria University Lahore Campus. It consists of 5 questions regarding theory of automata, including calculating the number of strings of a given length in a language, recursively defining languages, understanding regular expressions, and constructing regular expressions to define specified languages over the alphabet {a,b}. Students are instructed to submit clear diagrams if needed, with the assignment due on February 23, 2020.

Uploaded by

USAMA ARSHAD
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)
109 views1 page

Assignment No.1 PDF

This document is an assignment from the Department of Computer Sciences at Bahria University Lahore Campus. It consists of 5 questions regarding theory of automata, including calculating the number of strings of a given length in a language, recursively defining languages, understanding regular expressions, and constructing regular expressions to define specified languages over the alphabet {a,b}. Students are instructed to submit clear diagrams if needed, with the assignment due on February 23, 2020.

Uploaded by

USAMA ARSHAD
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

Bahria University Lahore Campus

Department of Computer Sciences

THEORY OF AUTOMATA
ASSIGNMENT # 01
Marks: 20 DUE DATE: 23, FEBRUARY 2020
Instructor Name: Mr. Tahir Iqbal
Program: BSCS 4A,4B

Rules for Marking:

It should be clear that your assignment will not get any credit if:
• The assignment is submitted after due date
• The assignment is copied
• You may use any software for diagram, but diagram should be clear. (If needed)
• No query will be entertained for the assignments. Understanding is part of it.
Objective:

The objective of this assignment is to provide hands on experience of:

• Calculating number of strings with certain length


• Recursive definition of Language
• Understanding the regular expressions

Q.1 Consider the following recursive definition of PALINDROME:

a. Rule 1. a and b are in PLANILDROME


Rule 2. If x is in PALINDROME then so are axa and bxb.
Unfortunately the words defined by the rules have odd lengths. Fix the problem such
that all appropriate words are included.

Q.2 Consider the language S*, where S = {bb,a}.


How many words does this language have of length 4? of length 5? of length 6? What
can be said in general?
Q.3 Construct a regular expression defining each of the following languages over {a, b};
a. All strings such that the number of a’s is a multiple of 3.
b. All strings such that the number of a’s is odd.

Q.4 Construct a regular expression over {a, b} of all words that do not have both the
substrings bba and abb.
Q.5 Clarify the difference between valid and in valid words.

Good Luck ☺

You might also like