How to write the algorithm? I have figured out a method to find the inverse.

In summary, the conversation discusses a method for finding the inverse of a matrix by using triangular matrices. This method involves equating upper 0s and using row and column operations to transform the matrix into a triangular form. The formula for matrix inversion by determinants, the adjugate matrix, and backwards substitution are also mentioned.
  • #1
Ask4material
18
0
How to write the algorithm? I figured out a method to find the inverse.

The assignment is making use of the property of triangular matrices to find the inverse of a matrix [itex]\displaystyle A[/itex].

The inverse of a triangular matrix(Upper/ Lower) is also triangular(Upper/ Lower) and is easy to find.

[itex]\displaystyle \begin{bmatrix} a & b & c\\ 0 & d & e\\ 0 & 0& f \end{bmatrix} \begin{bmatrix}\frac{1}{a} & x & z\\ 0 & \frac{1}{d} & y \\ 0 & 0 &\frac{1}{f} \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0\\ 0 & 1 & 0\\ 0 & 0 & 1 \end{bmatrix}[/itex]

By equating the Upper 0s, [itex]\displaystyle x, y, z[/itex] are readily to be found.

[itex]\displaystyle x = -a^{-1} b d^{-1}[/itex], [itex]\displaystyle y = -d^{-1} e f^{-1}[/itex], [itex]\displaystyle z = a^{-1} b d^{-1} c f^{-1} - a^{-1} c f^{-1}[/itex]

In higher order matrices:

[itex]\displaystyle a d x= - \begin{vmatrix} b \end{vmatrix}[/itex]

[itex]\displaystyle d f y = - \begin{vmatrix} e \end{vmatrix}[/itex]

[itex]\displaystyle a d f z= + \begin{vmatrix} b & c \\ d & e \end{vmatrix}[/itex]

[itex]\displaystyle \pm [/itex] signs follow the plan:

[itex]\displaystyle \begin{bmatrix} + & - & + \\ - & + & -\\ + & -& + \end{bmatrix} \sim \begin{bmatrix} + & x & z \\ - & + & y\\ + & - & + \end{bmatrix}[/itex]

If [itex]\displaystyle A[/itex] is invertible, find [itex]\displaystyle A^{-1}[/itex] by changing [itex]\displaystyle A[/itex] triangular...

[itex]\displaystyle AX=I[/itex]

[itex]\displaystyle E_3E_2E_1AX=E_3E_2E_1I[/itex]

[itex]\displaystyle E_jAX=E_jI[/itex]

Take Row operation and Column operation on [itex]\displaystyle E_jA[/itex] to become a triangular matrix

[itex]\displaystyle R_jE_jAC_j = U[/itex] is triangular.

[itex]\displaystyle (R_jE_jAC_j)^{-1} = U^{-1}[/itex] can be found by the method above.[itex]\displaystyle (R_jE_jAC_j)^{-1}=C_j^{-1}A^{-1}E_j^{-1}R_j^{-1} = U^{-1}[/itex]

[itex]\displaystyle A^{-1}=C_j(C_j^{-1}A^{-1}E_j^{-1}R_j^{-1})R_jE_j = C_j(U^{-1})R_jE_j[/itex]

[itex]\displaystyle E_j = E_jAX = E_jI[/itex] is computed in the beginning.
 
Last edited:
Physics news on Phys.org
  • #2
Triangular matrices are comparably easy to invert. One only needs the explicit formula for matrix inversion by determinants of submatrices, the adjugate matrix and a backwards substitution.
 

What is an algorithm?

An algorithm is a set of step-by-step instructions or procedures used to solve a problem or complete a task. It is a fundamental concept in computer science and is used in various applications, such as data analysis, artificial intelligence, and programming.

What are the steps to write an algorithm?

The steps to write an algorithm include:

  1. Identify the problem and define the input and output.
  2. Break the problem into smaller, more manageable subproblems.
  3. Design a solution for each subproblem.
  4. Combine the solutions to create a final solution for the entire problem.
  5. Test and refine the algorithm to ensure it produces the desired output for different inputs.
  6. Document the algorithm for future reference.

How do I find the inverse using an algorithm?

To find the inverse using an algorithm, you can follow these steps:

  1. Identify the mathematical operation you want to perform (e.g. addition, multiplication).
  2. Define the input and output for the inverse operation.
  3. Design a solution for finding the inverse of a given number or function.
  4. Test and refine the algorithm to ensure it produces the correct inverse for different inputs.
  5. Document the algorithm for future reference.

What are some common mistakes to avoid when writing an algorithm?

Some common mistakes to avoid when writing an algorithm include:

  • Not defining the problem or input/output clearly.
  • Not breaking the problem into manageable subproblems.
  • Creating a solution that is too complex or inefficient.
  • Not testing the algorithm thoroughly with different inputs.
  • Not documenting the algorithm properly for future reference.

How can I improve my algorithm writing skills?

To improve your algorithm writing skills, you can:

  • Practice by solving different problems and breaking them into smaller subproblems.
  • Read and study algorithms written by others.
  • Get feedback from others on your algorithm and make improvements.
  • Attend workshops or courses on algorithm design and analysis.
  • Stay updated on new algorithms and techniques.

Similar threads

Replies
34
Views
2K
  • Linear and Abstract Algebra
Replies
2
Views
938
  • Linear and Abstract Algebra
Replies
12
Views
2K
  • Linear and Abstract Algebra
Replies
1
Views
727
Replies
31
Views
2K
Replies
0
Views
333
  • Linear and Abstract Algebra
Replies
6
Views
2K
  • Calculus and Beyond Homework Help
Replies
12
Views
977
  • Linear and Abstract Algebra
Replies
4
Views
1K
  • Linear and Abstract Algebra
Replies
1
Views
2K
Back
Top