Consider 4 × 4 matrices with their elements from {0, 1}. The number of such matrices with even number of 1s in every row and every column is
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2026 Set 1 · Q12
Time
Select one answerSingle correct
Solution
Official answer: A) 512
Discrete MathematicsLet the matrix be of size with and entries in .
The condition that each row and each column contains an even number of s is equivalent to saying that the sum of entries in each row and each column is .
For the upper-left submatrix (i.e., size ), each entry can be chosen independently as either or . There are entries, giving ways.
Once the first entries of the first rows are chosen:
The last element of each of the first rows (i.e., for ) is uniquely determined by the parity requirement of row .
The last element of each of the first columns (i.e., for ) is uniquely determined by the parity requirement of column .
The bottom-right entry is then uniquely determined to satisfy the parity of the 4th row (which automatically satisfies the parity of the 4th column as well, since the sum of all elements modulo 2 must be consistent).
Therefore, the total number of valid matrices is:
Hence, the correct option is (A).
Try the question first, then check your work.
Examiner trap
Consider the parity of the elements in . How many entries can you choose freely before the rest are forced by the even parity constraints?
This Discrete Mathematics previous year question is Q12 of the GATE CSE 2026 Set 1 paper. Find more GATE CSE PYQs on Discrete Mathematics in Engineering Mathematics, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Discrete Mathematics PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
Discrete Mathematics has 50 GATE CSE PYQs across 23 papers from 2011 to 2026. 18 of them are 1-mark MCQs like this one, and GATE CSE 2026 Set 1 has 3.
How GATE tests Discrete MathematicsIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.