## 5 Numerical Examples
### Example 2  
A minimal norm and least-squares solution is sought for of the following inconsistent equation:  
\[\left[\begin{array}{ccc}1&1&0\\ 1&0&1\\ -1&0&0\\ 1&1&1\end{array}\right]\left[\begin{array}{c}x_{1}\\ x_{2}\\ x_{3}\end{array}\right]=\left[\begin{array}{c}0\\ 0\\ 1\\ 2\end{array}\right]. \tag{130}\]  
Although Example 2 is simple, we use it to test the DOS and DOA for finding the minimal-norm solution for an inconsistent system.  
We first apply the DOS with \(m=1\), where we obtain a very accurate solution with \(x_{1}=-1.25\), \(x_{2}=1.5\), and \(x_{3}=1.5\). The residuals are \((r_{1},r_{2},r_{3},r_{4})=(0.25,0.25,0.25,-0.25)\) with the residual norm being \(0.5\).  
Then, the DOA with \(m=1\) and \(\varepsilon=10^{-12}\) solves this problem. Starting from the initial guesses \(x_{1}^{0}=x_{2}^{0}=x_{3}^{0}=0\), as shown in Figure 1b, the DOA converges very fast in only two steps, where we obtain a very accurate solution with \(x_{1}=-1.25\), \(x_{2}=1.5\), and \(x_{3}=1.5\). The residuals are \((r_{1},r_{2},r_{3},r_{4})=(0.25,0.25,0.25,-0.25)\), with the residual norm being \(0.5\). For the inconsistent system, the equality in Equation (130) no longer holds, such that the residual is not a zero vector.  
The Moore-Penrose inverse of the coefficient matrix \(\mathbf{A}\) in Equation (130) has an exact solution:  
\[\mathbf{A}^{\dagger}=\left[\begin{array}{ccc}\frac{1}{4}&\frac{1}{4}&-\frac {3}{4}&-\frac{1}{4}\\ \frac{1}{2}&-\frac{1}{2}&\frac{1}{2}&\frac{1}{2}\\ -\frac{1}{2}&\frac{1}{2}&\frac{1}{2}&\frac{1}{2}\end{array}\right]. \tag{131}\]  
Then, we find that the exact solution of Equation (130) is given by \(\mathbf{x}=\mathbf{A}^{\dagger}\mathbf{b}\), as just \((x_{1},x_{2},x_{3})=(-1.25,1.5,1.5)\) mentioned above.  
We apply the iterative method developed by [PERSON] and [PERSON] [20] to find the Moore-Penrose inverse, which has a simpler form:  
\[\mathbf{X}_{k+1}=(1+\beta)\mathbf{X}_{k}-\beta\mathbf{X}_{k}\mathbf{A} \mathbf{X}_{k},\ \ \mathbf{X}_{0}=\beta\mathbf{A}^{\mathrm{T}}, \tag{132}\]  
Figure 1: Examples 1 and 2, showing the relative residuals with respect to the number of iterations; the latter is compared with [20].  
based on the Penrose Equations (4) and (6). Under the same convergence criterion, this iteration process is convergent in 130 steps, as shown in Figure 1b by a dashed line.  
Note that the DOA can be also used to find the Moore-Penrose inverse \(\mathbf{A}^{\dagger}\) by taking the right-hand side \(\mathbf{b}\) to be a zero vector and the \(k\)-th element to be one, of which the corresponding solution of \(\mathbf{x}\) denoted by \(\mathbf{x}^{k}\) constitutes the \(k\)th column of \(\mathbf{A}^{\dagger}\). Then, we can run the DOA \(q\) times from \(k=1,\ldots,q\) to obtain  
\[\mathbf{A}^{\dagger}=\left[\begin{array}{ccc}x_{1}^{1}&\ldots&x_{1}^{q}\\ x_{2}^{1}&\ldots&x_{2}^{q}\\ \vdots&\ldots&\ldots\\ x_{n}^{1}&\ldots&x_{n}^{q}\end{array}\right]. \tag{133}\]  
The dimension of \(\mathbf{A}^{\dagger}\) is \(n\times q\). By applying the DOA with \(m=1\) under the same convergence criterion \(\varepsilon=10^{-12}\), we can find a very accurate solution of \(\mathbf{A}^{\dagger}\), as shown in Equation (131) with the maximum error of all elements being \(10^{-14}\), which is achieved in a total of 26 steps and converges faster than the method developed by [PERSON] and [PERSON] [20].