Vous êtes sur la page 1sur 2



Tutorial - 06 

CSE-121

Tuesday

Discrete Mathematics

29/09/2015

1. Show that if n + 1 numbers are selected from the set 1, 2, 3, . . . , 2n, one of these will divide a second
one of them.
2. Given a sequence of p integers a1 , a2 , . . . , ap , show that there exists consecutive terms in the sequence
whose sum is divisible by p. That is, show that there are i and j, with 1 i j p, such that
ai + ai+1 + . . . + aj is divisible by p.
3. A person starts from the origin O(0, 0) in the X-Y plane. He takes steps of one unit along the positive
X-axis or the positive Y-axis. Travelling in this manner, find the total number of ways he can reach
A(9, 6) avoiding both the points P (3, 3) and Q(6, 4).

A
Q
P

4. A party is attended by n persons and every party-goer leaves his hat at the counter. In how many
ways can the hats be given back so that nobody receives his own hat ?
5. There are n necklaces such that the first necklace contains 5 beeds, the second necklace contains 7
beeds, and in general the ith necklace contains i beeds more than the number of beeds in the (i 1)st
necklace. Find the total numbers of beeds in all the n necklaces.
6. (Coding Theory). Messages, in the form of bit-strings, are encoded by translating them into longer
bit-strings, called codewords. A set of codewords is called a code. The Hamming distance d(x, y)
between the bit-strings x = x1 x2 . . . xn and y = y1 y2 . . . yn is the number of positions in which these
strings differ, i.e., the number of i (i = 1, 2, . . . , n) for which xi 6= yi .
Suppose that we have a set of codewords (all of the same length). Suppose that all the smallest
distance between two of these codewords is d. Then we can detect al errors of d 1 or fewer digits.
Suppose we use the strategy that if we receive a word which is not a codeword, we interpret it as the
1

codeword to which it is closest in terms of Hamming distance. (In case of tie, choose arbitrarily). This
is called the nearest neighbor rule. For example, if the codewords are 000000, 010101, 101010, and
111111, and we receive the word 010000, we would interpret it as 000000, since d(010000, 000000) = 1
whereas for every other codeword , d(010000, ) > 1. Using the nearest-neighbor rule, we can correct all errors that involve fewer than d/2 digits. Hence, we have an error-correcting code.
In summary, the above statement follows as : Suppose that d is the minimum (Hamming) distance
between two codewords in a binary code C. Then the code C can detect up to d 1 errors and,
using the nearest-neighbor rule, can detect up to d(d/2) 1e errors.
Prove. Suppose that d is the minimum (Hamming) distance between two codewords in a binary
code C. Then no error-detecting rule can detect mor than d 1 errors and no error-correcting rule
can correct more than d(d/2) 1e errors.
t
u

Vous aimerez peut-être aussi