Let A be a 3×3 matrix having entries from the set {−1,0,1}. The number of all such matrices A having sum of all entries equal to 5 is
Answer: 414
Solutions · 1
Official solution
Let p entries be 1, q entries be −1, and 9−p−q entries be 0, with p−q=5 and 0≤p,q, p+q≤9.
Possible (p,q): (5,0),(6,1),(7,2),(8,3),(9,4) --- but p+q≤9 excludes (9,4) (sum 13>9), leaving (5,0),(6,1),(7,2),(8,3).
Number of arrangements for each: p!q!(9−p−q)!9!:
- (5,0): 5!0!4!9!=126
- (6,1): 6!1!2!9!=252
- (7,2): 7!2!0!9!=36
- (8,3): exceeds 9 entries (8+3=11>9), not valid.
Total =126+252+36=414.