When two matrices (of same order) are equal then their corresponding entries are equal.
Here \(\begin{bmatrix} p^2 -1 & \ 0 &-31 - q^3 \\[0.3em] 7 &r + 1& 9\\[0.3em] -2 &8 & s - 1 \end{bmatrix}\)= \(\begin{bmatrix} 1& \ 0 &-4 \\[0.3em] 7 &3/2& 9\\[0.3em] -2 &8 & π \end{bmatrix}\)
⇒ p2 – 1 = 1
⇒ p2 = 1 + 1 = 2
p = ± √2
-31 – q3 = -4
-q3 = -4 + 31 = 27
q3 = -27 = (-3)3
⇒ q = -3
r + 1 = 3/2
⇒ r = 3/2 – 1 = 3 - 2/2 = 1/2
s – 1 = π
⇒ s = – π + 1 (i.e.,) s = 1 – π
So, p = ± √2, q = -3, r = 1/2 and s = 1 – π