On this page
Counting matrices built from a small set of allowed numbers is a classic problem in competitive exams like JEE. It tests your grasp of matrix properties alongside basic combinatorics.
How many 3×3 matrices with entries 0 or 1?
A matrix) is a rectangular array of numbers. A 3×3 matrix has exactly 9 positions (3 rows and 3 columns). When building such a matrix, you must make a choice for each of these 9 positions.
Since the allowed entries are only 0 or 1, you have exactly 2 options for every single spot. The rule of product in combinatorics states that you multiply the number of choices for each independent event.
Because you make 9 independent choices, you calculate 2 × 2 × 2 ... (nine times). This equals 2⁹, which is 512. Therefore, there are 512 distinct matrices of this type.
When you are revising a chapter, checking definitions in the Concept Library can help solidify why these counting principles work across both algebra and probability.
How many of these are symmetric?
A matrix is symmetric if it is identical to its transpose. This means the entry in row *i*, column *j* matches the entry in row *j*, column *i*.
Because of this mirror reflection across the main diagonal, you do not get to choose all 9 entries independently.
The 3 entries on the main diagonal can be chosen freely.
The 3 entries above the diagonal can be chosen freely.
The 3 entries below the diagonal must perfectly copy the ones above it.
This leaves you with 6 independent choices. With 2 options for each, the total number of symmetric matrices is 2⁶ = 64.
How many have a specific trace?
The trace of a matrix is the sum of its main diagonal elements. In our 3×3 matrix, there are three diagonal elements, each being 0 or 1. Their sum can therefore be 0, 1, 2, or 3.
How many matrices have a trace of exactly 1?
To get a trace of 1, exactly one of the three diagonal elements must be 1, and the other two must be 0. There are 3 ways to arrange this (1,0,0 or 0,1,0 or 0,0,1). The other 6 off-diagonal entries are completely free, so there are 2⁶ = 64 ways to fill them. Multiplying these together, there are 3 × 64 = 192 matrices with a trace of 1.
How many matrices have a trace of exactly 2?
To achieve a trace of 2, you need two 1s and one 0 on the main diagonal. Using combinations, choosing which two spots get the 1s is "3 choose 2", which equals 3 ways (1,1,0 or 1,0,1 or 0,1,1). The 6 off-diagonal entries remain completely independent, offering 2⁶ = 64 variations for each diagonal arrangement. Thus, 3 × 64 = 192 matrices have a trace of 2.
How many matrices have a trace of exactly 0 or 3?
A trace of 0 is only possible if all three diagonal entries are 0 (1 way). With the 64 ways to fill the rest of the matrix, you get 1 × 64 = 64 matrices. Similarly, a trace of 3 means all three diagonal entries are 1. That can also only happen in 1 way, giving another 64 matrices. If you sum up all the trace cases (64 + 192 + 192 + 64), they perfectly add up to 512, proving our initial calculation.
What if the entries come from a larger set?
Once you grasp the logic, you can apply it to any number of allowed entries. This combinatorial logic is the same principle you use when calculating Sums of binomial coefficients: C₀ + C₁ + … and alternating sums and other counting problems like With and without replacement: probability problems compared.
If a question asks for a 3×3 matrix where the entries can be drawn from the set {0, 1, 2, 3, 4}, you now have 5 choices per position instead of 2.
The total number of matrices is 5⁹ (which is 1,953,125).
The number of symmetric matrices is 5⁶ (which is 15,625).
Consider a scenario where the entries must be chosen from the set {-1, 0, 1}. Now there are 3 valid entries. For the total number of general matrices, you have 3 choices for each of the 9 positions, resulting in 3⁹ = 19,683 possible matrices. For symmetric matrices with these three entries, you have 6 independent positions, giving 3⁶ = 729 symmetric matrices.
If you get stuck trying to adapt a formula to a new condition, the Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer. For more on matrix mathematics, see Finding Aⁿ for a matrix by spotting the pattern.



