<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.3">Jekyll</generator><link href="https://qndev.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://qndev.github.io/" rel="alternate" type="text/html" /><updated>2023-05-06T15:12:57+00:00</updated><id>https://qndev.github.io/feed.xml</id><title type="html">Qndev’s blog</title><subtitle>by Quang Nguyen</subtitle><author><name>NGUYEN DINH QUANG</name><email>quangnd.hust@gmail.com</email></author><entry><title type="html">Mô tả thiết kế phần mềm</title><link href="https://qndev.github.io/software%20engineering/2020/09/08/sdd/" rel="alternate" type="text/html" title="Mô tả thiết kế phần mềm" /><published>2020-09-08T00:00:00+00:00</published><updated>2020-09-08T00:00:00+00:00</updated><id>https://qndev.github.io/software%20engineering/2020/09/08/sdd</id><content type="html" xml:base="https://qndev.github.io/software%20engineering/2020/09/08/sdd/">&lt;h3 id=&quot;tài-liệu-mô-tả-thiết-kế-phần-mềm&quot;&gt;Tài liệu mô tả thiết kế phần mềm&lt;/h3&gt;

&lt;iframe src=&quot;/resources/SDD.pdf&quot; width=&quot;500px&quot; height=&quot;500px&quot;&gt;

---
&lt;/iframe&gt;</content><author><name>NGUYEN DINH QUANG</name><email>quangnd.hust@gmail.com</email></author><category term="Software engineering" /><category term="notes" /><category term="sdd" /><summary type="html">Tài liệu mô tả thiết kế phần mềm</summary></entry><entry><title type="html">Đặc tả yêu cầu phần mềm</title><link href="https://qndev.github.io/software%20engineering/2020/09/07/srs/" rel="alternate" type="text/html" title="Đặc tả yêu cầu phần mềm" /><published>2020-09-07T00:00:00+00:00</published><updated>2020-09-07T00:00:00+00:00</updated><id>https://qndev.github.io/software%20engineering/2020/09/07/srs</id><content type="html" xml:base="https://qndev.github.io/software%20engineering/2020/09/07/srs/">&lt;h3 id=&quot;tài-liệu-đặc-tả-yêu-cầu-phần-mềm&quot;&gt;Tài liệu đặc tả yêu cầu phần mềm&lt;/h3&gt;

&lt;iframe src=&quot;/resources/SRS.pdf&quot; width=&quot;500px&quot; height=&quot;500px&quot;&gt;

---
&lt;/iframe&gt;</content><author><name>NGUYEN DINH QUANG</name><email>quangnd.hust@gmail.com</email></author><category term="Software engineering" /><category term="notes" /><category term="srs" /><summary type="html">Tài liệu đặc tả yêu cầu phần mềm</summary></entry><entry><title type="html">Hệ điều hành</title><link href="https://qndev.github.io/my%20notes/2020/07/01/os/" rel="alternate" type="text/html" title="Hệ điều hành" /><published>2020-07-01T00:00:00+00:00</published><updated>2020-07-01T00:00:00+00:00</updated><id>https://qndev.github.io/my%20notes/2020/07/01/os</id><content type="html" xml:base="https://qndev.github.io/my%20notes/2020/07/01/os/">&lt;h2 id=&quot;quản-lý-bộ-nhớ-quản-lý-hệ-thống-file&quot;&gt;Quản lý bộ nhớ, quản lý hệ thống file&lt;/h2&gt;

&lt;iframe src=&quot;/resources/OS.pdf&quot; width=&quot;500px&quot; height=&quot;500px&quot;&gt;

---
&lt;/iframe&gt;</content><author><name>NGUYEN DINH QUANG</name><email>quangnd.hust@gmail.com</email></author><category term="My notes" /><category term="notes" /><category term="os" /><summary type="html">Quản lý bộ nhớ, quản lý hệ thống file</summary></entry><entry><title type="html">Danh sách liên kết đơn dùng con trỏ</title><link href="https://qndev.github.io/my%20notes/2019/12/21/pointer/" rel="alternate" type="text/html" title="Danh sách liên kết đơn dùng con trỏ" /><published>2019-12-21T00:00:00+00:00</published><updated>2019-12-21T00:00:00+00:00</updated><id>https://qndev.github.io/my%20notes/2019/12/21/pointer</id><content type="html" xml:base="https://qndev.github.io/my%20notes/2019/12/21/pointer/">&lt;h2 id=&quot;con-trỏ-cơ-bản&quot;&gt;Con trỏ cơ bản&lt;/h2&gt;

&lt;div class=&quot;language-c highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cp&quot;&gt;#include&amp;lt;stdio.h&amp;gt;
&lt;/span&gt; 
&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;qndev&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;50&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;p1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;**&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;p2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;p1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;qndev&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;p2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;p1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Gia tri cua bien qndev: %d &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;qndev&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Dia chi cua bien qndev la: %x &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;qndev&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Dia chi cua bien con tro p1 la: %x &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;p1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Gia tri cua bien con tro p1 la: %x &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;p1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Gia tri cua bien ma con tro p1 tro toi la: %d &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;p1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Dia chi cua bien con tro p2 la: %x &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;p2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Gia tri cua bien con tro p2 la: %x &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;p2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Gia tri cua bien ma con tro p2 tro toi la (Gia tri cua bien con tro p1/ Dia chi cua bien qndev): %x &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;p2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Gia tri cua bien **p2 la: %d &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;p2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Output:&lt;/p&gt;
&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;go&quot;&gt;Gia tri cua bien qndev: 50 
Dia chi cua bien qndev la: 33a8ea4c 
Dia chi cua bien con tro p1 la: 33a8ea40 
Gia tri cua bien con tro p1 la: 33a8ea4c 
Gia tri cua bien ma con tro p1 tro toi la: 50 
Dia chi cua bien con tro p2 la: 33a8ea38 
Gia tri cua bien con tro p2 la: 33a8ea40 
Gia tri cua bien ma con tro p2 tro toi la (Gia tri cua bien con tro p1/ Dia chi cua bien qndev): 33a8ea4c 
Gia tri cua bien **p2 la: 50 
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;danh-sách-sách-liên-kết-đơn&quot;&gt;Danh sách sách liên kết đơn&lt;/h2&gt;

&lt;div class=&quot;language-c highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;cp&quot;&gt;#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;typedef&lt;/span&gt; &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ElementType&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;struct&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_PointerType&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;ElementType&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Inf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;struct&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;typedef&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;struct&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;_PointerType&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;BuildList&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;second&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;third&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;malloc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;sizeof&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;second&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;malloc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;sizeof&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;third&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;malloc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;sizeof&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Inf&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;second&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;second&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Inf&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;second&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;third&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;third&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Inf&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;third&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;InsertMiddle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Prev&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ElementType&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  
  &lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;malloc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;sizeof&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Inf&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Prev&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;Prev&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;ElementType&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Delete&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Prev&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;ElementType&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  
  &lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Prev&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Prev&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Prev&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Inf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;free&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;InsertToHead&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ElementType&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  
  &lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;malloc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;sizeof&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Inf&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;First&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;// printf(&quot;Gia tri cua First %p \n&quot;, First);&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;InsertToLast&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ElementType&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;NewNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

  &lt;span class=&quot;n&quot;&gt;NewNode&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;malloc&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;sizeof&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;NewNode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Inf&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;X&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;NewNode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
  &lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  
  &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  
  &lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;NewNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;DeleteHead&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  
  &lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;free&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;DeleteLast&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Temp1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Temp2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;Temp1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Temp2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  
  &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Temp1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;Temp2&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Temp1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;Temp1&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Temp1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;}&lt;/span&gt;
  
  &lt;span class=&quot;n&quot;&gt;Temp2&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;free&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Temp1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Reverse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; 
    
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;head&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; 
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; 
    &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; 
        &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;newHead&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Reverse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;newHead&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;IsEmpty&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;MakeNull&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;IsEmpty&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;DeleteHead&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;Print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  
  &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;%p &quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;First&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;-&amp;gt; [ %d : %p ]&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Inf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
   &lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;TempNode&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;c1&quot;&gt;// Than chuong trinh chinh&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;main&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(){&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;PointerType&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;NULL&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// Chen 5 gia tri vao vi tri dau&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;InsertToHead&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;InsertToHead&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;InsertToHead&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;InsertToHead&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;InsertToHead&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;//PointerType *ds = BuildList();&lt;/span&gt;
    &lt;span class=&quot;c1&quot;&gt;// In ra danh sach sau khi chen&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;In ra danh sach sau khi chen vao dau &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Danh sach sau khi chen 6 vao dau &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;InsertToHead&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;6&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

    &lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Reverse&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Danh sach sau khi dao nguoc &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;

    &lt;span class=&quot;c1&quot;&gt;// Chen so 7 vao vi tri cuoi cua danh sach&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Danh sach sau khi chen 7 vao cuoi &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;InsertToLast&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    
    &lt;span class=&quot;c1&quot;&gt;// In ra danh sach sau khi xoa phan tu dau&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;In ra danh sach sau khi xoa dau &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DeleteHead&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    
    &lt;span class=&quot;c1&quot;&gt;// In ra danh sach sau khi xoa phan tu cuoi&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;In ra danh sach sau khi xoa cuoi &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;DeleteLast&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    
    &lt;span class=&quot;c1&quot;&gt;// In ra danh sach sau khi xoa phan tu dau&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;Cho vi tri ban muon chen 7 vao sau p = &quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;scanf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&quot;%d&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;pv&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;while&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;p&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pv&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;pv&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Next&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;}&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;InsertMiddle&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pv&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;7&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ds&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;getchar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Output:&lt;/p&gt;
&lt;div class=&quot;language-console highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;go&quot;&gt;In ra danh sach sau khi chen vao dau 
&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;0x55e09e4d92e0 -&amp;gt;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 5 : 0x55e09e4d92c0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 4 : 0x55e09e4d92a0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 3 : 0x55e09e4d9280 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 2 : 0x55e09e4d9260 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 1 : &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;nil&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Danh sach sau khi chen 6 vao dau 
&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;0x55e09e4d9710 -&amp;gt;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 6 : 0x55e09e4d92e0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 5 : 0x55e09e4d92c0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 4 : 0x55e09e4d92a0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 3 : 0x55e09e4d9280 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 2 : 0x55e09e4d9260 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 1 : &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;nil&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Danh sach sau khi dao nguoc 
&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;0x55e09e4d9260 -&amp;gt;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 1 : 0x55e09e4d9280 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 2 : 0x55e09e4d92a0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 3 : 0x55e09e4d92c0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 4 : 0x55e09e4d92e0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 5 : 0x55e09e4d9710 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 6 : &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;nil&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Danh sach sau khi chen 7 vao cuoi 
&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;0x55e09e4d9260 -&amp;gt;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 1 : 0x55e09e4d9280 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 2 : 0x55e09e4d92a0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 3 : 0x55e09e4d92c0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 4 : 0x55e09e4d92e0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 5 : 0x55e09e4d9710 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 6 : 0x55e09e4d9730 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 7 : &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;nil&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;In ra danh sach sau khi xoa dau 
&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;0x55e09e4d9280 -&amp;gt;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 2 : 0x55e09e4d92a0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 3 : 0x55e09e4d92c0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 4 : 0x55e09e4d92e0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 5 : 0x55e09e4d9710 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 6 : 0x55e09e4d9730 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 7 : &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;nil&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;In ra danh sach sau khi xoa cuoi 
&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;0x55e09e4d9280 -&amp;gt;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 2 : 0x55e09e4d92a0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 3 : 0x55e09e4d92c0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 4 : 0x55e09e4d92e0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 5 : 0x55e09e4d9710 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 6 : &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;nil&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;span class=&quot;go&quot;&gt;Cho vi tri ban muon chen 7 vao sau p = 5
&lt;/span&gt;&lt;span class=&quot;gp&quot;&gt;0x55e09e4d9280 -&amp;gt;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 2 : 0x55e09e4d92a0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 3 : 0x55e09e4d92c0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 4 : 0x55e09e4d92e0 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 5 : 0x55e09e4d9710 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 6 : 0x55e09e4d9730 &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;-&amp;gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt; 7 : &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;nil&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;hr /&gt;</content><author><name>NGUYEN DINH QUANG</name><email>quangnd.hust@gmail.com</email></author><category term="My notes" /><category term="notes" /><category term="data structures and algorithms" /><category term="c" /><summary type="html">Con trỏ cơ bản</summary></entry><entry><title type="html">Transposes, permutations, spaces R^n [5]</title><link href="https://qndev.github.io/mathematics/2019/12/08/transposes-permutations-spaces-R-n/" rel="alternate" type="text/html" title="Transposes, permutations, spaces R^n [5]" /><published>2019-12-08T00:00:00+00:00</published><updated>2019-12-08T00:00:00+00:00</updated><id>https://qndev.github.io/mathematics/2019/12/08/transposes-permutations-spaces-R-n</id><content type="html" xml:base="https://qndev.github.io/mathematics/2019/12/08/transposes-permutations-spaces-R-n/">&lt;h3 id=&quot;permutations&quot;&gt;Permutations&lt;/h3&gt;

&lt;p&gt;Phép nhân với ma trận hoán vị \(P\) hoán đổi các hàng của ma trận; khi chúng ta thực hiện phương pháp khử, chúng ta sử dụng các ma trận hoán vị để chuyển các phần tử \(0\) ra khỏi vị trí chốt. Phép phân tích \(A=LU\) khi đó sẽ trở thành \(PA=LU\), với \(P\) là nma trận hoán vị sẽ sắp xếp lại bất kì hàng nào của ma trận \(A\). Và \(P^{-1}=P^T\), \(P^TP=I\).&lt;/p&gt;

&lt;h3 id=&quot;transposes&quot;&gt;Transposes&lt;/h3&gt;

&lt;p&gt;Khi chúng ta thực hiện chuyển vị ma trận, các hàng của chúng sẽ thành cột và các cột sẽ thành hàng. Nếu chúng ta kí hiệu phần tử ở hàng \(i\) cột \(j\) của ma trận \(A\) là \(A_{ij}\) thì chúng ta có thể biểu diễn \(A^T\) bằng: \(A_{ij}^T=A_{ji}\). Ví dụ:&lt;/p&gt;

&lt;p&gt;\[
{\begin{bmatrix}1 &amp;amp; 3\\ 2 &amp;amp; 3\\ 4 &amp;amp; 1\end{bmatrix}}^T=\begin{bmatrix}1 &amp;amp; 2 &amp;amp; 4\\ 3 &amp;amp; 3 &amp;amp; 1\end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;Ma trận \(A\) là ma trận đối xứng nếu \(A^T=A\). Cho ma trận \(R\) bất kì không nhất thiết phải là ma trận vuông thì \(R^TR\) luôn luôn là ma trận đối xứng bởi vì \((R^TR)^T=R^T(R^T)^T=R^TR\). Chú ý: \((R^T)^T=R\).&lt;/p&gt;

&lt;h3 id=&quot;vector-spaces&quot;&gt;Vector spaces&lt;/h3&gt;

&lt;p&gt;Chúng ta có thể công các vector, nhân vector với một số có nghĩa là chúng ta có thể thảo luận về tổ hợp tuyến tính của vectơ. Các tổ hợp tuyến tính này tuân theo các nguyên tắc của không gian vector.&lt;/p&gt;

&lt;p&gt;Một không gian vectơ như vậy là \(\mathbb{R}^2\), tập hợp tất cả các vectơ với chính xác hai thành phần số thực. Chúng ta mô tả vector \(\begin{bmatrix}a \\ b\end{bmatrix}\) bằng cách vẽ mũi tên từ gốc tọa độ tới điểm có tọa độ \((a,b)\) đó là \(a\) đơn vị về phía bên phải và \(b\) đơn vị về phía trên, và chúng ta gọi \(\mathbb{R}^2\) là mặt phằng \(x-y\).&lt;/p&gt;

&lt;p&gt;Một ví dụ khác về không gian đó là \(\mathbb{R}^n\), tập hợp các vectơ (cột) với n thành phần số thực.&lt;/p&gt;

&lt;h3 id=&quot;closure---tính-bao-đóng&quot;&gt;Closure - tính bao đóng&lt;/h3&gt;

&lt;p&gt;Tập hợp các vectơ với chính xác hai thành phần có giá trị &lt;strong&gt;thực dương&lt;/strong&gt; không phải là một không gian vectơ, bởi vì tổng của hai vectơ bất kì trong tập vẫn là vectơ thuộc tập đó nhưng nhân một số ví dụ \(-5\) với một vectơ thì kết quả lại không thuộc tập có hai thành phần giá trị thực dương ở trên.&lt;/p&gt;

&lt;p&gt;Chúng ta nói tập hợp các vectơ dương này có tính bao đóng với phép cộng chứ không có tính bao đóng với phép nhân.&lt;/p&gt;

&lt;p&gt;Nếu tập hợ các vectơ có tính bao đóng dưới tổ hợp tuyến tính (với cả phép cộng và phép nhân với bất kì số thực nào), và nếu phép nhân và phép cộng hoạt động theo cách này, thì chúng ta gọi tập hợp đó là không gian vectơ.&lt;/p&gt;

&lt;h3 id=&quot;subspaces---không-gian-vectơ-con&quot;&gt;Subspaces - không gian vectơ con&lt;/h3&gt;

&lt;p&gt;Một không gian vectơ được chứa bên trong một không gian vectơ khác được gọi là không gian con của không gian đó. Ví dụ: lấy bất kì vectơ khác \(\vec 0\) bào trong \(\mathbb{R}^2\). Thì tập hợp các vectơ \(c\vec v\) (\(c\) là số thực), tạo thành một không gian con của \(\mathbb{R}^2\).Tập hợp các vectơ này mô tả một đường thẳng qua \(\begin{bmatrix}0 \\ 0\end{bmatrix}\) trong \(\mathbb{R}^2\) và được đóng kín đối với phép cộng.&lt;/p&gt;

&lt;p&gt;Không gian vectơ con của \(\mathbb{R}^2\) là:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;\(\mathbb{R}^2\)&lt;/li&gt;
  &lt;li&gt;\(\theta =(0,0)\)&lt;/li&gt;
  &lt;li&gt;đường thẳng qua \(\begin{bmatrix}0 \\ 0\end{bmatrix}\)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Không gian vectơ con của \(\mathbb{R}^3\) là:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;\(\mathbb{R}^3\)&lt;/li&gt;
  &lt;li&gt;\(\theta =(0,0,0)\)&lt;/li&gt;
  &lt;li&gt;đường thẳng qua gốc tọa độ&lt;/li&gt;
  &lt;li&gt;mặt phẳng qua gốc tọa độ&lt;/li&gt;
&lt;/ul&gt;

&lt;h3 id=&quot;column-space&quot;&gt;Column space&lt;/h3&gt;

&lt;p&gt;Cho ma trận \(A\) với các cột thuộc \(\mathbb{R}^3\), các cột này và tổ hợp tuyến tính của chúng tạo thành một không gian vectơ con của \(\mathbb{R}^3\). Đây là không gian vectơ cột \(C(A)\). Nếu \(A=\begin{bmatrix}1 &amp;amp; 3 \\ 2 &amp;amp; 3 \\ 4 &amp;amp; 1\end{bmatrix}\), không gian vectơ cột của \(A\) là mặt phẳng đi qua gốc tọa độ của \(\mathbb{R}^3\) chứa \(\begin{bmatrix}1 \\ 2 \\ 4\end{bmatrix}\) và \(\begin{bmatrix}3 \\ 3 \\ 1\end{bmatrix}\).&lt;/p&gt;

&lt;hr /&gt;
&lt;blockquote&gt;
  &lt;p&gt;&lt;a href=&quot;https://ocw.mit.edu&quot;&gt;MIT OpenCourseWare&lt;/a&gt;&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;18.06SC Linear Algebra&lt;/strong&gt; / Fall 2011&lt;/p&gt;

  &lt;p&gt;&lt;a href=&quot;https://ocw.mit.edu/terms/&quot;&gt;Terms of Use&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;</content><author><name>NGUYEN DINH QUANG</name><email>quangnd.hust@gmail.com</email></author><category term="Mathematics" /><category term="linear algebra" /><category term="OCW" /><summary type="html">Permutations</summary></entry><entry><title type="html">Factorization into A = LU [4]</title><link href="https://qndev.github.io/mathematics/2019/12/07/factorization-into-a-equal-lu/" rel="alternate" type="text/html" title="Factorization into A = LU [4]" /><published>2019-12-07T00:00:00+00:00</published><updated>2019-12-07T00:00:00+00:00</updated><id>https://qndev.github.io/mathematics/2019/12/07/factorization-into-a-equal-lu</id><content type="html" xml:base="https://qndev.github.io/mathematics/2019/12/07/factorization-into-a-equal-lu/">&lt;h3 id=&quot;inverse-of-a-product---nghịc-đảo-của-tích-ma-trận&quot;&gt;Inverse of a product - nghịc đảo của tích ma trận&lt;/h3&gt;

&lt;p&gt;Nghịch đảo của tích hai ma trận \(AB\) đó là \(B^{-1}A^{-1}\)&lt;/p&gt;

&lt;h3 id=&quot;transpose-of-a-product---chuyển-vị&quot;&gt;Transpose of a product - chuyển vị&lt;/h3&gt;

&lt;p&gt;Chúng ta có thể thu được chuyển vị của ma trận bằng cách hoán đổi các hàng và cột của nó. Hay nói theo cách khác đó là phần tử ở hàng \(i\) cột \(j\) của ma trận \(A\) sẽ là phần tử ở hàng \(j\) cột \(i\) của ma trận \(A^{T}\).&lt;/p&gt;

&lt;p&gt;Chuyển vị của tích ma trận \(AB\) là \(B^{T}A^{T}\). Đối với bất kì ma trận khả nghịch \(A\), thì nghịc đảo của \(A^{T}\) là \((A^{-1})^T\):&lt;/p&gt;

&lt;p&gt;\[
(A^{T})^{-1}=(A.A^{-1})^T.(A^T)^{-1}=(A^{-1})^T.(A^T).(A^T)^{-1}=(A^{-1})^T
\]&lt;/p&gt;

&lt;h3 id=&quot;a--lu&quot;&gt;A = LU&lt;/h3&gt;

&lt;p&gt;Chúng ta đã biết cách sử dụng phương pháp khử để chuyển đổi một ma trận \(A\) phù hợp thành một ma trận tam giác trên \(U\). Điều này dẫn đến phân tích thành nhân tử \(A\) thành \(LU\), điều mà rất hữu ích cho việc hiểu về ma trận \(A\).&lt;/p&gt;

&lt;p&gt;Nhớ lại rằng chúng ta có thể mô tả phương pháp khử các phần tử của ma trận \(A\) (trong trường hợp không có việc hoán đổi các hàng trong khi thực hiện phép khử) theo cách nhân với một chuỗi các ma trận loại bỏ \(E_{ij}\), vì vậy \(A\to E_{21}A \to E_{31}E_{21} \to \cdots \to U\). Trong trường hợp ma trận kích thước \(2 \times 2\) như sau:&lt;/p&gt;

&lt;p&gt;\[
E_{21}A=U \sim \begin{bmatrix}1 &amp;amp; 0 \\ -4 &amp;amp; 1\end{bmatrix}\begin{bmatrix}2 &amp;amp; 1 \\ 8 &amp;amp; 7\end{bmatrix}=\begin{bmatrix}2 &amp;amp; 1 \\ 0 &amp;amp; 3\end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;Chúng ta có thể chuyển đổi thành \(A=LU\) bằng cách loại bỏ ma trận \(E_{21}\); để làm đuược điều đó ta nhân hai vế của biểu thức với \(E_{21}A=U\) với ma  trận nghịch đảo của nó \(E_{21}^{-1}\): \(E_{21}^{-1}E_{21}A=E_{21}^{-1}U\).&lt;/p&gt;

&lt;p&gt;\[
A=LU\sim\begin{bmatrix}2 &amp;amp; 1 \\ 8 &amp;amp; 7\end{bmatrix}=\begin{bmatrix}1 &amp;amp; 0 \\ 4 &amp;amp; 1\end{bmatrix}\begin{bmatrix}2 &amp;amp; 1 \\ 0 &amp;amp; 3\end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;Ma trận \(U\) là ma trận tam giác trên với các phần tử chốt trên đường chéo. Ma trận \(L\) là ma trận tam giác dưới và cũng có các phần tử \(1\) trên đường chéo. Đôi khi chúng ta cũng sẽ muốn tạo ra một ma trận đường chéo mà các phần tử là phần tử chốt:&lt;/p&gt;

&lt;p&gt;\[
A=LDU^{\mathbf’}\sim\begin{bmatrix}2 &amp;amp; 1 \\ 8 &amp;amp; 7\end{bmatrix}=\begin{bmatrix}1 &amp;amp; 0 \\ 4 &amp;amp; 1\end{bmatrix}\begin{bmatrix}2 &amp;amp; 0 \\ 0 &amp;amp; 3\end{bmatrix}\begin{bmatrix}1 &amp;amp; 1/2 \\ 0 &amp;amp; 1\end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;Trong trường hợp không gian ba chiều, nếu \(E_{32}E_{31}E_{21}A=U\) thì \(A=E_{21}^{-1}E_{31}^{-1}E_{32}^{-1}U=LU\).&lt;/p&gt;

&lt;p&gt;Ví dụ, giả sử \(E_{31}\) là ma trận đơn vị và \(E_{32}\), \(E_{21}\) là hai ma trận dưới đây:&lt;/p&gt;

&lt;p&gt;\[
E_{32}E_{21}=E \sim \begin{bmatrix}1 &amp;amp; 0 &amp;amp; 0\\ 0 &amp;amp; 1 &amp;amp; 0 \\ 0 &amp;amp; -5 &amp;amp; 1\end{bmatrix}\begin{bmatrix}1 &amp;amp; 0 &amp;amp; 0\\ -2 &amp;amp; 1 &amp;amp; 0 \\ 0 &amp;amp; 0 &amp;amp; 1\end{bmatrix}=\begin{bmatrix}1 &amp;amp; 0 &amp;amp; 0\\ -2 &amp;amp; 1 &amp;amp; 0 \\ 10 &amp;amp; -5 &amp;amp; 1\end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;Phần tử \(10\) mới xuất hiện góc trái do ta trừ 2 lần dòng nhất từ dòng thứ hai, sau đó trừ 5 lần dòng mới thứ hai từ dòng thứ ba.&lt;/p&gt;

&lt;p&gt;Phép phân tích thành nhân tử \(A=LU\) thích hợp hơn so với phép biến đổi \(EA=U\) bởi vì tổ hợp các phép trừ của các hàng không có tác động lên \(L\) như nó đã làm đối với \(E\). Và \(L=E^{-1}=E_{21}^{-1}E_{32}^{-1}\).&lt;/p&gt;

&lt;p&gt;\[
E_{21}^{-1}E_{32}^{-1}=L \sim \begin{bmatrix}1 &amp;amp; 0 &amp;amp; 0\\ 2 &amp;amp; 1 &amp;amp; 0 \\ 0 &amp;amp; 0 &amp;amp; 1\end{bmatrix}\begin{bmatrix}1 &amp;amp; 0 &amp;amp; 0\\ 0 &amp;amp; 1 &amp;amp; 0 \\ 0 &amp;amp; 5 &amp;amp; 1\end{bmatrix}=\begin{bmatrix}1 &amp;amp; 0 &amp;amp; 0\\ 2 &amp;amp; 1 &amp;amp; 0 \\ 0 &amp;amp; 5 &amp;amp; 1\end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;Để ý rằng phần tử \(0\) ở hàng ba cột một của ma trận \(L=E^{-1}\), nơi mà có phần tử \(10\) của \(E\). Nếu không có sự tráo đổi hàng. các số nhân của ma trận loại bỏ được sao chép trực tiếp vào \(L\).&lt;/p&gt;

&lt;h3 id=&quot;how-expensive-is-elimination&quot;&gt;How expensive is elimination?&lt;/h3&gt;

&lt;p&gt;Một vài ứng dụng yêu cầu nghịch đảo các ma trận có kích thước rất lớn. Việc này thực hiện được là nhờ máy tính. Làm thế nào chúng ta có thể biết được máy tính làm viêc vất vả như thế nào? Chúng tốn bao nhiêu thời gian?&lt;/p&gt;

&lt;p&gt;Có bao nhiêu phép tính mà máy tính thực thiện trong suốt quá trình thực thi phép khử đối với ma trận \(n\times n\)? Phép toán đặc trưng đó là phép nhân một hàng và sau đó trừ nó bởi hàng khác, đòi hỏi theo thứ tự của \(n\) phép tính. Có \(n\) hàng vì vậy tổng số phép toán sử dụng để khử các phần tử ở cột thứ nhất là \(n^2\). Dòng thứ hai và cột thứ hai thì có tổng số phép tính ít hơn với chi phí vào khoảng \(((n-1)^2\)) và tiếp tục với các hàng và cột khác của ma trận \(n\times n\). Như vậy tổng cộng chi phí hay số phép toán cần thực hiện để biến đổi \(A\) thành \(LU\) theo thứ tự là \(n^3\):&lt;/p&gt;

&lt;p&gt;\[
1^2+2^2+\cdots+(n-1)^2+n^2=\sum_{i=1}^n i^2\approx\displaystyle \int_0^nx^2dx=\frac{1}{3}n^3
\]&lt;/p&gt;

&lt;p&gt;Trong khi chúng ta thực hiện phép biến đổi \(A\) đồng thời chúng ta cũng thực hiện trên \(\mathbf{b}\) với chi phí là \(n^2\) (chi phí này không đáng kể so với \(n^3\)).&lt;/p&gt;

&lt;h3 id=&quot;row-exchanges&quot;&gt;Row exchanges&lt;/h3&gt;

&lt;p&gt;Điều gì sẽ xảy ra nếu cần phải hoán đổi các hàng với nhau trong khi thực hiện phép khử hay nói theo cách khác đó là điều gì sẽ xảy ra nếu có phần tử \(0\) ở vị trí chốt?&lt;/p&gt;

&lt;p&gt;Để hoán đổi vị trí hai hàng với nhau ta nhân vào bên trái với ma trận hoán vị, ví dụ: Ma trận \(P_{12}=\begin{bmatrix}0 &amp;amp; 1 &amp;amp; 0\\ 1 &amp;amp; 0 &amp;amp; 0 \\ 0 &amp;amp; 0 &amp;amp; 1\end{bmatrix}\) hoán đổi hàng một và hai của ma trận \(3\times 3\). Nghịch đảo của ma trận \(P\) là \(P^{-1}=P^T\).&lt;/p&gt;

&lt;p&gt;Có \(n!\) cách khác nhau để hoán đổi các hàng của ma trận \(n\times n\) vì vậy sẽ có \(n!\) ma trận hoán vị.&lt;/p&gt;

&lt;hr /&gt;
&lt;blockquote&gt;
  &lt;p&gt;&lt;a href=&quot;https://ocw.mit.edu&quot;&gt;MIT OpenCourseWare&lt;/a&gt;&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;18.06SC Linear Algebra&lt;/strong&gt; / Fall 2011&lt;/p&gt;

  &lt;p&gt;&lt;a href=&quot;https://ocw.mit.edu/terms/&quot;&gt;Terms of Use&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;</content><author><name>NGUYEN DINH QUANG</name><email>quangnd.hust@gmail.com</email></author><category term="Mathematics" /><category term="linear algebra" /><category term="OCW" /><summary type="html">Inverse of a product - nghịc đảo của tích ma trận</summary></entry><entry><title type="html">Elimination with matrices [2]</title><link href="https://qndev.github.io/mathematics/2019/12/04/elimination-with-matrices/" rel="alternate" type="text/html" title="Elimination with matrices [2]" /><published>2019-12-04T00:00:00+00:00</published><updated>2019-12-04T00:00:00+00:00</updated><id>https://qndev.github.io/mathematics/2019/12/04/elimination-with-matrices</id><content type="html" xml:base="https://qndev.github.io/mathematics/2019/12/04/elimination-with-matrices/">&lt;h3 id=&quot;method-of-elimination&quot;&gt;Method of Elimination&lt;/h3&gt;

&lt;p&gt;Phép khử là kỹ thuật được sử dụng bởi hầu hết các phần mềm máy tính để giải hệ phương trình tuyến tính. Nó tìm nghiệm \(\mathbf{x}\) của \(A\mathbf{x}=b\) khi ma trận \(A\) là ma trận nghịch đảo. Ví dụ:&lt;/p&gt;

&lt;p&gt;\[A=\begin{bmatrix}\boxed 1 &amp;amp; 2 &amp;amp; 1 \\ 3 &amp;amp; 8 &amp;amp; 1 \\ 0 &amp;amp; 4 &amp;amp; 1\end{bmatrix} and \; \mathbf{b}=\begin{bmatrix}2 \\ 12 \\ 2\end{bmatrix}\]&lt;/p&gt;

&lt;p&gt;Số \(1\) mà ta đánh dấu trong ô vuông của ma trận \(A\) ở trên được gọi là phần tử chốt đầu tiên. Chúng ta lấy dòng đầu tiên rồi sau đó nhân từng phần tử của dòng với một số thích hợp (trong trường hợp này là \(3\)) rồi trừ đi các giá trị tương ứng của dòng thứ hai. Phần tử đầu tiên của dòng thứ hai sẽ bằng \(0\). Như vậy ta đã thực hiện phép khử phần tử \(3\) của dòng hai và cột một.&lt;/p&gt;

&lt;p&gt;Bước tiếp theo ta thực hiện phép khử khác để biến phần tử ở hàng ba và cột một thành \(0\). Phần tử chốt thứ hai bây giờ xuất hiện tại vị trí hàng hai cột hai. Tiến hành tìm phần tử (trong trường hợp này là số \(2\)) để nhân với hàng hai để loại bỏ \(4\) ở hàng ba cột hai. Ta thu được phần tử chốt thứ ba là \(5\) ở vị trí hàng 3 cột 3 sau khi tiến hành lấy hàng ba trừ 2 nhân với hàng hai.&lt;/p&gt;

&lt;p&gt;Như vậy chúng ta bắt đầu bằng ma trận khả nghịch \(A\) và biến nó thnahf ma trận tam giác trên \(U\), các phần tử bên trái phía dưới của \(U\) đều bằng \(0\) và các phần tử chốt \(1, 2, 5\) trên đường chéo của \(U\).&lt;/p&gt;

&lt;p&gt;\[
A=\begin{bmatrix}\boxed 1 &amp;amp; 2 &amp;amp; 1 \\ 3 &amp;amp; 8 &amp;amp; 1 \\ 0 &amp;amp; 4 &amp;amp; 1\end{bmatrix} \to \begin{bmatrix}\boxed 1 &amp;amp; 2 &amp;amp; 1 \\ 0 &amp;amp; \boxed 2 &amp;amp; -2 \\ 0 &amp;amp; 4 &amp;amp; 1\end{bmatrix} \to U=\begin{bmatrix}\boxed 1 &amp;amp; 2 &amp;amp; 1 \\ 0 &amp;amp; \boxed 2 &amp;amp; -2 \\ 0 &amp;amp; 0 &amp;amp; \boxed 5\end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;Chúng ta cũng thực hiện các phép khử tương ứng của ma trận \(A\) đối với vector \(\mathbf{b}=\begin{bmatrix}2 \\ 12 \\ 2\end{bmatrix}\).&lt;/p&gt;

&lt;p&gt;Phép khử đã biến phương trình \(A\mathbf{x}=\mathbf{b}\) thành \(U\mathbf{x}=\mathbf{c}\), trong ví dụ trên \(U=\begin{bmatrix}1 &amp;amp; 2 &amp;amp; 1 \\ 0 &amp;amp; 2 &amp;amp; -2 \\ 0 &amp;amp; 0 &amp;amp; 5\end{bmatrix}\) được biến đổi từ \(A\) và \(\mathbf{c}=\begin{bmatrix}2 \\ 6 \\ -10\end{bmatrix}\) từ \(\mathbf{b}\).&lt;/p&gt;

&lt;p&gt;Phương trình \(U\mathbf{x}=\mathbf{c}\) rõ ràng là dễ giải hơn bằng cách thay thế ngược các ẩn số từ dưới lên, trong ví dụ với phương trình này ta có thể viết thành hệ phương trình tuyến tính với 3 ẩn số \(\mathbf{x}=\begin{bmatrix}x \\ y \\ z\end{bmatrix}\):&lt;/p&gt;

&lt;p&gt;\[
\left\{\begin{array}{rl}
x + 2y + z &amp;amp; = 2 \&lt;br /&gt;
2y -2z &amp;amp; = 6 \&lt;br /&gt;
5z &amp;amp; = -10
\end{array}\right. \to z=-2, y=1, x=2
\]&lt;/p&gt;

&lt;p&gt;Nghiệm \(\mathbf{x^T}=(2,1,-2)\) cũng là nghiệm của phương trình \(A\mathbf{x}=\mathbf{b}\).&lt;/p&gt;

&lt;p&gt;Ta có định thức của \(U\) là tích của các phần tử chốt trên đường chéo. Các phần tử chốt này phải khác không, nếu có phần tử \(0\) tại vị trí chốt thì ta cần hoán đổi hàng đó với hàng không có phần tử \(0\) tại vị trí chốt. Nếu không có hàng nào thỏa mãn sau khi hoán đổi thì ma trận \(A\) không khả nghịch. Việc khử không được sử dụng để tìm một nghiệm duy nhất vì nó không tồn tại.&lt;/p&gt;

&lt;h3 id=&quot;elimination-matrices&quot;&gt;Elimination Matrices&lt;/h3&gt;

&lt;p&gt;Tích của ma trận (3x3) và vector cột (3x1) là một vector (3x1) đó là tổ hợp tuyến tính các cột của ma trận.&lt;/p&gt;

&lt;p&gt;Tích của một hàng (1x3) và ma trận (3x3) là một hàng (1x3) là tổ hợp tuyến tính của các hàng của ma trận.&lt;/p&gt;

&lt;p&gt;Việc phép khử để lấy phần tử chốt thứ hai bằng cách trừ 3 lần hàng một từ hàng hai (nghĩa là \(row(2)=-3.row(1)+row(2))\) tương đương với việc tính tích của hai ma trận dưới đây:&lt;/p&gt;

&lt;p&gt;\[
\begin{bmatrix}1 &amp;amp; 0 &amp;amp; 0 \\ -3 &amp;amp; 1 &amp;amp; 0 \\ 0 &amp;amp; 0 &amp;amp; 1\end{bmatrix}\begin{bmatrix}1 &amp;amp; 2 &amp;amp; 1 \\ 3 &amp;amp; 8 &amp;amp; 1 \\ 0 &amp;amp; 4 &amp;amp; 1\end{bmatrix}=\begin{bmatrix}1 &amp;amp; 2 &amp;amp; 1 \\ 0 &amp;amp; \boxed 2 &amp;amp; -2 \\ 0 &amp;amp; 4 &amp;amp; 1\end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;Ma trận khử được dùng để khử các phần tử ở hàng \(m\) cột \(n\) được kí hiệu là \(E_{mn}\). Việc tính toán trên đưa ma trận từ \(A\) thành \(E_{21}A\). Ba bước khử ở trên dẫn đến \(U\): \(E_{32}(E_{31}(E_{21}A))=U\) với \(E_{31}=I\), do đó:&lt;/p&gt;

&lt;p&gt;\[E_{32}(E_{21}A)=U\]&lt;/p&gt;

&lt;p&gt;Phép nhân ma trận có tính chất kết hợp vì vậy ta cũng có thể viết \((E_{32}E_{21})A=U\). Tích của hai ma trận \(E_{32}E_{21}\) cho chúng ta biết cách để biến đổi ma trận \(A\) thành ma trận \(U\). Nghịch đảo của ma trận \(E_{32}E_{21}\) cho chúng ta biết cách để biến đổi ma trận \(U\) thành ma trận \(A\).&lt;/p&gt;

&lt;p&gt;\[{(E_{32}E_{21})}^{-1}(E_{32}E_{21})A={(E_{32}E_{21})}^{-1}U) \sim A={(E_{32}E_{21})}^{-1}U\]&lt;/p&gt;

&lt;p&gt;Nếu chúng ta giải phương trình \(U\mathbf{x}=EA\mathbf{x}=E\mathbf{b}\), thì cũng đồng nghĩa với việc chúng ta giải phương trình \(A\mathbf{x}=\mathbf{b}\). Đây là lý do tại sao phương pháp khử hoạt động: tất cả các bước có thể được đảo ngược.&lt;/p&gt;

&lt;p&gt;Một ma trận hoán vị trao đổi hai hàng của một ma trận; ví dụ:&lt;/p&gt;

&lt;p&gt;\[
\begin{bmatrix}0 &amp;amp; 1 &amp;amp; 0 \\ 1 &amp;amp; 0 &amp;amp; 0 \\ 0 &amp;amp; 0 &amp;amp; 1\end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;Hàng thứ nhất và hàng thứ hai của ma trận \(PA\) tương ứng là hàng thứ hai và hàng thứ nhất của ma trận \(A\). Ma trận \(P\) được xây dựng bằng cách trao đổi các hàng của ma trận đơn vị.&lt;/p&gt;

&lt;p&gt;Để trao đổi các cột của ma trận ta thực hiện bằng cách nhân vào bên phải của ma trận đó (như trong \(AP\) với ma trận hoán vị. Lưu ý rằng phép nhân ma trận không có tính chất giao hoán: \(PA\ne AP\).&lt;/p&gt;

&lt;h3 id=&quot;inverses&quot;&gt;Inverses&lt;/h3&gt;

&lt;p&gt;Chúng ta có ma trận:&lt;/p&gt;

&lt;p&gt;\[
E_{21}=\begin{bmatrix}1 &amp;amp; 0 &amp;amp; 0 \\ -3 &amp;amp; 1 &amp;amp; 0 \\ 0 &amp;amp; 0 &amp;amp; 1\end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;bằng cách \(row(2)-3.row(1)\), hay nói cách khác đó là phép biến đổi ma trận \(A\) ở ví dụ trên thành ma trận \(E_{21}A=\begin{bmatrix}1 &amp;amp; 2 &amp;amp; 1 \\ 0 &amp;amp; 2 &amp;amp; -2 \\ 0 &amp;amp; 4 &amp;amp; 1\end{bmatrix}\). Để hòa tác lại thao tác tính toán, biến đổi này hay biến ma trận \(E_{21}A\) trở lại ma trận \(A\) chúng ta cần sử dụng ma trận nghịc đảo:&lt;/p&gt;

&lt;p&gt;\[
E_{21}^{-1}=\begin{bmatrix}1 &amp;amp; 0 &amp;amp; 0 \\ 3 &amp;amp; 1 &amp;amp; 0 \\ 0 &amp;amp; 0 &amp;amp; 1\end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;Và trong thực tế thì \(E_{21}^{-1}E_{21}=I\).&lt;/p&gt;

&lt;hr /&gt;
&lt;blockquote&gt;
  &lt;p&gt;&lt;a href=&quot;https://ocw.mit.edu&quot;&gt;MIT OpenCourseWare&lt;/a&gt;&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;18.06SC Linear Algebra&lt;/strong&gt; / Fall 2011&lt;/p&gt;

  &lt;p&gt;&lt;a href=&quot;https://ocw.mit.edu/terms/&quot;&gt;Terms of Use&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;</content><author><name>NGUYEN DINH QUANG</name><email>quangnd.hust@gmail.com</email></author><category term="Mathematics" /><category term="linear algebra" /><category term="OCW" /><summary type="html">Method of Elimination</summary></entry><entry><title type="html">Multiplication and inverse matrices [3]</title><link href="https://qndev.github.io/mathematics/2019/12/04/multiplication-and-inverse-matrices/" rel="alternate" type="text/html" title="Multiplication and inverse matrices [3]" /><published>2019-12-04T00:00:00+00:00</published><updated>2019-12-04T00:00:00+00:00</updated><id>https://qndev.github.io/mathematics/2019/12/04/multiplication-and-inverse-matrices</id><content type="html" xml:base="https://qndev.github.io/mathematics/2019/12/04/multiplication-and-inverse-matrices/">&lt;h3 id=&quot;matrix-multiplication---phép-nhân-ma-trận&quot;&gt;Matrix Multiplication - Phép nhân ma trận&lt;/h3&gt;

&lt;p&gt;Ta có tích của hai ma trận \(AB=C\), với \(A\) là ma trận \(m\)x\(n\), \(B\) là ma trận \(n\)x\(p\) thì \(C\) là ma trận \(m\)x\(p\). Chúng ta sẽ sử dụng \(c_{ij}\) để kí hiệu cho các giá trị ở hàng \(i\) và cột \(j\) của ma trận \(C\).&lt;/p&gt;

&lt;h4 id=&quot;standard-row-times-column---hàng-nhân-cột&quot;&gt;Standard (row times column) - hàng nhân cột&lt;/h4&gt;

&lt;p&gt;Cách cơ bản để miêu tả phép nhân ma trận đó là các giá trị \(c_{ij}\) bằng tích của hàng \(i\) của ma trận \(A\) và cột \(j\) của ma trận \(B\). Hay nói cách khác:&lt;/p&gt;

&lt;p&gt;\[
c_{ij}=\sum_{k=1}^n a_{ik}b_{kj}
\]&lt;/p&gt;

&lt;h4 id=&quot;columns---theo-cột&quot;&gt;Columns - theo cột&lt;/h4&gt;

&lt;p&gt;Tích của ma trận \(A\) và cột \(j\) của ma trận \(B\) bằng cột \(j\) của ma trận \(C\). Điều này cho chúng ta biết rằng các cột của ma trận \(C\) là tổ hợp các cột của ma trận \(A\).&lt;/p&gt;

&lt;h4 id=&quot;rows---theo-hàng&quot;&gt;Rows - theo hàng&lt;/h4&gt;

&lt;p&gt;Tích của hàng \(i\) của ma trận \(A\) và ma trận \(B\) bằng hàng \(i\) của ma trận \(C\). Vì vậy các hàng của ma trận \(C\) là tổ hợp các hàng của ma trận \(B\).&lt;/p&gt;

&lt;h4 id=&quot;column-times-row---cột-nhân-hàng&quot;&gt;Column times row - cột nhân hàng&lt;/h4&gt;

&lt;p&gt;Một cột của ma trận \(A\) là vector \(m\)x\(1\) và hàng của ma trận \(B\) là một vector \(1\)x\(p\). Tích của chúng là ma trận:&lt;/p&gt;

&lt;p&gt;\[
\begin{bmatrix}2 \\ 3 \\ 4\end{bmatrix}\begin{bmatrix}1 &amp;amp; 6\end{bmatrix}=\begin{bmatrix}2 &amp;amp; 12 \\ 3 &amp;amp; 18 \\ 4 &amp;amp; 24\end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;Như vậy ta thấy các cột của ma trận \(\begin{bmatrix}2 &amp;amp; 12 \\ 3 &amp;amp; 18 \\ 4 &amp;amp; 24\end{bmatrix}\) là phép nhân của cột \(\begin{bmatrix}2 \\ 3 \\ 4\end{bmatrix}\)của ma trận \(A\) và các hàng của ma trận \(\begin{bmatrix}2 &amp;amp; 12 \\ 3 &amp;amp; 18 \\ 4 &amp;amp; 24\end{bmatrix}\) là phép nhân của hàng \(\begin{bmatrix}1 &amp;amp; 6\end{bmatrix}\) của ma trận \(B\).&lt;/p&gt;

&lt;p&gt;Nếu chúng ta nghĩ về các giá trị, phần tử trong các hàng của ma trận này như những tọa độ điểm \((2,12)\), \((3,18)\), \((4,24)\), tất cả các điểm này cùng nằm trên một đường thẳng, tương tự như hai vector cột với hai điểm có tọa độ \((2,3,4)\) và \((12,18,24)\).&lt;/p&gt;

&lt;p&gt;Như vậy \(AB=\sum_{k=1}^n \begin{bmatrix}a_{1k} \\ . \\ . \\ . \\ a_{mk}\end{bmatrix}\begin{bmatrix}b_{k1} &amp;amp; \ldots &amp;amp; b_{kn}\end{bmatrix}\).&lt;/p&gt;

&lt;h4 id=&quot;blocks---khối&quot;&gt;Blocks - khối&lt;/h4&gt;

&lt;p&gt;Nếu chúng ta chia ma trận \(A\) và \(B\) ra thành các khối khớp nhau, chúng ta có thể viết tích \(AB\) dưới dạng của tích các khối:&lt;/p&gt;

&lt;p&gt;\[
\begin{bmatrix}A_1 &amp;amp; A_2 \\ A_3 &amp;amp; A_4\end{bmatrix}\begin{bmatrix}B_1 &amp;amp; B_2 \\ B_3 &amp;amp; B_4\end{bmatrix}=\begin{bmatrix}C_1 &amp;amp; C_2 \\ C_3 &amp;amp; C_4\end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;Và \(C_1=A_1B_1+A_2B_3\).&lt;/p&gt;

&lt;h3 id=&quot;inverses---nghịch-đảo-ma-trận&quot;&gt;Inverses - nghịch đảo ma trận&lt;/h3&gt;

&lt;h4 id=&quot;square-matrices---ma-trận-vuông&quot;&gt;Square matrices - ma trận vuông&lt;/h4&gt;

&lt;p&gt;Nếu \(A\) là ma trận vuông, thì câu hỏi quan trọng nhất mà bạn có thể hỏi về nó là liệu \(A\) có ma trận nghich đảo \(A^{-1}\). Nếu câu trả lời là có, thì \(A^{-1}A=I=A^{-1}\) và chúng ta có thể nói rằng ma trận \(A\) là khả nghịch hay không suy biến.&lt;/p&gt;

&lt;p&gt;Nếu ma trận \(A\) là ma trận suy biến. Ma trận \(A\) không có ma trận nghịc đảo - định thức của nó bằng \(0\) và chúng ta có thể tìm thấy một vài vector \(\mathbf{x}\) để \(A\mathbf{x}=0\). Ví dụ:&lt;/p&gt;

&lt;p&gt;\[
\begin{bmatrix}1 &amp;amp; 3 \\ 2 &amp;amp; 6\end{bmatrix}\begin{bmatrix}3 \\ -1\end{bmatrix}=\begin{bmatrix}0 \\ 0\end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;Trong ví dụ này \(3.\begin{bmatrix}1 \\ 2\end{bmatrix}-1.\begin{bmatrix}3 \\ 6\end{bmatrix}=\begin{bmatrix}0 \\ 0\end{bmatrix}\) và cả hai vector cột trong ma trận đó đều nằm trên một đường thẳng.&lt;/p&gt;

&lt;p&gt;Việc tìm kiếm ma trận nghịch đảo gần như liên quan đến việc giải hệ phương trình tuyến tính:&lt;/p&gt;

&lt;p&gt;\[
\begin{bmatrix}1 &amp;amp; 3 \\ 2 &amp;amp; 7\end{bmatrix}\begin{bmatrix}a &amp;amp; c \\ b &amp;amp; d\end{bmatrix}=\begin{bmatrix}1 &amp;amp; 0 \\ 0 &amp;amp; 1\end{bmatrix}\sim AA^{-1}=I
\]&lt;/p&gt;

&lt;p&gt;có thể đọc như việc nói “\(A\) nhân với cột \(j\) của ma trận \(A^{-1}\) bằng cột \(j\) của ma trận đơn vị”. Đay chỉ là một dạng đặc biệt của phương trình \(A\mathbf{x}=\mathbf{b}\).&lt;/p&gt;

&lt;h3 id=&quot;gauss-jordan-elimination---phương-pháp-khử-gauss&quot;&gt;Gauss-Jordan Elimination - phương pháp khử Gauss&lt;/h3&gt;

&lt;p&gt;Chúng ta có thể sử dụng phương pháp khử để giải hai hay nhiều phương trình tuyến tính tại cùng một thời điểm.&lt;/p&gt;

&lt;p&gt;Ta chỉ cần đặt song song hai ma trận \(A\) và ma trận đơn vị \(I\) sau đó dùng hệ thống các phép biến đổi không suy biến đồng thời trên các hàng của \(A\) và \(I\) (thực chất của mỗi phép biến đổi chính là nhân cả \(A\) và \(I\) với cùng một ma trận không suy biến). Sau một số hữu hạn bước biến \(A\) thành \(I\) - thực chất là đưa ra ma trận \(E\) để \(EA=I\) còn ma trận \(I\) thì trở thành ma trận \(EI=E=A^{-1}\)
\((E \times \Big[ \ A \; \Big| \; I \ \Big] = \Big[ \ EA \; \Big| \; EI \ \Big] = \Big[ \ I \; \Big| \; E \ \Big])\).&lt;/p&gt;

&lt;p&gt;\[
\Big[ \ A \; \Big| \; I \ \Big] \to \Big[ \ I \; \Big| \; A^{-1} \ \Big]
\]&lt;/p&gt;

&lt;p&gt;\[
\left[ \begin{array}{cc|cc}
1 &amp;amp; 3 &amp;amp; 1 &amp;amp; 0 \&lt;br /&gt;
2 &amp;amp; 7 &amp;amp; 0 &amp;amp; 1 \&lt;br /&gt;
\end{array} \right] \to 
\left[ \begin{array}{cc|cc}
1 &amp;amp; 3 &amp;amp; 1 &amp;amp; 0 \&lt;br /&gt;
0 &amp;amp; 1 &amp;amp; -2 &amp;amp; 1 \&lt;br /&gt;
\end{array} \right] \to
\left[ \begin{array}{cc|cc}
1 &amp;amp; 0 &amp;amp; 7 &amp;amp; -3 \&lt;br /&gt;
0 &amp;amp; 1 &amp;amp; -2 &amp;amp; 1 \&lt;br /&gt;
\end{array} \right]
\]&lt;/p&gt;

&lt;p&gt;Một lần nữa chúng ta đã sử dụng phương pháp khử Gauss để biến ma trận ban đầu thành ma trận tam giác trên, và tiếp tục sử dụng ý tưởng của Jordan về việc khử các phần tử ở phía trên bên phải của ma trận.&lt;/p&gt;

&lt;p&gt;\[
A^{-1}=\begin{bmatrix}7 &amp;amp; -3 \\ -2 &amp;amp; 1\end{bmatrix}
\]&lt;/p&gt;

&lt;hr /&gt;
&lt;blockquote&gt;
  &lt;p&gt;&lt;a href=&quot;https://ocw.mit.edu&quot;&gt;MIT OpenCourseWare&lt;/a&gt;&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;18.06SC Linear Algebra&lt;/strong&gt; / Fall 2011&lt;/p&gt;

  &lt;p&gt;&lt;a href=&quot;https://ocw.mit.edu/terms/&quot;&gt;Terms of Use&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;</content><author><name>NGUYEN DINH QUANG</name><email>quangnd.hust@gmail.com</email></author><category term="Mathematics" /><category term="linear algebra" /><category term="OCW" /><summary type="html">Matrix Multiplication - Phép nhân ma trận</summary></entry><entry><title type="html">The Geometry of Linear Equations [1]</title><link href="https://qndev.github.io/mathematics/2019/12/03/the-geometry-of-linear-equations/" rel="alternate" type="text/html" title="The Geometry of Linear Equations [1]" /><published>2019-12-03T00:00:00+00:00</published><updated>2019-12-03T00:00:00+00:00</updated><id>https://qndev.github.io/mathematics/2019/12/03/the-geometry-of-linear-equations</id><content type="html" xml:base="https://qndev.github.io/mathematics/2019/12/03/the-geometry-of-linear-equations/">&lt;h3 id=&quot;the-geometry-of-linear-equations---ý-nghĩa-hình-học-của-phương-trình-tuyến-tính&quot;&gt;The geometry of linear equations - Ý nghĩa hình học của phương trình tuyến tính&lt;/h3&gt;

&lt;p&gt;Vấn đề cơ bản của đại số tuyến tính là giải hệ phương trình tuyến tính với \(n\) ẩn số; ví dụ:
\[
\left\{\begin{matrix}
2x - y = 0\&lt;br /&gt;
-x + 2y = 3
\end{matrix}\right.
\]&lt;/p&gt;

&lt;p&gt;Chúng ta sẽ tìm hiểu vấn đề này theo 3 cách. Hệ bên trên là hệ phương trình tuyến tính tring không gian vector hai chiều \((n=2)\).&lt;/p&gt;

&lt;h3 id=&quot;row-picture&quot;&gt;Row Picture&lt;/h3&gt;

&lt;p&gt;Nghiệm của hệ phương trình tuyến tính trên chính là giao điểm của hai đường thẳng đại diện cho hai phương trình trong hệ đó. Nhìn vào bức ảnh dưới đay ta có thể thấy \(x=1\), \(y=2\) là nghiệm của hệ phương trình.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/qndev/qndev.github.io/master/public/images/solution.png&quot; alt=&quot;Image: Nghiệm của hệ phương trình tuyến tính&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Để kiểm chứng lại nghiệm đó ta thây \((x,y)=(1,2)\) vào hệ:&lt;/p&gt;

&lt;p&gt;\[
\left\{\begin{matrix}
2.1 - 2 = 0\&lt;br /&gt;
-1 + 2.2 = 3
\end{matrix}\right.
\]&lt;/p&gt;

&lt;p&gt;Nghiệm của hệ phương trình tuyến tính trong không gian ba chiều là giao điểm của ba mặt phẳng(nếu hệ có nghiệm).&lt;/p&gt;

&lt;h3 id=&quot;column-picture&quot;&gt;Column Picture&lt;/h3&gt;

&lt;p&gt;Chúng ta sẽ xem hệ phương trình tuyến tính giống như một phương trình bằng cách biến các hệ số thành các vector:&lt;/p&gt;

&lt;p&gt;\[
x\begin{bmatrix}
2 \&lt;br /&gt;
-1
\end{bmatrix}+y\begin{bmatrix}
-1 \&lt;br /&gt;
2
\end{bmatrix}=\begin{bmatrix}
0 \&lt;br /&gt;
3
\end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;Cho hai vectors \(c\) và \(d\) và các số vô hướng \(x\) và \(y\), tổng \(xc+yd\) được gọi là tổ hợp tuyến tính của \(c\) và \(d\).&lt;/p&gt;

&lt;p&gt;Với \(x=1\) và \(y=2\) thì tổ hợp tuyến tính của hai vector \(\begin{bmatrix}2 \\ -1\end{bmatrix}\) và \(\begin{bmatrix}1 \\ -2\end{bmatrix}\) sẽ bằng vector \(\\(\begin{bmatrix}0 \\ 3\end{bmatrix}\)) được biểu diễn bằng hình ảnh dưới đây:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/qndev/qndev.github.io/master/public/images/columnpicture.gif&quot; alt=&quot;Image: Nghiệm của hệ phương trình tuyến tính&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Trong không gian vector ba chiều &lt;strong&gt;column picture&lt;/strong&gt; yêu cầu chúng ta phải tìm kiếm một tổ hợp tuyến tính của các vector 3 chiều sao cho chúng bằng vector \(b\).&lt;/p&gt;

&lt;h3 id=&quot;matrix-picture&quot;&gt;Matrix Picture&lt;/h3&gt;

&lt;p&gt;Chúng ta sẽ viết hệ phương trình tuyến tính \(\left\{\begin{matrix}2x - y = 0 \\ -x + 2y = 3\end{matrix}\right.\) thành một phương trình bằng cách sử dụng ma trận và vector:&lt;/p&gt;

&lt;p&gt;\[
\begin{bmatrix}2 &amp;amp; -1\\ -1 &amp;amp; 2\end{bmatrix}\begin{bmatrix}x \\ y\end{bmatrix}=\begin{bmatrix}0 \\ 3\end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;Ma trận \(A=\begin{bmatrix}2 &amp;amp; -1\\ -1 &amp;amp; 2\end{bmatrix}\) được gọi là ma trận hệ số. Vector \(x=\begin{bmatrix}x \\ y\end{bmatrix}\) là vector của ẩn số. Các giá trị phía bên tay phải của phương trình là vector \(b\)
\[Ax=b.\]&lt;/p&gt;

&lt;p&gt;Không gian ba chiều của matrix picture cũng giống như hai chiều ngoại trừ việc kích cỡ của vector và matrix được tăng lên.&lt;/p&gt;

&lt;h3 id=&quot;matrix-multiplication&quot;&gt;Matrix Multiplication&lt;/h3&gt;

&lt;p&gt;Làm sao chúng ta có thể nhân một ma trận \(A\) với một vector \(x\)?&lt;/p&gt;

&lt;p&gt;\[
\begin{bmatrix}2 &amp;amp; 5\\ 1 &amp;amp; 3\end{bmatrix}\begin{bmatrix}1 \\ 2\end{bmatrix}=\;?
\]&lt;/p&gt;

&lt;p&gt;Một cách mà ta có thể nghĩ tới đó là phần tử của \(x\) giống như các hệ số của một tổ hợp tuyến tính của các vector cột của ma trận:&lt;/p&gt;

&lt;p&gt;\[
\begin{bmatrix}2 &amp;amp; 5\\ 1 &amp;amp; 3\end{bmatrix}\begin{bmatrix}1 \\ 2\end{bmatrix}=1\begin{bmatrix}1 \\ 2\end{bmatrix}+2\begin{bmatrix}5 \\ 3\end{bmatrix}=\begin{bmatrix}12 \\ 7\end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;Kỹ thuật này sẽ biểu diễn \(Ax\) là một tổ hợp tuyến tính các cột của \(A\). Bạn cũng có thể thực hiện việc tính toán phép nhân \(Ax\) bằng cách nhân từng hàng của ma trận \(A\) với vector \(x\):&lt;/p&gt;

&lt;p&gt;\[
\begin{bmatrix}2 &amp;amp; 5\\ 1 &amp;amp; 3\end{bmatrix}\begin{bmatrix}1 \\ 2\end{bmatrix}=\begin{bmatrix}2.1 + 5.2\\ 1.1 + 3.2\end{bmatrix}=\begin{bmatrix}12 \\ 7\end{bmatrix}
\]&lt;/p&gt;

&lt;h3 id=&quot;linear-independence&quot;&gt;Linear Independence&lt;/h3&gt;

&lt;p&gt;Trong cột và bức tranh về ma trận, bên phải của phương trình là vector \(b\). Cho ma trận \(A\), chúng ta có thể giải được phương trình:
\[Ax=b\]
với mọi vector \(b\)? Hay nói cách khác là tổ hượp tuyến tính của các vector cột có thể bao phủ hết mặt phẳng tọa độ \(xy\) (hoặc không gian trong trường hợp không gian ba chiều)? Nếu câu trả lời là &lt;strong&gt;không&lt;/strong&gt;, chúng ta gọi \(A\) là ma trận suy biến. Trong trường hợp này các vector cột của nó là phụ thuộc tuyến tính; tất cả các tổ hợp tuyến tính nằm trên một điểm, đường thẳng (trong không gian hai chiều) hoặc trên một điểm, đường thẳng, mặt phẳng (trong không gian ba chiều). Các tổ hợp không bao phủ, lấp đầy toàn bộ không gian.&lt;/p&gt;

&lt;hr /&gt;
&lt;blockquote&gt;
  &lt;p&gt;&lt;a href=&quot;https://ocw.mit.edu&quot;&gt;MIT OpenCourseWare&lt;/a&gt;&lt;/p&gt;

  &lt;p&gt;&lt;strong&gt;18.06SC Linear Algebra&lt;/strong&gt; / Fall 2011&lt;/p&gt;

  &lt;p&gt;&lt;a href=&quot;https://ocw.mit.edu/terms/&quot;&gt;Terms of Use&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;hr /&gt;</content><author><name>NGUYEN DINH QUANG</name><email>quangnd.hust@gmail.com</email></author><category term="Mathematics" /><category term="linear algebra" /><category term="OCW" /><summary type="html">The geometry of linear equations - Ý nghĩa hình học của phương trình tuyến tính</summary></entry><entry><title type="html">Phương trình tuyến tính trong đại số tuyến tính - Notes</title><link href="https://qndev.github.io/mathematics/2019/11/30/linear-equation/" rel="alternate" type="text/html" title="Phương trình tuyến tính trong đại số tuyến tính - Notes" /><published>2019-11-30T00:00:00+00:00</published><updated>2019-11-30T00:00:00+00:00</updated><id>https://qndev.github.io/mathematics/2019/11/30/linear-equation</id><content type="html" xml:base="https://qndev.github.io/mathematics/2019/11/30/linear-equation/">&lt;h3 id=&quot;hệ-phương-trình-tuyến-tính&quot;&gt;Hệ phương trình tuyến tính&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Một phương trình tuyến tính&lt;/strong&gt; với các biến \(x_1,x_2,x_3,…,x_n\) trong phưowng trình có thể viết dưới dạng:
\[a_1x_1 + a_2x_2 + … + a_nx_n = b \tag{1}\]
trong đó \(b\) và các hệ số \(a_1,a_2,…,a_n\) là các số thực. Các chỉ số \(n\) là các số nguyên dương.
Ví dụ: Các phương trình:
\[-x_1 + 15x_1 + 4x_2 = 1996 \; và \; x_2 = 28x_1 +2x_3 + 15\]
là các phương trình tuyến tính bởi khi ta rút gọn chúng lạ ta có \(14x_1 + 4x_2 = 1996 \; và \; 28x_1 - x_2 +2x_3 = -15 \)có dạng (1).
Các phương trình: \(4x_1 - 5x_2 = x_1x_2 \; và \; x_2 = 2\sqrt{x_1} -6\) không phải là các phương trình tuyến tính.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hệ phương trình tuyến tính&lt;/strong&gt; hay hệ tuyến tính là tổ hợp của một hoặc nhiều phương trình tuyến tính có liên quan đến các biến giống nhau được gọi là \(x_1,x_2,…,x_n \).
Ví dụ: Ta có hệ phương trình: \[\begin{cases} 2x_1 - x_2 + 1.5x_3 = 8 \\ x_1 + 0x_2 - 4x_3 = -7 \end{cases} \tag{2}\]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lời giải của hệ&lt;/strong&gt; là danh sách \((s_1,s_2,s_3,…,s_n)\) các số mà tại đó làm thoả mãn từng phương trình trong hệ (các giá trị \(s_1,s_2,s_3,…,s_n\)) thay thế tương ứng chó các biến (\(x_1,x_2,x_3,…,x_n\)). Ví dụ: \((5,6.5,3)\) là lời giải cho hệ phương trình (2) bởi vì khi thay thế các số thực trên tương ứng với \(x_1,x_2,x_3\) của hệ ta được các phương trình luôn đúng: \(8 = 8 \; và -7 = -7\).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tất cả các lời giải&lt;/strong&gt; có thể thoả mãn hệ được gọi là tập lời giải (tập nghiệm). Hai hệ phương trình tuyến tính được gọi là tương đương nhau nếu chúng có cùng tập nghiệm.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chú ý:&lt;/strong&gt; Một hệ phương trình tuyến tính có thể có: không có nghiệm hoặc có chính xác một nghiệm duy nhất hoặc có vô số nghiệm.&lt;/p&gt;

&lt;p&gt;Ví dụ: Ta có hệ phương trình: \(\begin{cases} x_1 - 2x_2 = -1 \\ -x_1 + 3x_2 = 3 \; \end{cases}\) có nghiệm duy nhất.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/qndev/qndev.github.io/master/public/images/sysequation1.gif&quot; alt=&quot;Image: Hệ phương trình có nghiệm duy nhất&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Trong hệ trên hệ pt có cặp nghiệm \((x_1,x_2) = (3,2)\).&lt;/p&gt;

&lt;p&gt;Hệ phương trình: \(\begin{cases} x_1 - 2x_2 = -1 \\ -x_1 + 2x_2 = 3 \; \end{cases}\) không có nghiệm.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/qndev/qndev.github.io/master/public/images/sysequation2.gif&quot; alt=&quot;Image: Hệ phương trình không có nghiệm&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Hệ phương trình: \(\begin{cases} x_1 - 2x_2 = -1 \\ -x_1 + 2x_2 = 1 \; \end{cases}\) có vô số nghiệm.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/qndev/qndev.github.io/master/public/images/sysequation3.gif&quot; alt=&quot;Image: Hệ phương trình có vô số nghiệm&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Một hệ phương trình được gọi là thoả mãn nếu chúng hoặc có một nghiệm hoặc vô số nghiệm, hệ pt không thoả mãn nếu chúng vô nghiệm.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Kí hiệu ma trận&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Các thông tin cần thiết của một hệ phương trình tuyến tính có thể ghi lại gọn trong một hình chữ nhật bao gồm các hệ số của hệ phương trình được gọi là ma trận. Ta có hệ pt sau:
\[
\left\{
\begin{array}{ll}
x_1 - 2x_2 + x_3 &amp;amp;= 0 \&lt;br /&gt;
2x_2 - 8x_3 &amp;amp;= 8 \&lt;br /&gt;
5x_1 -5x_3 &amp;amp;= 10
\end{array}
\right.
\tag{3}\]&lt;/p&gt;

&lt;p&gt;Với các hệ số tương ứng với các biến của các cột như sau:
\(\begin{bmatrix}1 &amp;amp; -2 &amp;amp; 1 \\ 0 &amp;amp; 2 &amp;amp; -8 \\ 5 &amp;amp; 0 &amp;amp; -5 \end{bmatrix}\) ma trận các hệ số của hệ pt (3).&lt;/p&gt;

&lt;p&gt;Và ma trận \(\begin{bmatrix}1 &amp;amp; -2 &amp;amp; 1 &amp;amp; 0 \\ 0 &amp;amp; 2 &amp;amp; -8 &amp;amp; 8 \\ 5 &amp;amp; 0 &amp;amp; -5 &amp;amp; 10 \end{bmatrix}\) (4) được gọi là ma trận bổ sung của hệ.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chú ý:&lt;/strong&gt; Ở hàng 2 và hàng 3 của các ma trận trên có các phần tử 0 tương ứng với các hệ số tương ứng với các biến \(x_1\) và \(x_2\) của phương trình (2) và (3) của hệ (3) nhưng không được xuất hiện. Cụ thể ta có thể viết lại pt (2) và (3) của hệ (3) như sau: \(0x_1+2x_2-8x_3 = 8\) và \(5x_1+0x_2-5x_3 = 10\). Ma trận bổ sung bên trên có thêm cột bên phải là các hằng số bên phải của các phương trình trong hệ.&lt;/p&gt;

&lt;p&gt;Kích thước của ma trận được thể hiện thông qua các chỉ số hàng và cột mà ma trận có. Ma trận (4) có 3 hàng và 4 cột được gọi là ma trận 3 nhân 4 (3 by 4).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Giải hệ phương trình tuyến tính&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Giải hệ phương trình tuyến tính (3)&lt;/p&gt;

&lt;p&gt;Lời giải: Thực hiện thủ tục khử (loại bỏ) được biểu hiện bằng hệ phương trình và ma trận hệ số của hệ phương trình song song để dễ dàng so sánh.&lt;/p&gt;

&lt;p&gt;\[
\left\{
\begin{array}{ll}
x_1 - 2x_2 + x_3 &amp;amp;= 0 \&lt;br /&gt;
2x_2 - 8x_3 &amp;amp;= 8 \&lt;br /&gt;
5x_1 - 5x_3 &amp;amp;= 10
\end{array}
\right. \; \; \; \; \;
\begin{bmatrix}1 &amp;amp; -2 &amp;amp; 1 &amp;amp; 0 \\ 0 &amp;amp; 2 &amp;amp; -8 &amp;amp; 8 \\ 5 &amp;amp; 0 &amp;amp; -5 &amp;amp; 10 \end{bmatrix}\]&lt;/p&gt;

&lt;p&gt;Giữ nguyên \(x_1\) của phương trình đầu tiên cà thực hiện phương pháp khử (loại bỏ) nó từ các phương trình khác trong hệ. Để làm được điều đó ta tiến hành cộng \((-5)\) với phương trình (1) với phương trình (3).&lt;/p&gt;

&lt;p&gt;\[\begin{align}-5.[pt1] \\ + [pt2] \\ [pt3 \; mới]\end{align}\; \; \; \; \;
\left\{
\begin{array}{ll}
5x_1 + 10x_2 - 5x_3 &amp;amp;= 0 \&lt;br /&gt;
5x_1 - 5x_3 &amp;amp;= 10 \&lt;br /&gt;
10x_2 - 10x_3 &amp;amp;= 10
\end{array}
\right.\]&lt;/p&gt;

&lt;p&gt;Kết quả của việc tính toán trên được viết thay thế pt3 của hệ.&lt;/p&gt;

&lt;p&gt;\[
\left\{
\begin{array}{ll}
x_1 - 2x_2 + x_3 &amp;amp;= 0 \&lt;br /&gt;
2x_2 - 8x_3 &amp;amp;= 8 \&lt;br /&gt;
10x_2 - 10x_3 &amp;amp;= 10
\end{array}
\right. \; \; \; \; \;
\begin{bmatrix}1 &amp;amp; -2 &amp;amp; 1 &amp;amp; 0 \\ 0 &amp;amp; 2 &amp;amp; -8 &amp;amp; 8 \\ 0 &amp;amp; 10 &amp;amp; -10 &amp;amp; 10 \end{bmatrix}\]&lt;/p&gt;

&lt;p&gt;Bây giờ nhân phương trình (2) của hệ với \(1\over2\) theo thứ tự ta thu được hệ số của \(x_2\) là 1.&lt;/p&gt;

&lt;p&gt;\[
\left\{
\begin{array}{ll}
x_1 - 2x_2 + x_3 &amp;amp;= 0 \&lt;br /&gt;
x_2 - 4x_3 &amp;amp;= 4 \&lt;br /&gt;
10x_2 - 10x_3 &amp;amp;= 10
\end{array}
\right. \; \; \; \; \;
\begin{bmatrix}1 &amp;amp; -2 &amp;amp; 1 &amp;amp; 0 \\ 0 &amp;amp; 1 &amp;amp; -4 &amp;amp; 4 \\ 0 &amp;amp; 10 &amp;amp; -10 &amp;amp; 10 \end{bmatrix}\]&lt;/p&gt;

&lt;p&gt;Sử dụng \(x_2\) của phương trình (2) để khử \(10x_2\) của phương trình (3).&lt;/p&gt;

&lt;p&gt;\[\begin{align}-10.[pt2] \\ + [pt3] \\ [pt3 \; mới]\end{align}\; \; \; \; \;
\begin{cases}
-10x_2 + 40x_3 &amp;amp;= -40 \&lt;br /&gt;
10x_2 - 10x_3 &amp;amp;= 10 \&lt;br /&gt;
30x_3 &amp;amp;= -30
\end{cases}
\]&lt;/p&gt;

&lt;p&gt;Kết quả của việc tính toán trên ta thu được phương trình thứ 3 mới của hệ.&lt;/p&gt;

&lt;p&gt;\[
\left\{
\begin{array}{ll}
x_1 - 2x_2 + x_3 &amp;amp;= 0 \&lt;br /&gt;
x_2 - 4x_3 &amp;amp;= 4 \&lt;br /&gt;
30x_3 &amp;amp;= -30
\end{array}
\right. \; \; \; \; \;
\begin{bmatrix}1 &amp;amp; -2 &amp;amp; 1 &amp;amp; 0 \\ 0 &amp;amp; 1 &amp;amp; -4 &amp;amp; 4 \\ 0 &amp;amp; 0 &amp;amp; 30 &amp;amp; -30 \end{bmatrix}\]&lt;/p&gt;

&lt;p&gt;Bây giờ tiếp tục nhân phương trình (3) với \(1\over30\) ta thu được hệ số 1 của \(x_3\).&lt;/p&gt;

&lt;p&gt;\[
\left\{
\begin{array}{ll}
x_1 - 2x_2 + x_3 &amp;amp;= 0 \&lt;br /&gt;
x_2 - 4x_3 &amp;amp;= 4 \&lt;br /&gt;
x_3 &amp;amp;= -1
\end{array}
\right. \; \; \; \; \;
\begin{bmatrix}1 &amp;amp; -2 &amp;amp; 1 &amp;amp; 0 \\ 0 &amp;amp; 1 &amp;amp; -4 &amp;amp; 4 \\ 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; -1 \end{bmatrix}\]&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Hệ phương trình tuyến tính mới ta thu được có dạng tam giác.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Cuối cùng, loại bỏ \(-2x_2\) của phương trình (1), nhưng để hiệu quả hơn ta sử dụng \(x_3\) của phương trình (3) trước, ta tiến hành loại bỏ \(-4x_3\)  và \(+x_3\) của phương trình (2) và (1). Dưới đây là miêu tả việc tính toán đó:&lt;/p&gt;

&lt;p&gt;\(
\begin{align}4.[pt3] \\ + [pt2] \\ [pt2 \; mới]\end{align}
\begin{cases}
4x_3 &amp;amp;= -4 \&lt;br /&gt;
x_2 - 4x_3 &amp;amp;= 4 \&lt;br /&gt;
x_2 &amp;amp;= 0
\end{cases}
\)
\(\;\;\;\)
\(
\begin{align}-1.[pt3] \\ + [pt1] \\ [pt1 \; mới]\end{align}
\begin{cases}
-x_3 &amp;amp;= 1 \&lt;br /&gt;
x_1 - 2x_2 + x_3 &amp;amp;= 0 \&lt;br /&gt;
x_1 - 2x_2 &amp;amp;= 1
\end{cases}
\)&lt;/p&gt;

&lt;p&gt;Kết quả ta thu được:&lt;/p&gt;

&lt;p&gt;\[
\left\{
\begin{array}{ll}
x_1 - 2x_2 &amp;amp;= 1 \&lt;br /&gt;
x_2 &amp;amp;= 0 \&lt;br /&gt;
x_3 &amp;amp;= -1
\end{array}
\right. \; \; \; \; \;
\begin{bmatrix}1 &amp;amp; -2 &amp;amp; 0 &amp;amp; 1 \\ 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 \\ 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; -1 \end{bmatrix}\]&lt;/p&gt;

&lt;p&gt;Ta đã tìm được \(x_3\) ở phương trình (3) và sử dụng \(x_2\) của phương trình (2) để khử \(-2x_2\) của phương trình (1) bằng cách cộng 2 lần phương trình (2) với phương trình (1) ta thu được:&lt;/p&gt;

&lt;p&gt;\[
\left\{
\begin{array}{ll}
x_1 &amp;amp;= 1 \&lt;br /&gt;
x_2 &amp;amp;= 0 \&lt;br /&gt;
x_3 &amp;amp;= -1
\end{array}
\right. \; \; \; \; \;
\begin{bmatrix}1 &amp;amp; 0 &amp;amp; 0 &amp;amp; 1 \\ 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 \\ 0 &amp;amp; 0 &amp;amp; 1 &amp;amp; -1 \end{bmatrix}\]&lt;/p&gt;

&lt;p&gt;Như vậy hệ phương trình đã cho có nghiệm duy nhất và có rất nhiều cách khác nhau để tính toán, loại bỏ các hệ số trong hệ có thể dùng để tìm nghiệm của hệ. Để kiểm tra lại xem nghiệm tìm được có chính xác không ta thế các giá trị \((x_1,x_2,x_3)\) vừa tìm được vào bên trái của hệ xem kết quả có đúng bằng phía bên phải là các giá trị trong cột bổ sung của ma trận hay không.&lt;/p&gt;

&lt;p&gt;\[\begin{align}1 - 2(0) + 1(-1) &amp;amp;= 0\\ 2(0) -8(-1) &amp;amp;=  8\\ 5(1) - 5(-1) &amp;amp;= 10\end{align}\]&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Thao tác khử các hệ số của các phương trình trong hệ (phép khử): Thay thế phương trình(hàng) bằng tổng của chính nó với bội số của hàng khác; hoán đổi hai phương trình (hai hàng); nhân giá trị của phương trình với một hằng số khác không.
&lt;/code&gt;&lt;/p&gt;

&lt;h3 id=&quot;vector-equations&quot;&gt;Vector Equations&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Vector trong \(\mathbb{R}^2\)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Một ma trận chỉ có một cột được gọi là vector cột hay thường gọi là vector. Ví dụ: một vector với hai phần tử&lt;/p&gt;

&lt;p&gt;\[\vec u = \begin{bmatrix}3 \\ -1\end{bmatrix}, \vec v = \begin{bmatrix}0.2 \\ 0.3\end{bmatrix}, \vec w = \begin{bmatrix}w_1 \\ w_2\end{bmatrix}\]&lt;/p&gt;

&lt;p&gt;Với vector \(w\), \(w_1\) và \(w_2\) là các số thực. Tập hopwj tất cả các vector với hai phần tử được kí hiệu là: \(\mathbb{R}^2\). \(\mathbb{R}\) được kí hiệu như là đại diện cho một phần tử số thực trong vector và số 2 trên thể hiện việc vector có hai phần tử số thực. Hai vector được gọi là bằng nhau nếu phần tử tương ứng của chúng bằng nhau. Vector \(\begin{bmatrix}4 \\ 7\end{bmatrix}\) và \(\begin{bmatrix}7 \\ 4\end{bmatrix}\) là không bằng nhau.&lt;/p&gt;

&lt;p&gt;Tổng của hai vector \(\vec u\) và \(\vec v\) thuộc \(\mathbb{R}^2\) thu được bằng cách cộng các phần tử tương ứng của \(\vec u\) và \(\vec v\). Ví dụ:&lt;/p&gt;

&lt;p&gt;\[
\begin{bmatrix}1 \\ -2\end{bmatrix} + \begin{bmatrix}2 \\ 5\end{bmatrix} = \begin{bmatrix}1+2 \\ -2+5\end{bmatrix} = \begin{bmatrix}3 \\ 3\end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;Nhân số vô hướng \(c\) với một vector bằng cách nhân tương ứng từng phần tử của vector với số vô hướng \(c\) đó. Ví dụ:&lt;/p&gt;

&lt;p&gt;\[
\vec u = \begin{bmatrix}3 \\ -5\end{bmatrix} and \; c = 5, cu = 5\begin{bmatrix}3 \\ -5\end{bmatrix} = \begin{bmatrix}15 \\ -25\end{bmatrix}
\]
số thực \(c\) trong \(cu\) được gọi là scalar giá trị vô hướng.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Biểu diễn trong hình học \(\mathbb{R}^2\)&lt;/strong&gt;&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;text-align: center&quot;&gt;Tọa độ điểm&lt;/th&gt;
      &lt;th style=&quot;text-align: center&quot;&gt;Vectors theo mũi tên&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;&lt;img src=&quot;https://raw.githubusercontent.com/qndev/qndev.github.io/master/public/images/vec1.gif&quot; alt=&quot;Image: Tọa độ điểm&quot; /&gt;&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;&lt;img src=&quot;https://raw.githubusercontent.com/qndev/qndev.github.io/master/public/images/vec2.gif&quot; alt=&quot;Vectors theo mũi tên&quot; /&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;Quy tắc hình bình hành trong việc công vector.&lt;/p&gt;

&lt;p&gt;Nếu vectors \(u\) và \(v\) thuộc \(\mathbb{R}^2\) được thể hiện giống như các điểm trong mặt phẳng thì \(u+v\) tương ứng là đỉnh thứ tư của hình bình hành tạo cùng với ba đỉnh còn lại là \(u\), \(0\) và \(v\). Hình ảnh minh họa dưới đây cho thấy rõ điều đấy:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://raw.githubusercontent.com/qndev/qndev.github.io/master/public/images/plusvec.gif&quot; alt=&quot;Image: Quy tắc hình bình hành&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Ở đây các vector \(u = \begin{bmatrix}2 \\ 3\end{bmatrix}\) - vector màu xanh, \(v = \begin{bmatrix}-1 \\ 1\end{bmatrix}\) - vector màu đỏ, \(0 = \begin{bmatrix}0 \\ 0\end{bmatrix}\) - gốc tọa độ và vector \(u+v = \begin{bmatrix}1 \\ 4\end{bmatrix}\) - vector màu vàng.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vector thuộc \(\mathbb{R}^3\)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Vector thuộc \(\mathbb{R}^3\) là ma trận 3x1 với 3 phần tử. Biểu diễn tương ứng trong hình học là điểm trong hệ tọa độ không gian ba chiều.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vector thuộc \(\mathbb{R}^n\)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Nếu \(n\) là số nguyên dương, \(\mathbb{R}^n\) là kí hiệu của tập hợp danh sách của \(n\) số thực, thường được viết giống như ma trận cột nx1.&lt;/p&gt;

&lt;p&gt;\[
\vec u = \begin{bmatrix}u_1 \\ u_2 \\ . \\ . \\u_n\end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;Vector mà tất cả các phần tử của nó bằng 0 được gọi là vector không.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tổ hợp tuyến tính&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Các vetor \(\vec v_1,\vec v_2,…,\vec v_p\) thuộc \(\mathbb{R}^n\) và các số vô hướng \(c_1,c_2,…,c_p\). Vector \(\vec y\) được định nghĩa dưới dạng: \(\vec y = c_1\vec v_1 + c_2\vec v_2 + … + c_p\vec v_p\) được gọi là tổ hợp tuyến tính của \(\vec v_1,\vec v_2,…,\vec v_p\) với các trọng số \(c_1,c_2,…,c_p\). Các trọng số trong tổ hợp tuyến tính có thể là bất kì số thực nào kể cả là 0. Ví dụ: Một vài tổ hợp tuyến tính của hai vector \(\vec v_1, \vec v_2\).&lt;/p&gt;

&lt;p&gt;\[
\sqrt{3}\vec v_1 + \vec v_2, \frac{1}{2}\vec v_1 + 0\vec v_2, 0\vec v_1 + 0\vec v_2
\]&lt;/p&gt;

&lt;h3 id=&quot;mathbfaxb&quot;&gt;\(\mathbf{Ax=b}\)&lt;/h3&gt;

&lt;p&gt;\[\mathbf{Ax} = \begin{bmatrix}a_1 &amp;amp; a_2 &amp;amp; . &amp;amp; . &amp;amp; a_n\end{bmatrix}\begin{bmatrix}x_1 \\ x_2 \\ . \\ . \\ x_n\end{bmatrix} = a_1x_1 + a_2x_2 + … + a_nx_n\]&lt;/p&gt;

&lt;p&gt;\[\mathbf{Ax=b} \sim a_1x_1 + a_2x_2 + … + a_nx_n = b \sim \begin{bmatrix}a_1 &amp;amp; a_2 &amp;amp; . &amp;amp; . &amp;amp; a_n &amp;amp; b\end{bmatrix}\]&lt;/p&gt;

&lt;h3 id=&quot;tập-nghiệm-của-hệ-phương-trình-tuyến-tính&quot;&gt;Tập nghiệm của hệ phương trình tuyến tính&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Hệ thuần nhất có dạng&lt;/strong&gt; \(\mathbf{Ax=0}\) có nghiệm không tầm thường khi và chỉ khi phương trình có ít nhất một biến tự do(là biến với hệ số bằng không).&lt;/p&gt;

&lt;p&gt;Ví dụ: \(\begin{bmatrix}A &amp;amp; 0\end{bmatrix}\)&lt;/p&gt;

&lt;p&gt;\[
\begin{bmatrix}3 &amp;amp; 5 &amp;amp; -4 &amp;amp; 0 \\ -3 &amp;amp; -2 &amp;amp; 4 &amp;amp; 0 \\ 6 &amp;amp; 1 &amp;amp; -8 &amp;amp; 0\end{bmatrix} \sim \begin{bmatrix}3 &amp;amp; 5 &amp;amp; -4 &amp;amp; 0 \\ 0 &amp;amp; 3 &amp;amp; 0 &amp;amp; 0 \\ 0 &amp;amp; -9 &amp;amp; 0 &amp;amp; 0\end{bmatrix} \sim \begin{bmatrix}3 &amp;amp; 5 &amp;amp; -4 &amp;amp; 0 \\ 0 &amp;amp; 3 &amp;amp; 0 &amp;amp; 0 \\ 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;\[
\begin{bmatrix}1 &amp;amp; 0 &amp;amp; \frac{-4}{3} &amp;amp; 0 \\ 0 &amp;amp; 1 &amp;amp; 0 &amp;amp; 0 \\ 0 &amp;amp; 0 &amp;amp; 0 &amp;amp; 0\end{bmatrix} \; \; \;
\begin{cases}
x_1 - \frac{4}{3}x_3 &amp;amp;= 0 \&lt;br /&gt;
x_2 &amp;amp;= 0 \&lt;br /&gt;
0 &amp;amp;= 0
\end{cases}
\]&lt;/p&gt;

&lt;p&gt;Như vậy ta có \(x_1 = \frac{4}{3}x_3\), \(x_2 = 0\), suy ra \(\mathbf{x} = \begin{bmatrix}x_1 \\ x_2 \\ x_3 \end{bmatrix} = \begin{bmatrix}\frac{4}{3}x_3 \\ 0 \\ x_3 \end{bmatrix} =vx_3\) với \(v=\begin{bmatrix}\frac{4}{3} \\ 0 \\ 1\end{bmatrix}\)&lt;/p&gt;

&lt;p&gt;Ta có \(vx_3 = \begin{bmatrix}\frac{4}{3} \\ 0 \\ 1\end{bmatrix}\). Về mặt hình học, tập nghiệm của hệ phương trình là đường thẳng đi qua gốc tọa độ trong \(\mathbb{R}^3\).&lt;/p&gt;

&lt;p&gt;Ví dụ: \(10x_1-3x_2-2x_3=0\), suy ra \(x_1=0.3x_2+0.2x_3\).&lt;/p&gt;

&lt;p&gt;\[
\mathbf{x} = \begin{bmatrix}x_1 \\ x_2 \\ x_3 \end{bmatrix} = \begin{bmatrix}0.3x_2+0.2x_3 \\ x_2 \\ x_3 \end{bmatrix} = \begin{bmatrix}0.3x_2 \\ x_2 \\ 0 \end{bmatrix} + \begin{bmatrix}0.2x_3 \\ 0 \\ x_3 \end{bmatrix}&lt;br /&gt;
\]&lt;/p&gt;

&lt;p&gt;\[
\mathbf{x} = x_2\begin{bmatrix}0.3 \\ 1 \\ 0 \end{bmatrix} + x_3\begin{bmatrix}0.2 \\ 0 \\ 1 \end{bmatrix}
\]&lt;/p&gt;

&lt;p&gt;Như vậy tập nghiệm của pt là tổ hợp tuyến tính của hai vector \(u\) và \(v\) với \(u=\begin{bmatrix}0.3 \\ 1 \\ 0 \end{bmatrix}\) và \(v=\begin{bmatrix}0.2 \\ 0 \\ 1 \end{bmatrix}\) hay \(span{u,v}\) hay mặt phẳng đi qua gốc tọa độ chứa \(u\) và \(v\).&lt;/p&gt;

&lt;p&gt;Tập nghiệm dạng: \(\mathbf{x}=su+tv\) \((s,t\in\mathbb{R})\).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Nghiệm của hệ không thuần nhất&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;\(w=p+v_h\) trong đó \(v_h\) là nghiệm của \(\mathbf{Ax=0}\).&lt;/p&gt;

&lt;h3 id=&quot;độc-lập-tuyến-tính&quot;&gt;Độc lập tuyến tính&lt;/h3&gt;

&lt;p&gt;Tập \(\{v_1,v_2,\ldots,v_p\}\in\mathbb{R}\) được gọi là độc lập tuyến tính nếu pt:&lt;/p&gt;

&lt;p&gt;\[
x_1v_1+x_2v_2+\cdots+x_pv_p=0
\]&lt;/p&gt;

&lt;p&gt;chỉ có nghiệm tầm thường và phụ thuộc tuyến tính nếu tồn tại các trọng số \(c_1,c_2,\ldots,c_p\) không đồng thời bằng \(0\)&lt;/p&gt;

&lt;p&gt;\[
c_1v_1+c_2v_2+\cdots+c_pv_p=0
\]&lt;/p&gt;

&lt;hr /&gt;</content><author><name>NGUYEN DINH QUANG</name><email>quangnd.hust@gmail.com</email></author><category term="Mathematics" /><category term="linear algebra" /><summary type="html">Hệ phương trình tuyến tính</summary></entry></feed>