IAE Academy

GATE 2026 CS1 Q.12: solution and answer

GATE 2026 · CS1Q.12 · 1 mark · MCQ

Consider matrices with their elements from . The number of such matrices with even number of s in every row and every column is

  1. (A)

    512

  2. (B)

    1025

  3. (C)

    1023

  4. (D)

    255

See the question in the paper

Answer and solution

ANSWER

The number of such matrices is , which is option (A).

Official answer: ASource: Official answer key, GATE 2026 CS1 (IIT Guwahati)

  1. Every row sum and every column sum must be even, that is .

  2. Fill the top-left block with any entries from . It has cells, so there are choices.

  3. Entries are each forced: each is the parity bit that makes its own row sum even.

  4. Entries are each forced the same way: each is the parity bit that makes its own column sum even.

  5. Choose so that row has an even sum. Then rows to are all even, so the sum of all entries is even. The first three columns each have an even sum, so column has sum , which is even. So this one choice of satisfies row and column together.

  6. Hence every choice of the block extends to exactly one valid matrix. Conversely, any valid matrix is fixed by its top-left block, because all the other entries were forced above. Distinct blocks give distinct matrices.

  7. Count . Check on a matrix: the formula gives , and the valid matrices are the all-zero matrix and the all-one matrix. This agrees.

KEY IDEA

Parity constraints on all rows and columns are fixed by the free top-left block. The last row and last column are forced, and the corner is consistent automatically. The count is .

WATCH OUT FOR

Counting the corner as a separate free or doubly constrained choice, or treating the row and column constraints as independent and getting . The constraints are not independent, because the sum of all row parities equals the sum of all column parities. Only are independent, so the count is .

From the GATE 2026 CS1 paper. Every question of this paper · Download the full paper · All 6 Counting questions, with notes

More Counting questions