Académique Documents
Professionnel Documents
Culture Documents
Let a Z.
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]}.
Solution: The functions f and g referred to in the definition of O-notation are defined as follows.
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.
4
BC0052 Theory of Computer Science Set -1
Right Side =
Hence the result is true for n=1
(ii) Induction Hypothesis: Assume that the result to be true for n=m
Then 12 + 22 + + m2 = 12 + 22 + 32 + + m2 + (m + 1)2 =
Adding the (m + 1)th term i.e. (m + 1)2 to both side of the above equation, we get
Therefore the result is true for n = m+1. Hence by mathematical induction the given result is true for all
positive integers n.
5
BC0052 Theory of Computer Science Set -1
5. Prove that The sum of the degrees of the vertices of a graph G is twice the number of
edges
The sum of the degrees of the vertices of a graph G is twice the number of edges. That is, =
= + d (u) + d (v) = 0 + 1 + 1 = 2 = 2 1
= 2 (number of edges).
Remove f from G.
= 2(k - 1).
= + (d(u) - 1) + (d(v) - 1)
= + d(u) + d(v) - 2 = -2
2(k - 1) + 2 = 2k =
Hence by induction we get that the sum of the degrees of the vertices of the graph G is twice the
numbers of edges.
6
BC0052 Theory of Computer Science Set -1
6. Prove that T is a tree there is one and only one path between every pair of vertices
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.