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

Automata Theory Assignment Copy

The document is an assignment on Automata Theory, focusing on various concepts related to sets, relations, graphs, and strings. It defines key terms such as union, intersection, equivalence relations, and graph properties, providing examples and explanations for each. Additionally, it covers operations like concatenation and lexicographic ordering of strings.

Uploaded by

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

Automata Theory Assignment Copy

The document is an assignment on Automata Theory, focusing on various concepts related to sets, relations, graphs, and strings. It defines key terms such as union, intersection, equivalence relations, and graph properties, providing examples and explanations for each. Additionally, it covers operations like concatenation and lexicographic ordering of strings.

Uploaded by

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

NAME: OKOH MAUREEN OMOSEO

MATRIC NUMBER: UAT22/03/04/1873


DEPARTMENT: COMPUTER SCIENCE
COURSE CODE: CSC 313
COURSE TITLE: AUTOMATA THEORY COMPUTABILITY & FORMAL LANGUAGES

ASSIGNMENT 3

1. Define the following terms:


(a) Set: A set is a collection of objects.
(b) Union: A union of set is a combination of all elements present in
both sets. E.g., A B
(c) Intersection: The intersection of a set is the combination elements
that are present in both sets. E.g., A ∩ B
2. Define the following terms:
(a) Set difference: The difference of a set A and B, written as A - B can
be defined as the set that contains everything in that is in A but not
in B.
(b) Complement: The complement of a set A, written as Ā, is the set
containing everything that is not in A but in the universal set.
Explain with examples.
(a) Given A = {2, 3, 6}, B = {2, 6}
A – B = {3}
(b) Given U = {1, 2, 3, 4, 5, 6} and A = {2, 3, 6} Ā
= {1, 4, 5}
3. What have you understood by the following:
(a) Idempotency: An operation is idempotent if performing it
repeatedly on the same operand produces the same result.
A A=A
A∩A=A
(b) Commutativity: An operation is commutative if changing the order
of the operands does not change the result.
A B=B A
A∩B=B∩A
(c) Associativity in respect of sets: An operation is associative if the
grouping does not affect the result.
(A B) C = A (B C)
(A ∩ B) ∩ C = A ∩ (B ∩ C)
4. Define the following with reference to sets:
(a) Distributivity: An operation is distributive over another operation
if it can be “distributed” across the operands of the other
operation.
Union over intersection: (A ∩ B) C = (A C) ∩ (B C)
Intersection over union: (A B) ∩ C = (A ∩ C) (B ∩ C)
(b) Absorption: The absorption laws state that the union or
intersection of a set with the intersection or union, respectively, of
itself and another set, is equal to the original set.
Union absorption: (A B) ∩ A = A
Intersection absorption: (A ∩ B) A = A
(c) De Morgan’s laws: De Morgan’s laws provide a way to express the
complement of a union or intersection in terms of the

Complement of union: A – (B ∩ C) = (A – B) (B – C)
complements of the individual sets.

Complement of intersection: A – (B C) = (A – B) ∩ (A – C)
5. Stand prove De Morgan’s Laws.

A – (B C) ⇒ x A and x B C
Showing that A – (B C) = (A – B) ∩ (A – C). x

⇒ x A and x B and x C
⇒ (x A and x B) and (x A and x C)
⇒ x A – B and x A – C
⇒ x (A – B) ∩ (A – C

x (A – B) ∩ (A – C) ⇒ x A – B and x A – C
Therefore, A – (B C) (A – B) ∩ (A – C) Conversely;

⇒ (x A and x B) and (x A and x C)


⇒ x A and (x B and x C)
⇒ x A and x
B C
⇒ x A – (B
C)
Therefore, (A – B) ∩ (A – C) A – (B C).
Hence A – (B C) = (A – B) ∩ (A – C).

6. Define the following terms with reference to sets:

∅, then the sets A and B are said to be disjoint.


(a) Disjoint sets: If A and B have no common element, that is, A ∩ B =

(b) Cardinality: The “Cardinality” of a set A, written |A|, is the


number of elements in set A.
(c) Powerset: The “powerset” of a set A, written 2A, is the set of all
subsets of A; i.e., a set containing ‘n’ elements has a powerset
containing 2n elements.

ordered pairs (x, y) where x ∈ A and y ∈ B is called the “Cartesian


(d) Cartesian product: Let A and B be two sets. Then the set of all

{(x, y): x ∈ A and y ∈ B} 7. Define a relation. Explain with an


Product” of the sets A and B and is denoted by A × B, i.e. A × B =

example.
A relation on sets S and T is a set of ordered pairs (s, t), where;
(a) S ∈ S (s is a member of S)
(b) t ∈T
(c) S and T need not be different
(d) The set of all first elements in the “domain” of the relation, and (e) The
set of all second elements is the “range” of the relation. Example:

Suppose S is the set {a, b, c, d, e} and set T is {w, x, y, z}.


Then a relation on S and T is R = {(a, y), (c, w), (c, z), (d, y)} The four
ordered pairs in the relation is represented as shown in Fig. 2.
8. What is an equivalence relation? Give an example.
A subset R of A × A is called an equivalence relation on A if R satisfies the
following conditions:
(a) (a, a) ∈ R for all a ∈ A (R is reflexive)
(b) If (a, b) ∈ R, then (b, a) ∈ R, then (a, b) ∈ R (R is symmetric)
(c) If (a, b) ∈ R and (b, c) ∈ R, then (a, c) ∈ R (R is transitive)
Example: Show that the relation “congruence modulo m” over the set of
positive integers is an equivalence relation.
Solution: Assume that N = Set of all positive integers and m = given

For x, y ∈ N, x ≡ y (mod m) if and only if x – y is divisible by m,


positive integer.

i.e. x – y = km, for k ∈ z Let x, y, z ∈ N. Then;


i. As x – x = 0 m., x ≡ x (mod m), for all x ∈ N. Therefore, this
relation is reflexive.
x ≡ y (mod m) ⇒ x – y = km, for integer k
⇒ x – y = ( – k)m
ii.

⇒ y ≡ x (mod m)
Therefore, the relation is symmetric. iii.
x ≡ y (mod m) and y ≡ z (mod m)
⇒ x – y = km and y – z = lm for integers k, l.
⇒ (x – y) + (y – z) = (k + l)m
⇒ (x – z) = (k + l)m
⇒ x ≡ z (mod m) since k + l is also an integer.
Therefore, the relation is transitive.
Since the relation is reflexive, symmetric and transitive, the relation
“congruence modulo m” is an equivalence relation.

9. Explain the terms:


(a) Partial ordered set/Poset: A relation R on a set S is called a “Partial
ordering” or a “Partial order”, if R is reflexive, antisymmetric and
transitive. A set S together with a partial ordering R is called a
“Partially ordered set” or “Poset”.
Example: The relation ≤ on the set R of real numbers is reflexive,
antisymmetric and transitive. Therefore ≤ is a “Partial ordering”.
(b) Partition of a relation: A Partition P of S is a collection {Ai} of

(i) Each a ∈ S belongs to some Ai, (ii)


nonempty subsets of S with the properties:

If Ai ≠ Aj, then Ai ∩ Aj = ∅.
Thus a partition P of S is a subdivision of S into disjoint nonempty
sets. If R is an equivalence relation on a set S, for each ‘a’ in S, let
[a] denote the set of elements of S to which ‘a’ is related under R,
i.e.
[a] = {x : (a, x) ∈ R}
Here [a] is the Equivalence class” of ‘a’ in S.
The collection of all equivalence classes of elements of S under
an equivalence relation R is denoted by S ̸ R, i.e., S ̸ R = {[a] : a
∈ S}.
It is known as “quotient” set of S by R.

16.Define the following terms:


(a) Degree of a vertex: It is defined as the number of edges having that
vertex as an end point.
(b) Loop: A graph may have an edge from a vertex to itself, such an edge
is called a “loop”. Degree of a vertex is 2, for a loop since that vertex
serves as both endpoints of the loop.
(c) Isolated vertex: A vertex with “zero” as degree is called an “Isolated
vertex.”
(d) Adjacent vertices: A pair of vertices that determine an edge are
“adjacent” vertices. In the graph shown above, vertex ‘e’ is an
“Isolated vertex”, ‘a’ and ‘b’ are adjacent vertices, vertices ‘a’ and ‘d’
are not adjacent.
17.Define the following terms with reference to a graph.
(a) Path: A path in a graph G consists of a pair (V, E) of sequences.
(b) Circuit: A circuit is a path that begins and ends at the same vertex.
(c) Simple Path: A path is called “simple” if no vertex appears more than
once in the vertex sequence.
18.Define the following terms with reference to a graph.
(a) Connected graph: A graph is called “connected” if there is a path from
any vertex to any other vertex in the graph, otherwise, the graph is
“disconnected”. The figures below are examples of connected graphs.

(b) Components of a graph: If the graph is disconnected, the various


connected pieces are called the “components” of the graph.
(c) Walk of a graph: A “walk” is a sequence of edges, where the finish
vertex of each edge is the start vertex of the next edge.

(d) Directed graph: The graph is said to be a “directed graph” if it has


arrows instead of lines.
19.Define the following terms with reference to a graph.
(a) Outdegree: The number of arrows pointing from a particular node is
the “outdegree” of that node.
(b) Indegree: The number of arrows pointing to a particular node is the
“indegree”.
20.How will you define the following:
(a) String: A “string” over an alphabet is a finite sequence of symbols
from that alphabet, which is usually written next to one another and
not separated by commas.
(i) If Σa = {0, 1} then 001001 is a string over Σa.
(ii) If Σb = {a, b, …, z) then axyrpqstcd is a string over Σb.
(b) Alphabet in languages: It is defined as a finite set of symbols.
Example: Roman alphabet {a, b, ...... z}.
“Binary Alphabet” {0, 1} is pertinent to the theory of computation.
21.How do you define the length of a string?
The “length” of a string is its length as a sequence. The length of a string
w is written as |w|.
Example: |10011| = 5
22.Define the following in respect of languages.

This is denoted by ∈. The empty string plays the role of 0 in a number


(a) Empty string: The string of zero length is called the “empty string”.

system.
(b) Reverse string: If w = w1, w2, … wn where each wi ∈ Σi the reverse of w
is wn wn-1 … w1.
(c) Substring: z is a substring of w if z appears consecutively within w. As
an example, ‘deck’ is a substring of ‘abcdeckabcjkl’.
(d) Concatenation: Assume a string x of length m and string y of length n,
the concatenation of x and y is written xy, which is the string obtained
by appending y to the end of x, as in x1 x2 … xm y1 y2 … yn.

23.What do you mean by lexicographic ordering of strings?


The Lexicographic ordering of strings is the same as the dictionary
ordering, except that shorter strings precede longer strings.
The lexicographic ordering of all strings over the alphabet {0, 1} is (∈, 0,
1, 00, 01, 10, 11, 000, …).
24.What do you mean by prefix and suffix of a string?
(a) Suffix: If w = xv for some x, then v is a suffix of w.
(b) Prefix: If w = vy for some y, then v is a prefix of w.

You might also like