JEE Main 2023 · 31 January · evening · Numerical answer · +4 / −0

Let A=[aᵢⱼ], aᵢⱼ ∈ ℤ ∩[0,4], 1 ≤ i, j ≤ 2.
The number of matrices A such that the sum of all entries is a prime number p ∈(2,13) is __________.

Answer and solution

Answer 204

Solution

Maths sir · 3 steps

Four entries, each from 0 to 4: count the ways to make each prime sum, then add.

  1. Set it up. Call the entries a, b, c, d, each an integer from 0 to 4. The primes strictly between 2 and 13 are 3, 5, 7 and 11. So for each s we count solutions of a+b+c+d = s with 0 ≤ a, b, c, d ≤ 4.

    N(s) = C(s+3, 3) - C(4, 1)C(s-2, 3) + C(4, 2)C(s-7, 3)

  2. Remove overshoots. C(s+3, 3) counts all non-negative solutions. If one entry is 5 or more, subtract 5 from it and count again. There are 4 choices of entry, which gives C(s-2, 3) each. Two entries can both exceed 4 only when s ≥ 10, and those cases are added back. A binomial term is zero when its top number is below 3.
    Sum sWorkingN(s)
    3C(6, 3) = 2020
    5C(8, 3) - 4C(3, 3) = 56 - 452
    7C(10, 3) - 4C(5, 3) = 120 - 4080
    11C(14, 3) - 4C(9, 3) + 6C(4, 3) = 364 - 336 + 2452
  3. So. As a check, N(11) = N(5), because replacing every entry a by 4-a turns a sum of 11 into a sum of 5. The total is 20 + 52 + 80 + 52 = 204.

The common slip: 224. Counting the endpoint 13 as well adds N(13) = 20 and gives 224. The interval (2, 13) is open, so 13 is not included.

The idea to keep. For bounded distributions, use stars and bars and then subtract the cases that break the upper limit. The symmetry s ↔ 4n - s is a quick check on your counts.

Answer from the NTA final answer key. Solution by PrepWiser.

Study Permutations & Combinations

Asked about 160 times in JEE Main since 2020. This question is from 2023.