Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

CSC 485/585 Homework #1

DUE : Tuesday TBA, 2016 in class - hardcopy


Draw the transition diagram (the graph) for a DFA accepting the following 7
languages over the alphabet {0,1}. Your automata MUST be Deterministic. You must
use JFLAP to produce your transition diagrams (i.e. graphs). No hand-written
diagrams will be graded.
1. L = {w | the 3rd symbol from the end of w is a 1}
2. L = {w | the # of 0s in w is divisible by 3 and the # of 1s is divisible by 2}
3. L = { w | when interpreted as a binary number w is an even number}
4. L = { w | w begins with the substring 0010 or the substring 0110 }
5. L = {w | w does not end with 0001 }
6. (CSC 585 only!!!) L = { w | somewhere in w there are two 0s separated by a
number of 1s which is a multiple of 4 (note that zero is a multiple of 4)}
7. (CSC 485 Only!!!) L = { w | w consists of 1 or more as followed by 1 or more bs
followed by 1 or more
cs}
8. Given the following sets, provide the value for the following set theory expressions.
S = { A, B, C, D, E, F } T = { 1, 2, 3, 4, 5, 6, 7, 8} R = { x | x is an odd positive integer}
a.
b.
c.
d.
e.
f.

|S| * |T| - 8
|2T|
TR
SR
{} {}
R

9. Suppose you were to build the Powerset of the set { A, cat, dog, 56.7, F, G, 13, 99}.
How many elements would there be in the powerset?
10. (CSC 485 only!!!) How many elements would there be in the set AxB (the crossproduct/cartesian-product) if A and B were defined as follows?
A = { x | x is an uppercase character in the English alphabet }
B = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }
11. (CSC 585 only!!!) Rank the following sets from smallest to largest cardinality. If
any sets are of equal cardinality indicate that they are equal cardinality.

a.
b.
c.
d.
e.
f.
g.

Set of all integers


Set of all real numbers between 0.0 and 1.0 inclusive.
Set of positive integers that are multiples of 3423
Set of all English characters
Set of all real numbers
Set of all odd integers
Set of all binary strings

Let the set of real numbers between [0,1] be A, and set of real numbers between [0,1 Million] be B. Although, intuition suggests
that size (B) > size (A), Mathematics tells us that the size of both sets are equal!. Which means both the sets have equal number
of elements. The number of elements in a set is called as Cardinality (in Mathematics). The Cardinality can be associated to both
finite and infinite sets. Understanding Cardinality in finite sets is pretty straight forward but in our case, both the sets are infinite
sets. A and Bhave infinite elements in them, but in no way the infinity in B is bigger than the infinity inA. That's the beauty
of Infinity!. The set A is so huge that however small two numbers a,b you take there is always a number you can find between
them (say a<(a+b)/2<b). This uncountable quantity is given a name called Infinity. If still you are not convinced, it can be thought
this way, if you multiply the elements of set A [0,1] by 1 Million you end up getting set B, isn't it?. Then how can you say that you
have more elements in set B!. If you are still not convinced about the answer you can learn about the Cardinality of Infinite
sets which were postulated by Georg Cantor and understand till your satisfaction. Or you can watch the below video to keep
yourself away from the rigour of Abstract Mathematics!

Use JFLAP to produce NFA (non-deterministic finite automata) for the following
language.
12. L = { w | w is a string built from the following alphabet and the last digit in the string w HAS appeared
previously in the string. For example, 2322453 IS in the language L since the 3 has
appeared earlier in the string. However, 22423532437 is NOT in L since the 7 has
not appeared previously in the string.

You might also like