Sie sind auf Seite 1von 8

ASSIGNMENT NO 01/02

NAME REG NO LEARNING CENTRE COURSE SUBJECT SANTOSH KUMAR MUKHLAL 511137386 151 BCA FUNDAMENTALS OF THEORY OF COMPUTER SCIENCE SEMESTER FIFTH SEMESTER MODULE NO BC0052 DATE OF SUBMISSION 31 DEC 2012 MARKS AWARDED

Question 1 :Show that the relation a b(mod m) is an equivalence relation. Answer 1: Solution: Let a Z. Reflexive: Since n divides a - a = 0, we have a a mod m. Symmetric: Let a b mod m. => m divides a - b => m divides - (a - b) => m divides b - a => b a mod m. Transitivity: Let a, b, c Z such that a b mod n, b c mod m. => m divides a - b, and m divides b - c => m divides ( a - b ) + ( b - c) => m divides a - c => a c mod m. Hence the relation is an equivalence relation. Example Suppose m = 5. Then [0] = {x / x 0 mod 5} = {x / 5 divides x 0 = x} = {, -10, -5, 0, 5, 10, } [1] = {x / x 1 mod 5} = {x / 5 divides x - 1}= {, -9, -4, 1, 6, } [2] = {x / x 2 mod 5} = {x / 5 divides x -2} = {, -8, -3, 2, 7, 12, } [3] = {x / x 3 mod 5} = { x / 5 divides x -3} = {, -7, -2, 3, 8, 13, } [4] = {x / x 4 mod 5} = { x / 5 divides x - 4} = {, -6, -1, 4, 9, 14, } Also it is clear that [0] = [5] = [10] = [1] = [6] = [11] = [2] = [7] = [12] = [3] = [8] = [13] = [4] = [9] = [14] = Therefore the set of equivalence classes is given by {[0], [1], [2], [3], [4]}. Question 2 : Using the definition of order show that is .x2 + 2x + 1 is O(x2) Answer 2: Solution: The functions f and g referred to in the definition of O-notation are defined as follows. For all real numbers x, f(x) = x2 + 2x + 1 and g(x) = x2

Example Use the definition of order to show that 5x3 3x + 4 is O(x3). Solution: The functions f and g referred to in the definition of O-notation are defined as follows.

Question 3 : Prove by the method of contradiction that 2 is not a rational number. Answer 3 Solution: A rational number is of the form p/q where, q 0 and p, q are not having any common factors. Assume that 2 is a rational number. So it can be written as

If p is even, then it can be written as p = 2k. Therefore 4k2 = 2q2. Therefore q is even. This is a contradiction to our assumption that p and q have no common factors. Therefore 2 is not a rational number. Example

Give a proof by contradiction of if 3n + 2 is odd, then n is odd. Solution: Let p: 3n+2 is odd q: n is odd. To construct a proof by contradiction, assume that both p and ~ q are true. That is, assume that 3n + 2 is odd and that n is not odd. Since n is not odd, it is even. Now we can show that if n is even, then 3n + 2 is even. (Verification: n is even n = 2k for some integer k. Substituting 2k for n, we get 3n + 2 = 3(2k) + 2 = 6k + 2 = 2(3k + 1) 3n + 2 is even). Now the statement 3n + 2 is even is ~ p. Now since p and ~ p are true, we have a contradiction. This completes the proof by contradiction, proving that if 3n + 2 is odd, then n is odd. Question 4: Prove by mathematical induction 12+ 22 + 32 + . + n2 = n (n + 1)(2n + 1) 6 Answer 4 Solution: (i) Base Step: Let n = 0. Then the sum on the left is zero, since there is nothing to add. The expression on the right is also zero. If n=1, left side. = 12=1.

Therefore the result is true for n = m+1 . Hence by mathematical induction the given result is true for all positive integers n.

Question 5 : Prove that The sum of the degrees of the vertices of a graph G is twice the number of edges Answer 5

Question 6 : Prove that T is a tree there is one and only one path between every pair of vertices. Answer 6 Solution: Part 1: Suppose T is a tree. Then T is a connected graph and contains no circuits. Since T is connected, there exists at least one path between every pair of vertices in T. Suppose that between two vertices a and b of T, there are two distinct paths. Now, the union of these two paths will contain a circuit in T, a contradiction (since T contains no circuits). This shows that there exists one and only one path between a given pair of vertices in T. Part 2: Let G be a graph. Assume that there is one and only one path between every pair of vertices in G. This shows that G is connected. If possible suppose that G contains a circuit. Then there is at least one pair of vertices a, b such that there are two distinct paths between a and b. But this is a contradiction to our assumption. So G contains no circuits. Thus G is a tree.

Das könnte Ihnen auch gefallen