Question

Consider a function f:(0,1)→{0,1}f: (0,1) \rightarrow \{0, 1\} defined as follows.

For a real number r∈(0,1)r \in (0,1), f(r)=1f(r) = 1 if the second digit after the decimal point in rr is one of the four digits 2, 3, 6 and 7. Otherwise, f(r)f(r) is equal to 0.

The number of points in (0,1)(0,1) at which ff is discontinuous is ___________. (answer in integer)

Official answer and solution
Official answer
40
From
Official GATE 2026 answer key

Solution

Identify the interval boundaries in (0,1)(0, 1) where the second decimal digit transitions into or out of {2,3}\{2, 3\} or {6,7}\{6, 7\}.

For each of the 1010 choices of the first decimal digit d1∈{0,1,…,9}d_1 \in \{0, 1, \dots, 9\}, the second decimal digit d2d_2 belongs to {2,3,6,7}\{2, 3, 6, 7\} on two disjoint sub-intervals of [0.d1,0.d1+0.1)[0.d_1, 0.d_1 + 0.1):

  1. [0.d12,  0.d14)[0.d_1 2, \; 0.d_1 4), where d2∈{2,3}d_2 \in \{2, 3\}, which has 2 boundary points (0.d120.d_1 2 and 0.d140.d_1 4).
  2. [0.d16,  0.d18)[0.d_1 6, \; 0.d_1 8), where d2∈{6,7}d_2 \in \{6, 7\}, which has 2 boundary points (0.d160.d_1 6 and 0.d180.d_1 8).

Inside each open interval, ff is constant (11 or 00), and at each of the 44 boundary points per first digit d1d_1, ff jumps between 00 and 11. All 10×4=4010 \times 4 = 40 boundary points lie strictly inside (0,1)(0, 1) (the smallest is 0.020.02 and the largest is 0.980.98). Thus ff is discontinuous at 4040 points.

Final answer

40

Common trap

Counting every single digit transition (2,3,4,6,7,82, 3, 4, 6, 7, 8) without noticing that 22 and 33 are adjacent (f=1f=1 across 0.d130.d_1 3) and 66 and 77 are adjacent (f=1f=1 across 0.d170.d_1 7).

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2026 Computer Science and Information Technology - Session 2 (CS2)
Question
64 of 65
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.