The number of 3-digit numbers such that the digit 1 is never to the immediate right of 2 is A. 781 B. 791 C. 881 D. 891
GATE 2017 · General Aptitude · Combinatorics · medium
Answer: 881
- Total 3-digit numbers: 3-digit numbers range from 100 to 999, giving 900 total numbers
- Count |A|: '21' in positions (1,2): Hundreds digit = 2 (fixed), tens digit = 1 (fixed), units digit = 0-9 (10 choices). |A| = 10.
- Count |B|: '21' in positions (2,3): Hundreds digit = 1-9 (9 choices, cannot be 0), tens digit = 2 (fixed), units digit = 1 (fixed). |B| = 9.
- Count |A intersect B|: '21' in both positions: For '21' in positions (1,2) AND (2,3): hundreds=2, tens=1. But tens must also be 2 for the second pattern — contradiction (tens can't be both 1 and 2). Actually: positions (1,2)='21' means d1=2, d2=1; positions (2,3)='21' means d2=2, d3=1. These require d2=1 and d2=2 simultaneously — impossible. So |A intersect B| = 0.
- Apply inclusion-exclusion and subtract: Forbidden count = 19. Valid numbers = 900 - 19 = 881.