Sie sind auf Seite 1von 6

MC0082 Theory of Computer Science

1. Define the concept of equivalence relation. Give at least two examples of equivalence Relation. Ans Definition. A relation R on a set A is an equivalence relation if and only if R is 1. Reflexive, 2. 3. symmetric, and Transitive.

The definition is motivated by observing that any process of identification must behave somewhat like the equality relation, and the equality relation satisfies the reflexive (x = x for all x), symmetric (x = y implies y = x), and transitive (x = y and y = z implies x = z) properties. Example. 1. Let R be the relation on the set R real numbers defined by xRy i x y is an integer. Prove that R is an equivalence relation on R. Proof. I. Reflexive: Suppose x R. Then x x = 0, which is an integer. Thus, xRx. II. Symmetric: Suppose x, y R and xRy. Then x y is an integer. Since y x = (x y), y x is also an integer. Thus, yRx. III. Suppose x, y R, xRy and yRz. Then x y and y z are integers. Thus, the sum (x y) + (y z) = x z is also an integer, and so xRz. Thus, R is an equivalence relation on R. #

2. Let R be the relation on the set of real numbers R in Example 1. Prove that if xRx ' and yRy' , then (x + y)R(x' + y'). Proof. Suppose xRx ' and yRy '. In order to show that (x+y)R(x'+y'), we must show that (x + y) (x ' + y') is an integer. Since (x + y) (x'+ y') = (x x') + (y y'), and since each of xx ' and y y ' is an integer (by denition of R), (xx') + (y y ') is an integer. Thus, (x + y)R(x ' + y').

2. Prove by Mathematical Induction that ( )

Ans 2
( )

Base Step Let n=0 then the sum of the left side 0 Since there is nothing to add the expression on the right side also is 0 If n=1 then left side is 1 And right side =
( )

Hence the result is true for n=1 Induction Hypothesis Assume that the result to be true for n=m then ( )

Adding the (m+1)tm term i.e. (m+1)3 to both side of the above equation (
( )

+ (m+1)3

+{m2 +4 (m+1)} +{m2 +4m+4} (m +2)2

(m+1)2 (m+2)2
= ___________________

4 There for the result is true for n=m+1. Hence the mathematical induction, the given result is true for all positive integer n.

3. Prove that a graph G is connected if and only if it has a spanning tree. Ans Let G be a connected graph. A spanning tree in G is a subgraph of G that includes all the vertices of G and is also a tree. The edge of the trees are are called branches. For example: -

We can find a spanning tree systematically by using either of two methods 1 Cutting Down Method Start choosing any cycle in G Remove one of cycles edge Repeat this procedure until there is no cycle left. 2 Building up methods Select edges of G one at a time in such a way that no cycles are created Repeat this procedure until all vertices are includes

Theorem a graph G is connected if and only if it has a spanning tree. Proof: - Let G be a connected Graph. Delete edge from G that are not brides until we get a connected subgraph H in which each edge is a bridge. Then H is spanning tree. On the other hand, if there is a spanning tree in G, there is a path between any pair of vertices in G, thus G is connected. 3

4. Prove that a b(modm) is an equivalence relation Ans Modular arithmetic can be handled mathematically by introducing a congruence relation on the integers that is compatible with the operation of the ring of integers addition subtraction and multiplication. For positive integer n two integers a and b is said to be congruent modulo n written:A b (mod n), If their difference a-b is an integer multiple of n. the number n is called the modulus of the congruence. For example: 38 14 (mod 12) Because 38-14 = 24, which is a multiple of 12. Equivalently a b (mod n) can also be thought of as asserting that both a/n and b/n have the same reminder. For instance: - 38 14 (mod 12) because both 38/12 and 14/12 have the same reminder. A remark on the notation: - because it is a common to consider several congruence relation for different module at the same time, the modules that is incorporated in the notation. In spite of the ternary notation, the congruence related for a given modulus is a binary. This would have been clearer if the notation a b had been used, instead of the common traditional notation. The properties that make this relation a congruence relation respecting addition subtraction and multiplication are the following: -

If And Then

a1 b1 (mod n) a2 b2 (mod n) a1 + a2 b1 + b2 (mod n) a1 - a2 b1 b2 (mod n)

it should be noted that the above two properties would still hold if the theory were expanded to include all real numbers, that is if a1, a2, b1, b2, n were not necessarily all integers. The next property however would fail if these variables were not all integers:

a1 a2 b1 b2 (mod n) Similarly a b (mod n) Hence proved

5. Explain the concept of a Transition graph. Ans

Transition System (Transition graph) A finite directed labeled graph in which each node or vertex of the graph represents a state and the directed edges from one node to another represent transition of a state. All the edges of the transition graph are labeled as input/output. For example, an edge labeled 1/0 specifies that for certain initial state if the input is 1, then the output is 0.Consider the following diagram: In the transition graph as shown in the figure, The initial state, q 0 , of the system is represented by a circle with an arrow pointing towards it.The final state, q 1 , is represented by two concentric circles. The directed edges from the initial state to the final state are labeled as input/output.

6. Explain the steps of conversion of Mealy machine into Moore machine Ans Conversion of Mealy Machine into Moore Machine:Following steps Step 1: For a state qi determine the number of different outputs that are available instate table of the Mealy machine. Step 2: If the outputs corresponding to state qi in the next state columns are same, then retain state as it is. Else, break into different states with the number of new states being equal to the number of different outputs of Step 3: Rearrange the states and outputs in the format of a Moore machine. The common output of the new state table can be determined by examining the outputs under the next state columns of the original Mealy machine. Step 4: If the output in the constructed state table corresponding to the initial state is 1, make both the Mealy and Moore machines equivalent, we either need to ignore the output corresponding to the null string or we need to insert a new initial state at the beginning whose output is 0; the other row elements in this case would remain the same.

Das könnte Ihnen auch gefallen