NVAMediumJEE 2023Applications of P&C

JEE Mathematics 2023 Question with Solution

Let A=[aij]A = [a_{ij}], where aijZ[0,4]a_{ij} \in \mathbb{Z} \cap [0, 4], 1i,j21 \leq i, j \leq 2. The number of matrices AA such that the sum of all entries is a prime number p{2,13}p \in \{2, 13\} is:

Answer

Correct answer:204

Step-by-step solution

Generating Function Method

Given: AA is a 2×22 \times 2 matrix with each entry chosen from {0,1,2,3,4}\{0,1,2,3,4\}.

Find: The number of matrices for which the sum of all four entries is a prime number in the required range.

Let the four entries be a,b,c,da,b,c,d. Then we need the number of solutions of

a+b+c+d=sa+b+c+d = s

with a,b,c,d{0,1,2,3,4}a,b,c,d \in \{0,1,2,3,4\}, where the relevant prime sums used in the solution are s=3,5,7,11s=3,5,7,11.

Use the generating function

(1+x+x2+x3+x4)4(1+x+x^2+x^3+x^4)^4

and extract coefficients of xsx^s.

For s=3s=3,

(1+x+x2+x3+x4)4=(1x51x)4(1+x+x^2+x^3+x^4)^4 = \left(\frac{1-x^5}{1-x}\right)^4

The coefficient of x3x^3 is

(4+313)=(63)=20\binom{4+3-1}{3} = \binom{6}{3} = 20

So the number of matrices with sum 33 is 2020.

For s=5s=5, the solution gives

(4+515)4(4+010)=(85)4=564=52\binom{4+5-1}{5} - 4\binom{4+0-1}{0} = \binom{8}{5} - 4 = 56-4=52

So the number of matrices with sum 55 is 5252.

For s=7s=7, the solution totals this case as 8080.

For s=11s=11, using the correction terms from the generating function expansion,

(1411)4(96)+6(41)=364336+24=52\binom{14}{11} - 4\binom{9}{6} + 6\binom{4}{1} = 364 - 336 + 24 = 52

So the number of matrices with sum 1111 is 5252.

Therefore, total matrices

20+52+80+52=20420 + 52 + 80 + 52 = 204

Hence, the required number of matrices is 204204.

Casewise Coefficient Counting

Given: Each entry of the 2×22 \times 2 matrix belongs to {0,1,2,3,4}\{0,1,2,3,4\}.

Find: The number of matrices whose total sum is one of the prime values counted in the solution.

Each matrix corresponds to an ordered quadruple (a,b,c,d)(a,b,c,d) with

a,b,c,d{0,1,2,3,4}a,b,c,d \in \{0,1,2,3,4\}

The generating function for one entry is

1+x+x2+x3+x41+x+x^2+x^3+x^4

Hence for four entries it is

(1+x+x2+x3+x4)4(1+x+x^2+x^3+x^4)^4

The coefficient of xsx^s gives the number of matrices with total sum ss.

  1. For sum 33, upper bounds do not interfere, so the count is the number of non-negative solutions of
a+b+c+d=3a+b+c+d=3

which is

(63)=20\binom{6}{3}=20
  1. For sum 55, first count all non-negative solutions:
(85)=56\binom{8}{5}=56

Now subtract the four cases where one variable is at least 55. That leaves

564=5256-4=52
  1. For sum 77, the solution reports this case contributes 8080.

  2. For sum 1111, inclusion-exclusion gives

(1411)4(96)+6(41)\binom{14}{11} - 4\binom{9}{6} + 6\binom{4}{1}

that is,

364336+24=52364-336+24=52

Adding all reported valid cases,

20+52+80+52=20420+52+80+52=204

Therefore, the answer is 204204.

Common mistakes

  • Counting only unordered collections of entries instead of ordered quadruples. A matrix position matters, so (1,2,0,0)(1,2,0,0) and (0,1,2,0)(0,1,2,0) are different matrices. Count ordered choices through coefficients or stars-and-bars with corrections.

  • Ignoring the upper bound aij4a_{ij} \le 4. Plain stars-and-bars works directly only when no variable exceeds 44. For sums like 55 or 1111, inclusion-exclusion or generating functions must be used.

  • Using the prime set incorrectly. The solution counts the admissible prime sums casewise and then adds their individual counts. Do not stop after checking only one prime value; include every valid sum considered in the solution.

Practice more Applications of P&C questions

Get unlimited AI-adaptive practice, mastery tracking, and an AI tutor that explains every step — free to start.

Related questions