All 12 questions UPSC has asked on number systems and data representation in the Mathematics Optional (Paper II, Numerical Analysis and Computer Programming) from 2009 to 2026, solved step by step – latest first.
Try them yourself first: the same questions, without solutions, are on our Numerical Analysis and Computer Programming topic-wise PYQs page.
How we check these solutions
These are our own solutions, prepared with AI help. UPSC does not publish official answers. Every solution is checked a second way before it goes up, and says how:
- ✓ Checked by computer the answer was worked out again independently with Python: each iteration, table or conversion was run again in double precision (or exact fractions), and algorithms were run on test equations.
- ✓ Proof checked step by step for “prove that” questions, every step was checked against the definitions.
Spotted a mistake or a neater method? Tell us in the comments below or through Report an error.
Jump to a question (year · question number):
2026 · 6b(i) 2026 · 6b(ii) 2025 · 5c 2024 · 5c 2023 · 5c 2022 · 5c 2021 · 5c 2019 · 6b 2018 · 6b 2016 · 5d 2011 · 5d 2009 · 5d(ii)
Find the decimal equivalent of the following floating point 10-bit numbers with 5 bits as fractional part : 1010111011 and 0100101010.
Solution
With 5 of the 10 bits after the binary point, each number is read as .
(a) 1010111011 : (b) 0100101010 : If the leading bit is a sign bit (sign-magnitude, 1 = negative), the first number is and the second (sign bit 0) is .
✓ Checked by computer We checked by computer: and .
Evaluate and convert the final result in hexadecimal system.
Solution
Convert everything to decimal first.
- (already decimal).
- .
- .
To hexadecimal. Integer part by repeated division by 16:
| Divide by 16 | Quotient | Remainder |
|---|---|---|
| 11073 | 692 | 1 |
| 692 | 43 | 4 |
| 43 | 2 | B (11) |
| 2 | 0 | 2 |
So . Fraction by repeated multiplication by 16:
| Fraction × 16 | Product | Integer part |
|---|---|---|
| 0.4136 × 16 | 6.6176 | 6 |
| 0.6176 × 16 | 9.8816 | 9 |
| 0.8816 × 16 | 14.1056 | E (14) |
| 0.1056 × 16 | 1.6896 | 1 |
| 0.6896 × 16 | 11.0336 | B (11) |
| 0.0336 × 16 | 0.5376 | 0 |
The fraction does not terminate. Hence Note. The first number has only the digits 0 and 1 and is very likely meant to be binary, . Then the sum is , and exactly.
✓ Checked by computer We checked by computer: the sum is ; reading the first number as binary instead gives exactly .
(i) Convert the number into binary system and the number into decimal system. (ii) Determine the truth table for the Boolean function Also derive the full disjunctive normal form of from the truth table.
Solution
(i) to binary. Repeated division by 2:
| Divide by 2 | Quotient | Remainder |
|---|---|---|
| 3479 | 1739 | 1 |
| 1739 | 869 | 1 |
| 869 | 434 | 1 |
| 434 | 217 | 0 |
| 217 | 108 | 1 |
| 108 | 54 | 0 |
| 54 | 27 | 0 |
| 27 | 13 | 1 |
| 13 | 6 | 1 |
| 6 | 3 | 0 |
| 3 | 1 | 1 |
| 1 | 0 | 1 |
Reading the remainders from the bottom up, (Check: .)
to decimal. , , :
(ii) Truth table for :
| 0 | 0 | 0 | 1 | 1 | 1 |
| 0 | 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 | 1 |
| 0 | 1 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 | 1 | 1 |
| 1 | 1 | 0 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 | 0 | 0 |
Full disjunctive normal form. Take one minterm for each row with : (As a check: exactly when (first factor 0) or (second factor 0), i.e. rows 1, 6, 7.)
✓ Checked by computer We checked by computer: , , and the truth table of has 1s exactly in rows 0, 2, 3, 4, 5.
(i) Determine the decimal equivalent in sign magnitude form of and . (ii) Determine the decimal equivalent of .
Solution
(i) Sign-magnitude form. In an 8-bit sign-magnitude number the leftmost bit is the sign (1 = negative) and the other 7 bits give the magnitude.
- : sign bit 1, magnitude , so the value is .
- : sign bit 1, magnitude , so the value is .
(ii) , :
✓ Checked by computer We checked by computer: , , and .
Evaluate, using the binary arithmetic, the following numbers in their given system : (i) (ii)
Solution
Write each octal digit as 3 bits and each hexadecimal digit as 4 bits, subtract in binary (borrowing as in decimal), and regroup.
(i) Subtracting bit by bit: Regrouping in threes: .
(ii) (The fraction is smaller than , so a 1 is borrowed from the integer part.) Regrouping in fours: .
Check in decimal.
✓ Checked by computer We checked by computer, in decimal: the first difference is and the second is .
(i) Convert the number into octal and the number into hexadecimal systems. (ii) Express the Boolean function in a product of maxterms form.
Solution
(i) to octal.
| Divide by 8 | Quotient | Remainder |
|---|---|---|
| 1093 | 136 | 5 |
| 136 | 17 | 0 |
| 17 | 2 | 1 |
| 2 | 0 | 2 |
| Fraction × 8 | Product | Integer part |
|---|---|---|
| 0.21875 × 8 | 1.75 | 1 |
| 0.75 × 8 | 6 | 6 |
The fraction terminates, so (Check: .)
to hexadecimal.
| Divide by 16 | Quotient | Remainder |
|---|---|---|
| 1693 | 105 | D (13) |
| 105 | 6 | 9 |
| 6 | 0 | 6 |
| Fraction × 16 | Product | Integer part |
|---|---|---|
| 0.0628 × 16 | 1.0048 | 1 |
| 0.0048 × 16 | 0.0768 | 0 |
| 0.0768 × 16 | 1.2288 | 1 |
| 0.2288 × 16 | 3.6608 | 3 |
| 0.6608 × 16 | 10.5728 | A (10) |
The fraction does not terminate:
(ii) Product of maxterms for . for : rows (minterms 6, 7); for : rows (minterms 1, 3). So and in rows 0, 2, 4, 5. Each zero row gives a maxterm (a variable appears uncomplemented where it is 0):
✓ Checked by computer We checked by computer: , , and is 0 exactly in rows 0, 2, 4, 5.
(i) Convert into octal and hexadecimal equivalents. (ii) Obtain the principal conjunctive normal form of .
Solution
(i) . Integer part to octal and to hexadecimal:
| Divide by 8 | Quotient | Remainder |
|---|---|---|
| 3798 | 474 | 6 |
| 474 | 59 | 2 |
| 59 | 7 | 3 |
| 7 | 0 | 7 |
| Divide by 16 | Quotient | Remainder |
|---|---|---|
| 3798 | 237 | 6 |
| 237 | 14 | D (13) |
| 14 | 0 | E (14) |
So .
Fraction to octal (×8) and to hexadecimal (×16):
| Fraction × 8 | Product | Integer part |
|---|---|---|
| 0.3875 × 8 | 3.1 | 3 |
| 0.1 × 8 | 0.8 | 0 |
| 0.8 × 8 | 6.4 | 6 |
| 0.4 × 8 | 3.2 | 3 |
| 0.2 × 8 | 1.6 | 1 |
| 0.6 × 8 | 4.8 | 4 |
| 0.8 × 8 | 6.4 | 6 |
| 0.4 × 8 | 3.2 | 3 |
| Fraction × 16 | Product | Integer part |
|---|---|---|
| 0.3875 × 16 | 6.2 | 6 |
| 0.2 × 16 | 3.2 | 3 |
| 0.2 × 16 | 3.2 | 3 |
| 0.2 × 16 | 3.2 | 3 |
In octal the digits repeat; in hexadecimal the digit 3 repeats. Hence
(ii) Principal conjunctive normal form. , and is true when have the same value.
| Formula | |||||
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 0 |
| 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 | 0 | 0 |
| 1 | 0 | 0 | 1 | 0 | 0 |
| 1 | 0 | 1 | 1 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 1 | 1 |
The formula is false in rows . Each false row gives a maxterm, so the PCNF is
✓ Checked by computer We checked by computer: , the fraction gives the repeating digits shown, and the formula is false in exactly the five rows used.
Find the equivalent numbers given in a specified number to the system mentioned against them : (i) Integer 524 in binary system. (ii) to octal system. (iii) decimal number 5280 to hexadecimal system. (iv) Find the unknown number .
Solution
(i) 524 to binary.
| Divide by 2 | Quotient | Remainder |
|---|---|---|
| 524 | 262 | 0 |
| 262 | 131 | 0 |
| 131 | 65 | 1 |
| 65 | 32 | 1 |
| 32 | 16 | 0 |
| 16 | 8 | 0 |
| 8 | 4 | 0 |
| 4 | 2 | 0 |
| 2 | 1 | 0 |
| 1 | 0 | 1 |
(ii) Binary to octal. Group in threes from the binary point outwards: (iii) 5280 to hexadecimal.
| Divide by 16 | Quotient | Remainder |
|---|---|---|
| 5280 | 330 | 0 |
| 330 | 20 | A (10) |
| 20 | 1 | 4 |
| 1 | 0 | 1 |
(iv) to decimal.
✓ Checked by computer We checked by computer: , , , .
Find the equivalent of numbers given in a specified number system to the system mentioned against them. (i) to decimal system (ii) to hexadecimal system (iii) to decimal system (iv) to binary system.
Solution
(i)
(ii) Group in fours from the binary point outwards (padding with zeros): (iii) , : (iv) 418 to binary.
| Divide by 2 | Quotient | Remainder |
|---|---|---|
| 418 | 209 | 0 |
| 209 | 104 | 1 |
| 104 | 52 | 0 |
| 52 | 26 | 0 |
| 26 | 13 | 0 |
| 13 | 6 | 1 |
| 6 | 3 | 0 |
| 3 | 1 | 1 |
| 1 | 0 | 1 |
✓ Checked by computer We checked by computer: , the binary number is , , .
Convert the following decimal numbers to equivalent binary and hexadecimal numbers : (i) (ii) (iii)
Solution
(i) 4096. , so (ii) 0.4375. Repeated multiplication by 2:
- → 0
- → 1
- → 1
- → 1
So ; grouping in fours, (also ).
(iii) 2048.0625. and . Hence
✓ Checked by computer We checked by computer: , , .
(i) Compute to the base 8. (ii) Let be an arbitrary but fixed Boolean algebra with operations , and and the zero and the unit element denoted by 0 and 1 respectively. Let be elements of . If be such that and then prove that .
Solution
(i) Repeated division by 8:
| Divide by 8 | Quotient | Remainder |
|---|---|---|
| 3205 | 400 | 5 |
| 400 | 50 | 0 |
| 50 | 6 | 2 |
| 6 | 0 | 6 |
(Check: .)
(ii) The complement is unique. By definition satisfies and . Suppose also and . Then (using, in turn, the identity law, , the distributive law and ). In the same way, using and : Since is commutative, , so .
✓ Proof checked step by step We checked each step against the Boolean algebra axioms (identity, complement, distributive and commutative laws); was checked by computer.
Find the decimal equivalent of .
Solution
✓ Checked by computer We checked by computer: .
More on Numerical Analysis and Computer Programming
- Numerical Analysis and Computer Programming topic-wise PYQs (questions only, for practice)
- Mathematics PYQ analysis: which units carry the marks year by year
- Year-wise question papers
- Mathematics booklist
Questions: UPSC Civil Services (Main) Examination, Mathematics Paper II, 2009–2026. Solutions: Optional Province. Found an error? Tell us.

