Sunteți pe pagina 1din 6

CSCI216 - Automata and Language Theory

Course Description:

An introduction to the theory of computation, emphasizing finite automata and regular


languages and logic. Additional topics to be discussed are context-free languages and other
pre-requisite topics.

What is computation?

- Computing a function relating input and output


- Generating or enumerating a language
- Accepting or recognizing an input

Models of computation

- Regular Expressions
- Grammars Context-free and otherwise
- Automata

Mathematical Science

- Precise definitions
- Prove properties
- Simplified models

Applications (Laboratory)

- Software for designing digital circuits


- Lexical Analyzer of a compiler
- Searching for keywords in a file or on the web
- Software for verifying finite state systems, such as communication protocols.

Review of Mathematical Prerequisites

- Set, Relations and Functions


- Cardinality countable and uncountable sets
- Directed graphs

GRADING SYSTEM

Prelim Midterm Final


Quizzes 40% 40% 40%
Attendance/Participation 10% 10% 10%
Major Examination 50% 50% 50%
TOTAL 100% 100% 100%

Final Grade = 30% Prelim + 30% Midterm + 40% Final


SET and SET ELEMENTS

A set is a collection of objects called elements.

The elements of a set must be distinct, unordered and well-defined. You write the
elements of a set separated by commas and the whole thing enclosed in braces { }.

Example:

The sets {1,1,2,3}, {1,2,3,3}, and {2,3,1,3} can be simply written as a set with three
elements {1,2,3}.

A set may be either finite or infinite. If the elements can be counted or enumerated,
then the set is said to finite. Otherwise, it is infinite. For example, the set of capital
letters in the English alphabet are finite. On the other hand, the set of real numbers are
infinite. The ellipses () at the end of the list denote an infinite list of elements.

The number of elements in a finite set is termed as the cardinality of the set denoted by
| |. Thus, if A = {1,2,3}, then the cardinality |A| = 3.

Universal Set is the totality of all elements under consideration. This is denoted by the

symbol u.
A set containing no elements is called an empty set. This is denoted by or { }.

Set Membership

We use the symbol ("is an element of") to denote set membership. Otherwise, we
write to denote that the element is not an element of the set.
Example:

Let A = {1, 2, {1}}

Here, 1 A, 2 A, and {1} A. But {2} A.

Set Containment

We use the symbol ("is a subset of") to denote set containment. We say "set A is a
subset of set b" if and only if every element of set A is an element of set B. Otherwise, if
set A is not a subset of B, we write A B.

Example:

Let A = {1}, b = {2}, C = {1, 2}


Here, A C, B C, A B or C A
Equal set

A set is equal to another set, if and only if the sets have the same elements. For
example, if A = {1,2,3} and B = {3,2,1}, then A = B.

Proper Subset

If A B and A B, then A is said to be properly contained in B, or that set A is a proper


subset of set B. And we write this as A B.

Example:

Let A = {1}, b = {2}, C = {1, 2}


Here, A c, B C, A B or C A

Binary Operations on Sets

Complement of A A' is the set of all elements that are not in the set A (but are in the

universal set u.
Union of A and B A B is the set of all elements that are either in sets A or B.

Intersection of A and B A B is the set of all elements that are both in sets A and
B.

Difference of A and B A B is the set of all elements that are in set A but not in set
B.

Symmetric Difference of A and B A B is the set of all elements that are either in A
or in B but not both.

Example:

1. Let A = { 1,3,5,7 }, B = {1,2,3,4}, and u = {1,2,3,4,5,6,7,8,9,10}

A B = {1,2,3,4,5,7}
A B = {1,3}
A B = {2,4,5,7}
A B = {5,7}
A' = {2,4,6,8,9,10}

2. Consider the following sets:

A = {1,2,3,4,5}, B = {2,4,6,8}, C = {1,3,5,7,9}, D = {1,2,9,10} and

u = {1,2,3,4,5,6,7,8,9,10}

Perform the following set operations by writing the resulting sets.

a. (A B) C

Solution: (A B) = {2,4}
C = {1,3,5,7,9}
{2,4} {1,3,5,7,9} = {1,2,3,4,5,7,9}

b. A (B C)

Solution: A = {1,2,3,4,5}
(B C) = {1,2,3,4,5,6,7,8,9}

{1,2,3,4,5} {1,2,3,4,5,6,7,8,9} = {1,2,3,4,5}

c. A (B C)
d. (A (B C) ) D
e. (A B) (A B)'

RELATIONS

Allow us to formalize the notion of relationships that exist among the sets under
consideration.

A relation can be thought of as a table that lists the relationships of elements to other
elements. For example, Table below shows which students are taking which courses.

Table shows the relation of students to courses.

Student Course
Don BSCS
Anna MSCS
Erwin MBA
Dona BSME
Deck BSIS

Thus, Don is taking BSCS and Anna is taking MSCS. In the language of relations, we
would say that Don is related to BSCS and that Anna is related to MSCS.

Cartesian product

Denoted by A x B, where A and B be non-empty sets. That is, A x B is the set of all
ordered pairs (x.y) such that x comes from A and y comes from B; x is called the first
coordinate component and y is called the second coordinate component.

Example:

Let A = {1,2} and B = {x,y,z} then

A x B = { (1,x), (1,y), (1,z), (2,x), (2,y), (2,z)} and


B x A = { (x,1), (x,2), (y,1), (y,2), (z,1), (z,2)}

Relation

A (binary) relation R from a set A to a set B is any subset of the Cartesian product
AxB. If an ordered pair (x,y) R, we say x is related to y by R, and we write xRy. If
A=B, we call R a (binary) relation on A.

In other words, a relation is a set of ordered pairs.


Domain / Range / Field

For a relation R, the domain of R, denoted by (R), is the set

{ x A | (x,y) R for some y B},

And the range of R, denoted by R (R), is the set

{y B | (x,y) R for some x A}

The field of R, denoted by F (R), is (R) u R (R).

If a relation is given as a table, the domain consists of the entries in the first column and
the range consists of those in the second column.

Example:

Student Course
Don BSCS
Anna MSCS
Erwin MBA
Dona BSME
Deck BSIS

A = { Don, Anna, Erwin, Dona, Deck}


B = { BSCS, MSCS, MBA, BSME, BSIS}

Then, our relation for the given table can be given as

R = { (Don, BSCS), (Anna, MSCS), (Erwin, MBA), (Dona, BSME), (Deck, BSIS) }
The domain of R (first column) is the set A, and the range of R (second column) is the
set B.

A relation may also be given by simply specifying the ordered pairs that belong to the
relation. Another way is by giving a rule for membership in the relation.

Example:

Let A = {2,3} and B = { 3,4,5,6}

Let R be a relation from A to B where R = { (x,y) | "x exactly divides y"}

Enumerating the elements of R, we have, R = { (2,4), (2,6), (3,3), (3,6) }

If we rewrite R as a table, we get

A B
2 4
2 6
3 3
3 6

Here, (R) = { 2,3}, and R (R) = {3,4,6}


Combinatorial Principle
Combinatronics has two simple but very important tools in counting, namely: the Sum
Rule and the Product Rule.

The Sum Rule

If a set X is the union of disjoint, non-empty subsets S1, S2,,Sn then


|X| = |S1| + |S2| + + |Sn|
That is, the whole is the sum of its parts.

Example:
Supposed a card is drawn from an ordinary deck of playing cards. In how may
ways can we draw

a) A heart or a spade?
b) A heart or an ace?
c) A numbered card or a king?

The Product Rule

If S1, S2,,Sn are non empty sets, then the number of elements in the Cartesian
product S1 x S2 x x Sn is the product is
|s1 x S2 x x Sn| = |S1| x |S2| x x |Sn|

Example:

Supposed we will form a three-digit number using the digits 1,3,4,5,6,8,9.

a) How many 3-digit numbers can be formed, if digits may be repeated?


b) How many 3-digit numbers can be formed, if no digit can be repeated?

S-ar putea să vă placă și