As we know that if a lines makes angles a , b and c with X-axis , Y-axis and Z-axis respectively then direction cosines are given by < cos a , cos b ,cos c >
In our case line is X-axis itself which we know makes angle of 0 , 90 , 90 with X-axis , Y-axis and Z-axis respectively then direction cosine will be
<cos 0 , cos 90, cos 90>
= < 1 0 0 >
The number of elements in a 3 X 3 matrix is the product 3 X 3=9.
Each element can either be a 0 or a 1.
Given this, the total possible matrices that can be selected is 29=512