If matrix \[X = \begin{bmatrix} a & 1 \\ -a^2+a-1 & 1-a \end{bmatrix}\] and \(X^2 - X + I = O\) (\(I\) is the identity matrix and \(O\) is the zero matrix), then the inverse of \(X\) is
A
\[\begin{bmatrix} 1-a &-1 \\ a^2& a \end{bmatrix}\]
B
\[\begin{bmatrix} 1-a &-1 \\ a^2-a+1& a \end{bmatrix}\]
C
\[\begin{bmatrix} -a &1 \\ -a^2+a-1& 1-a \end{bmatrix}\]
D
\[\begin{bmatrix} a^2-a+1 &a \\ 1& 1-a \end{bmatrix}\]
Show the worked solution\[X^2-X+I=O\ \Rightarrow\ X(I-X)=I\ \Rightarrow\ \boxed{X^{-1}=I-X}\]\[I-X=\begin{bmatrix}1-a&-1\\a^2-a+1&a\end{bmatrix}.\]Answer: B
GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com