American Journal of Computational and Applied Mathematics
p-ISSN: 2165-8935 e-ISSN: 2165-8943
2019; 9(4): 110-118
doi:10.5923/j.ajcam.20190904.03

Ognyan Ivanov Zhelezov
Part-time lecturer, Nikola Vaptsarov Naval Academy, Varna, Bulgaria
Correspondence to: Ognyan Ivanov Zhelezov, Part-time lecturer, Nikola Vaptsarov Naval Academy, Varna, Bulgaria.
| Email: | ![]() |
Copyright © 2019 The Author(s). Published by Scientific & Academic Publishing.
This work is licensed under the Creative Commons Attribution International License (CC BY).
http://creativecommons.org/licenses/by/4.0/

This article presents a special case of symmetric matrices, matrices of transpositions (Tr matrices) that are created from the elements of given n-dimensional vector X∈Rn, n=2m, m∈N. Has been proposed algorithm for obtaining matrices of transpositions with mutually orthogonal rows (Trs matrices) of dimensions 2, 4, and 8 as Hadamard product of Tr matrix and matrix of Hadamard and has been investigated their application for QR decomposition and n-dimensional rotation matrix generation. Tests and analysis of the algorithm show that obtaining an orthogonal Trs matrix of sizes 4 and 8 that rotates a given vector to the direction of one of the coordinate axes requires less processing time than obtaining a Housholder matrix of the same size.
Keywords: Mathematics of computing, Mathematical analysis, Numerical analysis, Computations on matrices
Cite this paper: Ognyan Ivanov Zhelezov, A Special Case of Symmetric Matrices and Their Applications, American Journal of Computational and Applied Mathematics , Vol. 9 No. 4, 2019, pp. 110-118. doi: 10.5923/j.ajcam.20190904.03.
![]() | (1) |
denotes operation „bitwise exclusive or“ (XOR) [22], [23].When it is needed to denote from which vector have been obtained the values of Tr matrix’s elements, we will use for the Tr matrix denotation Tr(X), and for its elements - denotation Tr(X)p,q.As it given in (1), we will use zero based indices for vector’s elements and for Tr matrix’s rows and columns: p,q = 0,1,…,n-1.As it can be seen from the definition of the matrix, it contains only the values of the elements of a given vector. What sets it apart from other similar matrices is the “property of the fours”, which is described belowThe figure, given below shows 8-dimensional Tr matrix, created from arbitrary vector X=(x0,x1, … x7)T.![]() | Figure 1. 8-dimensional Tr matrix created from vector X=(x0,x1, … x7)T |
![]() | Example 1. Matlab function, which creates and returns Tr matrix obtained from given n-dimensional vector X, n=2m, m∈N |
From definition of Tr matrix we have
and taking in consideration commutativity of XOR operation we have 
which proves that Tr matrix is symmetric.
and
(1) and according to condition above we have
which mean that
Multiplying two sides of this equation by p, according properties of XOR operation, we get:![]() | (2) |
which means that values of elements of first row are equal to the values of elements of given vector X having the same indices, i.e. in normal order. Since Tr is symmetric matrix, the same is valid for first matrix’s column Q.E.D.![]() | Figure 2. Example of fours of elements in 8-dimensional Tr matrix, for which it is satisfied Tr-property |
and
for the indices of which is satisfied equality
that is they contain the same element
of vector X. We will prove that from this follows that for the elements 
and
is satisfied equality
that is they contain the same element
of given vector X too.Proof: Let's look at the equation
which is satisfied on condition. Multiplying by p to the right of the two sides of the equation, we get:![]() | (3) |
![]() | (4) |
so Trp,v and Tru,q consists the same element of given vector X which proves the property.This property, that we shall hereafter call “Tr-property” is specific to Tr matrix. The figure above shows an example of 8-dimensional Tr matrix in which are indicated by dotted lines several groups of 4 elements, which form rectangles with equal diagonal elements (which mean, that they satisfy Tr-property).
and
But it would follow, that
where by multiplying the two sides of equality by u we get v=s, which mean that elements are the same, and therefore the element Trp,q participates in only one fours with elements from row u. Since every one of fours consists two elements of row p, it follows that rows p and u consists n/2 fours of elements, Q.E.D.![]() | Figure 3. Fours of elements in 8-dimensional Tr matrix between elements of rows 1-2 and 5-7, for which it is satisfied Tr-property |
![]() | (5) |
![]() | (6) |
![]() | Figure 4. Schema of 8-dimensional Trs matrix for vector X=[x0,x1, … x7]T |
![]() | Example 2. Matlab function, that creates and returns a Trs matrix for a given vector X of size n = 2, 4, or 8 |
Similarly, we will call H fours of elements (or just H-fours) elements H(R)p,q, H(R)p,v, H(R)u,q, H(R)u,v of rows p and u of H(R) matrix, where p,q,u,v∈[0,n-1] and p≠u, if their corresponding elements from the Tr matrix (Trp,q, Trp,v, Tru,q, Tru,v) satisfy the Tr-property.![]() | Figure 5. Schema of the fours of elements in the first two rows of an 8-bit Tr matrix |
![]() | Figure 6. Schema of the first two rows of Silvester-Hadamard matrix |
![]() | Figure 7. Schema of the fours of elements in the first two rows of an 8-dimensional Trs matrix |
![]() | (7) |
![]() | (8) |
![]() | (9) |
![]() | (10) |
![]() | (11) |
[1,n-1]., u≠v, which contain two diagonal elements Trsu,u and Trsv,v and two diagonally spaced elements Trsu,v and Trsu,v. As (shown above) Trsu,u = -X0.и Trsv,v = -X0, then according Trs-рproperty it follows that the diagonally spaced elements Trsu,v и Trsv,v have opposite signs Trsu,v = -Trsv,u Q.E.D.![]() | (13) |
![]() | Figure 8. Representing the product of Trs (X) and matrix of a single inversion as difference of a symmetric and diagonal matrix |
![]() | (14) |
![]() | (15) |
![]() | (16) |
![]() | (17) |
![]() | (12) |

![]() | (18) |
is base operation of the NRMG algorithm for obtaining an n-dimensional rotation matrix [1] and of algorithm for QR decomposition of a matrix [7], [13]. Base operation of those two algorithms is rotation (or reflection) of given n-dimensional vector to the direction of one of coordinate axes. For “dense” matrices as the most effective method is considered Householder reflection [2], [3], [13], while for “sparse” matrices more effective could be the method using Givens rotations.The use of Trs matrices is an alternative method, which in some cases may be more effective than both Householder reflections and Givens rotations. Tests and analysis of the algorithm show that obtaining an orthogonal Trs matrix of sizes 4 and 8 that rotates a given vector to the direction of one of the coordinate axes requires less processing time than obtaining such Housholder matrix. A description of the testing is given in "Numerical Experiments".Rotation of n-dimensional vector to the direction of the coordinate axis
using Trs matrices.As is known [15], [20], [21], any positive integer n∈N, n<2m+1 can be represented in a binary number system as a polynomial in terms of 2 by coefficients ak=[0,1] as follows:![]() | (19) |
![]() | (20) |
![]() | (21) |
. The figure below shows graphically the transformation operations for 2, 4 and 8-dimensional vectors through Trs matrices. The unit for rotating a two-dimensional vector through a Trs matrix is equivalent to multiplying with Givens matrix for rotating a 2-dimensional vector in coordinate plane (xk, xk+1), but Trs matrix is matrix of reflection, while Givens matrix is matrix of rotation.![]() | Figure 9. Schema for transformation of 2, 4 and 8-dimensional vectors using Trs matrices |
by means of Trs matrices can be represented by the following block diagram (Figure 10). From the first eight elements of the given 10-dimensional vector X, is obtained matrix Trs8(X8/||X8||), which reflects the 8- dimensional vector X8 to the direction of the axis
. From a two-dimensional vector X2=[x9,x10]T is obtained matrix Trs2(X2/||X2||), which reflects X2 to the direction of the axis
. In the second stage of the algorithm through matrix Trs2(X22/||X22||) the vector X22=[r8,r2]T is reflected in the coordinate plane (x1, x9) which gives 10-dimensional output vector Y=[r10,0,...,0]T. Since Trs are orthogonal matrices, then ||Y||=[r10,0,...,0]T =||X|| and consequently |r10|=||X||.![]() | Figure 10. Schema for rotation of 10-dimensional vector to the direction of axis using Trs matrices |
![]() | (21) |

![]() | Example 3. Code of Matlab for QR decomposition using Trs matrices or Householder reflection |
![]() | Example 4. Code of Matlab function, which returns orthogonal matrix M, that zeroes elements of k-th column under k-th index of R matrix using Trs block matrices |
![]() | Example 5. Code of Matlab function, which returns orthogonal matrix M, that zeroes elements of k-th column under k-th index of R matrix using Householder transformation |