Problems with Solutions¶
Problem 1. \(\,\) Let \(\ \boldsymbol{A}\,=\,[\,a_{ij}\,]_{\,2\times 2}\ \) be an arbitrary square matrix of size two over a field \(\ K.\ \) For \(\ n=2\ \) and \(\ 3\ \) show directly, that the matrix \(\ \boldsymbol{A}\otimes\boldsymbol{I}_n\ \) may be converted into \(\,\boldsymbol{I}_n\otimes\boldsymbol{A}\ \) by means of some transpositions of rows \(\ R_i\ \) associated with the same transpositions of columns \(\ C_j\quad (i,j=1,\ldots,n).\ \) Determine the permutation matrices \(\ \boldsymbol{P}\ \) and \(\ \boldsymbol{Q}\ \) in the relation
Verify that \(\,\boldsymbol{Q} = \boldsymbol{P}^T = \boldsymbol{P}^{-1},\ \) meaning that \(\,\boldsymbol{P}\ \) and \(\,\boldsymbol{Q}\ \) are, \(\,\) respectively, \(\,\) the row and column permutation matrices of the same permutation \(\,\sigma.\ \) Write down \(\,\sigma\,\) in a two-line form.
Solution \(\,\) for \(\,\) \(n=2.\ \)
The transformation of matrix \(\ \boldsymbol{A}\otimes\boldsymbol{I}_2\ \) into \(\ \boldsymbol{I}_2\otimes\boldsymbol{A}\ \) proceeds in one double step:
where \(\ \boldsymbol{P}_{23}\ \) is the matrix of transposition of rows (the second and the third), \(\\\) whilst \(\ \,\boldsymbol{Q}_{23}\ \) is the matrix of transposition of columns (the second and the third). \(\\\) These operations are performed by the following Sage code:
sage: A = matrix([[var("a%d%d" % (k,l)) for l in [1,2]]
for k in [1,2]])
sage: I2 = identity_matrix(2)
sage: AxI2 = A.tensor_product(I2)
sage: P23 = elementary_matrix(4, row1=1, row2=2)
sage: Q23 = elementary_matrix(4, col1=1, col2=2)
sage: I2xA = P23 * AxI2 * Q23
sage: I2xA.subdivide(2,2)
sage: (AxI2, I2xA)
(
[a11 0|a12 0] [a11 a12| 0 0]
[ 0 a11| 0 a12] [a21 a22| 0 0]
[-------+-------] [-------+-------]
[a21 0|a22 0] [ 0 0|a11 a12]
[ 0 a21| 0 a22], [ 0 0|a21 a22]
)
Solution \(\,\) for \(\,\) \(n=3\ \)
The operations performed on rows and columns of the matrix \(\ \boldsymbol{A}\otimes\boldsymbol{I}_3\ \) may be written as
Thus \(\ \boldsymbol{P} = \boldsymbol{P}_{56}\ \boldsymbol{P}_{46}\ \boldsymbol{P}_{24}\,,\ \) \(\ \boldsymbol{Q} = \boldsymbol{Q}_{24}\ \boldsymbol{Q}_{46}\ \boldsymbol{Q}_{56}\,,\ \) where \(\ \boldsymbol{P}_{ij}\ \) is a matrix of transposition of rows \(\ i,j\,,\ \,\) and \(\ \, \boldsymbol{Q}_{ij}\ \) \(\ -\ \ \) a matrix of transposition of columns \(\ i,j\,,\ \) \(\ (i<j=1,2,\ldots,6.)\)
In view of the relations \(\ \boldsymbol{Q}_{ij} = \boldsymbol{P}_{ij}^{\,T} = \boldsymbol{P}_{ij}^{-1}\,,\ \ i<j=1,2,\ldots,6\,,\ \) we obtain
hence \(\ \ \boldsymbol{Q}\ \,=\ \,\boldsymbol{P}^{\,T}\ =\ \, \boldsymbol{P}^{-1},\ \ \) which was to be verified.
A practical conclusion: \(\quad \det{(\boldsymbol{A}\otimes\boldsymbol{I}_3)}\,=\, \det{(\boldsymbol{I}_3\otimes\boldsymbol{A})}\,=\,(\det{\boldsymbol{A}})^3.\)
The matrices \(\ \boldsymbol{P}\ \) and \(\ \boldsymbol{Q}\ \) shall be determined numerically, remembering that in Sage:
the numbering of rows and columns starts at zero;
- the matrix \(\ \boldsymbol{P}_{ij}\ \) of transposition of rows is an elementary matrix,obtained from the identity matrix by swapping \(\ i\)-th and \(\ j\)-th rows;\(\ \boldsymbol{P}_{ij}\ \) transforms any given matrix by multiplying it from the left;
- the matrix \(\ \boldsymbol{Q}_{ij}\ \) of transposition of columns is an elementary matrix,obtained from the identity matrix by swapping \(\ i\)-th and \(\ j\)-th columns;\(\ \boldsymbol{Q}_{ij}\ \) transforms any given matrix by multiplying it from the right.
sage: P24 = elementary_matrix(6, row1=1, row2=3)
sage: P46 = elementary_matrix(6, row1=3, row2=5)
sage: P56 = elementary_matrix(6, row1=4, row2=5)
sage: P = P56*P46*P24
sage: Q24 = elementary_matrix(6, col1=1, col2=3)
sage: Q46 = elementary_matrix(6, col1=3, col2=5)
sage: Q56 = elementary_matrix(6, col1=4, col2=5)
sage: Q = Q24*Q46*Q56
sage: (P,Q)
(
[1 0 0 0 0 0] [1 0 0 0 0 0]
[0 0 0 1 0 0] [0 0 0 0 1 0]
[0 0 1 0 0 0] [0 0 1 0 0 0]
[0 0 0 0 0 1] [0 1 0 0 0 0]
[0 1 0 0 0 0] [0 0 0 0 0 1]
[0 0 0 0 1 0], [0 0 0 1 0 0]
)
Now we shall verify numerically the relation (2):
sage: A = matrix([[var("a%d%d" % (k,l)) for l in [1,2]]
for k in [1,2]])
sage: I3 = identity_matrix(3)
sage: AxI3 = A.tensor_product(I3)
sage: I3xA = P * AxI3 * Q
sage: I3xA.subdivide([2,4],[2,4])
sage: (AxI3, I3xA)
(
[a11 a12| 0 0| 0 0]
[a11 0 0|a12 0 0] [a21 a22| 0 0| 0 0]
[ 0 a11 0| 0 a12 0] [-------+-------+-------]
[ 0 0 a11| 0 0 a12] [ 0 0|a11 a12| 0 0]
[-----------+-----------] [ 0 0|a21 a22| 0 0]
[a21 0 0|a22 0 0] [-------+-------+-------]
[ 0 a21 0| 0 a22 0] [ 0 0| 0 0|a11 a12]
[ 0 0 a21| 0 0 a22], [ 0 0| 0 0|a21 a22]
)
Let \(\ \sigma\in S_6\ \) be the permutation of rows and columns, which converts the matrix \(\ \boldsymbol{A}\otimes\boldsymbol{I}_3\ \) into \(\ \boldsymbol{I}_3\otimes\boldsymbol{A}.\ \) Remembering the definitions of permutation matrices in row and column version, the permutation \(\ \sigma\ \) may be easily determined from the matrix \(\ \boldsymbol{P}\ \) or \(\ \boldsymbol{Q}\ \) calculated above.
To obtain \(\ \sigma\ \) in a standard two-line notation, we note that if the arguments in the first line are naturally ordered: \(\ \boldsymbol{r}_1\,=\,(1,\,2,\,3,\,4,\,5,\,6),\ \) then the second line of corresponding values is given by \(\ \boldsymbol{r}_2\ =\ \boldsymbol{r}_1\cdot\,\boldsymbol{Q}\,.\ \) The Sage code returns \(\ \sigma\,\) calculated in this way:
sage: r1 = vector([1,2,3,4,5,6])
sage: r2 = r1 * Q
sage: sigma = matrix([r1,r2])
sage: sigma
[1 2 3 4 5 6]
[1 4 3 6 2 5]
The permutation in demand is therefore \(\ \,\sigma\ = \ \left(\begin{array}{cccccc} 1 & 2 & 3 & 4 & 5 & 6 \\ 1 & 4 & 3 & 6 & 2 & 5 \end{array}\right)\,.\)
The permutation \(\sigma\) may also be calculated by composing the transpositions corresponding to row permutation matrices \(\ \boldsymbol{P}_{ij}\ \) or column permutation matrices \(\ \boldsymbol{Q}_{ij}\,,\ \ \) taking into account \(\\\) the rules of their multiplication:
That way both products of matrices, \(\ \boldsymbol{P}_{56}\ \boldsymbol{P}_{46}\ \boldsymbol{P}_{24}\ \) and \(\ \boldsymbol{Q}_{24}\ \boldsymbol{Q}_{46}\ \boldsymbol{Q}_{56}\,,\ \) correspond to the same product of transpositions \(\ \tau_{24}\ \tau_{46}\ \tau_{56}\,.\ \) This yields again the permutation \(\ \sigma:\)
\(\,\)
Problem 2. \(\,\) Let \(\ \,\boldsymbol{A}\in M_{m\times n}(K),\ \) \(\ \boldsymbol{B},\,\boldsymbol{B}_1,\boldsymbol{B}_2 \in M_{p\times q}(K).\ \) Using the relation
where \(\ \boldsymbol{\Lambda}^{rs}(\boldsymbol{X})\ \) is a column of coordinates of the matrix \(\ \boldsymbol{X}\in M_{r\times s}(K)\ \) in the basis \(\ \mathcal{E}_{r\times s}\,,\)
prove the following properties of the tensor product of matrices:
Solution. \(\,\) Substituting in (3) \(\ \,\boldsymbol{B}\to\boldsymbol{B}_1 + \boldsymbol{B}_2\,,\ \) where \(\ \boldsymbol{B}_1,\ \boldsymbol{B}_2 \in M_{p\times q}(K),\ \) we get
for arbitrary matrix \(\ \boldsymbol{G}\in M_{n\times q}(K).\ \) Inserting, in place of \(\ \boldsymbol{G},\ \) the consecutive matrices of the standard basis \(\ \mathcal{E}_{n\times q}:\ \) \(\ \boldsymbol{G} = \boldsymbol{E}_{11},\ \boldsymbol{E}_{12},\ \ldots,\ \boldsymbol{E}_{nq}\,,\ \) we come up with equality of the corresponding columns of matrices \(\ \boldsymbol{A}\otimes(\boldsymbol{B}_1 +\,\boldsymbol{B}_2)\ \,\) and \(\ (\boldsymbol{A}\otimes\boldsymbol{B}_1)\ +\ (\boldsymbol{A}\otimes\boldsymbol{B}_2)\,,\ \) which is equivalent to the matrix equality in demand:
Substituting in (3) \(\ \,\boldsymbol{A}\to\gamma\,\boldsymbol{A}\,,\ \) where \(\ \gamma\in K,\ \) we get
for arbitrary matrix \(\ \boldsymbol{G}\in M_{n\times q}(K).\ \) This is equivalent to the matrix equality
On the other hand, substituting in (3) \(\ \boldsymbol{B}\to\gamma\,\boldsymbol{B}\,,\ \) where \(\ \gamma\in K,\ \) we obtain
for arbitrary matrix \(\ \boldsymbol{G}\in M_{n\times q}(K),\ \) whereby
Problem 3. \(\\\) Given the matrices \(\,\boldsymbol{A}=[a_{ij}]_{m\times m}\,,\ \) \(\,\boldsymbol{B}=[b_{ij}]_{n\times n}\ \) and \(\,\boldsymbol{C}=[c_{ij}]_{m\times n}\ \) over a field \(\,K,\ \) consider a matrix equation
with the unknown matrix \(\,\boldsymbol{X}=[x_{ij}]_{m\times n}\,.\ \) Prove that Equation (4) has a unique solution if, and only if, the matrices \(\,\boldsymbol{A}\ \) and \(\,\boldsymbol{B}\ \) are non-singular.
Solution. \(\,\) Equation (4) implies that
The above \(\,mn\,\) equations may be rewritten in a compact matrix form:
That way, the matrix equation (4) has been converted into a standard linear system with the square coefficient matrix \(\,\boldsymbol{A}\otimes\boldsymbol{B}^{\,T}\in M_{mn\times mn}(K)\,,\ \) the column of unknowns \(\,\boldsymbol{\Lambda}^{mn}(\boldsymbol{X})\ \) and the column of constants \(\,\boldsymbol{\Lambda}^{mn}(\boldsymbol{C}):\)
The theory of linear systems says that such a system has a unique solution if, and only if, the coefficient matrix is non-singular. Here
Thus we have proved that the linear system (5), as well as the equivalent matrix equation (4), \(\,\) have a unique solution \(\,\) if and only if \(\,\) both matrices, \(\,\boldsymbol{A}\ \) and \(\ \boldsymbol{B},\ \) are non-singular. \(\\\) The aforesaid unique solution then reads: \(\ \boldsymbol{X}\ =\ \boldsymbol{A}^{-1}\boldsymbol{C}\,\boldsymbol{B}^{-1}\,.\) \(\quad\bullet\)
Problem 4. \(\,\)
Given the matrices \(\,\boldsymbol{A}\in M_{m\times p}(K)\,\) and \(\,\boldsymbol{B}\in M_{p\times n}(K),\ \) the product \(\,\boldsymbol{A}\boldsymbol{B}\ \) can be expressed in the vectorized form as
Using the relation between vectors representing a given matrix \(\,\boldsymbol{C}\in M_{m\times n}(K)\,:\)
derive the relations analogous to (6) for \(\,\boldsymbol{\mathrm{V}}^{mn}(\boldsymbol{A}\boldsymbol{B})\,.\)
Solution. \(\,\)
Assume that the dimensions of the matrices are: \(\ \ \left\{\ \begin{array}{l} \boldsymbol{A}\,:\ m\times p\,,\\ \boldsymbol{B}\,:\ p\times n\,.\end{array} \right.\quad\) We start from
The substitution \(\quad\left\{\ \begin{array}{ll} \boldsymbol{A}\rightarrow\boldsymbol{B}^{\,T}\ :\ m\times p\,; & \boldsymbol{B}\ :\ p\times m \\ \boldsymbol{B}\rightarrow\boldsymbol{A}^{\,T}\ :\ p\times n\,; & \boldsymbol{A}\ :\ n\times p \end{array}\right.\quad\) yields
Making use of relation (7) we get
To obtain the result for \(\ \ \left\{\ \begin{array}{l} \boldsymbol{A}\,:\ m\times p\,,\\ \boldsymbol{B}\,:\ p\times n\,,\end{array} \right.\ \ \) we exchange the denotements \(\ m\leftrightarrows n\,:\)
On the other hand, starting from
and making the substitution \(\quad\left\{\ \begin{array}{ll} \boldsymbol{A}\rightarrow\boldsymbol{B}^{\,T}\ :\ m\times p\,; & \boldsymbol{B}\ :\ p\times m \\ \boldsymbol{B}\rightarrow\boldsymbol{A}^{\,T}\ :\ p\times n\,; & \boldsymbol{A}\ :\ n\times p \end{array}\right.\quad\) we get
Using once again the relation (7) we obtain
By exchange of the denotements \(\ m\leftrightarrows n\ \) we get the relation for \(\ \ \left\{\ \begin{array}{l} \boldsymbol{A}\,:\ m\times p\,,\\ \boldsymbol{B}\,:\ p\times n\,: \end{array}\right.\)
Collecting the results, we come up with the formula
valid for any matrices \(\,\boldsymbol{A}\in M_{m\times p}(K)\ \) and \(\,\boldsymbol{B}\in M_{p\times n}(K).\) \(\quad\bullet\)
Problem 5. \(\,\)
Consider a one-dimensional motion along the \(\,x\)-axis: \(\,x=x(t),\ t\in[\,0,T\,].\ \) Given a vector of position data from a uniform division of the interval \(\,[\,0,T\,]\ \) into \(\,N\ \) segments, derive the corresponding acceleration vector by means of the one-dimensional discrete Laplacian. Compare illustratively the exact and approximate results.
Solution. \(\,\)
The function ML(N)
(‘Minus Laplacian’) returns the \(\,N\times N\ \)
matrix performing the discrete two-fold differentiation of a function
defined on a one-dimensional grid of \(\,N\,\) points.
As an equation of motion, we choose a fourth-order polynomial of time, \(\ x(t),\ t \in [\,0,N\,],\ \) such that \(\,x(0)=x(N)=0.\ \) The position is sampled in \(\,N+1\,\) time points \(\,0,\,1,\,\ldots,\,N,\ \) but the acceleration is evaluated only in \(\,n=N-1\ \) internal time points \(\,1,\,\ldots,\,N-1.\)
To compare the approximate vs exact results, the exact acceleration is given:
Before execution of the code below, \(\,\) activate \(\,\) the three above functions !
Output. \(\,\) On the background of the exact acceleration plot, the program displays the discrete values of acceleration calculated by the discrete two-fold differentiation. Additionally, for each internal time \(\,t\in \{1,2,\ldots,n\}\ \) the approximate (A) and exact (a) values of acceleration as well as the relative divergence thereof are listed in a table. By uncommenting a proper command, the plot of \(\ x=x(t),\ t\in [0,N],\ \) may also be shown.