GATE / CS ARCHIVE

GATE CSE 2001 / QUESTION 4(b)

Surjectivity of an integer pairing map

Discrete Mathematics · Sets, Relations & Functions · Full GATE CSE 2001 paper

GATE 2001, Q4(b) Descriptive
Report issue

Sets, Relations & Functions

Question 4(b), GATE 2001: N={0,1,2,…}; h:N×N→N is h(a,b)=(2a+1)2^b−1.

Task: Prove that h is surjective.
Question 4(b), GATE 2001: N={0,1,2,…}; h:N×N→N is h(a,b)=(2a+1)2^b−1.

Task: Prove that h is surjective.
Tap to enlarge
Shared context

N={0,1,2,…}; h:N×N→N is h(a,b)=(2a+1)2^b−1.

Answer & solution

Answer: For n≥0, write n+1=u2^b with u odd; its preimage is ((u−1)/2,b). (no official key was published)

1. Take an arbitrary target n∈N. The positive integer n+1 can be repeatedly divided by 2 until an odd number u remains. This terminates because positive integers strictly decrease at each division.

2. If b divisions were made, then n+1=u2b, with b≥0 and u≥1 odd. Define a=(u−1)/2, which is a nonnegative integer.

3. Then h(a,b)=(2a+1)2b−1=u2b−1=n. Thus every target has a preimage in N×N, establishing surjectivity.

4. For example n=11 gives n+1=12=3·2², so (a,b)=(1,2). For n=0 the preimage is (0,0). Combined with injectivity, h is a bijection.

Original paper, page 7