Tải bản đầy đủ (.pdf) (14 trang)

LIST OF CONTENTS 1 markov chain 2 determinants 3 system of linear equations

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (618.38 KB, 14 trang )

HO CHI MINH CITY UNIVERSITY OF TECHNOLOGY

Linear Algebra
---------------o0o---------------

REPORT
Group:
Students’ list:
- Hồ Lê Khánh Dy – 2052431
- Nguyễn Đình Hồng – 2052480
- Nghiêm Đức Tài – 20523412
- Nguyễn Phúc Thịnh – 2052728
- Trần Bảo Tín – 2052748
- Đỗ Diệp Phương Trâm - 2052286
Semester: HK202
Lecturer: Phan Thị Khánh Vân
Submission day: 30/5/2021

LIST OF CONTENTS
1. Markov chain
2. Determinants
3. System of linear equations


CONTENTS
1. Markov chain:
A. Theory:
• Many types of applications involve a finite set of state {S1, S2,…, Sn} of a population.
• For instance, residents of a city may live downtown or in the suburbs. Soft drink
consumers may buy Coca-Cola, Pepsi, or another brand.
• The probability that a member of a population will change from the jth state to the ith


state is represented by a number pij, where 0 ≤ pij ≤ 1.
B. Definition:
p11 p12 ⋯ p1n
p
p22 ⋯ p2n
) is called the matrix of transition probabilities.
• The matrix P = ( ⋮21



pn1 pn2 ⋯ pnn


At each transition, each member in a given state must either stay in that state or change to
another state. It means that:
𝑛

∑ 𝑝𝑖𝑗 = 1, ∀ 𝑗 = 1. . 𝑛
𝑖=1



The nth state vector of a Markov chain for which P is the matrix of transition
probabilities and X0 is the initial state vector is:
𝑋𝑛 = 𝑃𝑋𝑛−1 = 𝑃2 𝑋𝑛−2 =. . . = 𝑃𝑛 𝑋0

C. Practical problems:
a. Two competing companies offer mobile phone service to a city with 100 000
households. Suppose that each citizen uses one of these services. Every month, 15%
of the subscriber of company A changes to use the service of company B, and 10% of

company B’s subscribers changes to use the service of A. Company A now has 60
000 subscribers and Company B has 40 000 subscribers. How many subscribers will
each company have after 2 months?
b. Consider an experiment of mating rabbits. We watch the evolution of a particular
gene that appears in two types, G or g. A rabbit has a pair of genes, either GG
(dominant), Gg (hybrid–the order is irrelevant, so gG is the same as Gg) or gg


(recessive). In mating two rabbits, the offspring inherits a gene from each of its
parents with equal probability. Thus, if we mate a dominant (GG) with a hybrid (Gg),
the offspring is dominant with probability 1/2 or hybrid with probability 1/2. Start
with a rabbit of given character (GG, Gg, or gg) and mate it with a hybrid. The
offspring produced is again mated with a hybrid, and the process is repeated through
a number of generations, always mating with a hybrid. (i) Write down the transition
probabilities of the Markov chain thus defined. (ii) Assume that we start with a hybrid
rabbit. Let µn be the probability distribution of the character of the rabbit of the n-th
generation. In other words, µn(GG),µn(Gg),µn(gg) are the probabilities that the n-th
generation rabbit is GG, Gg, or gg, respectively. Compute µ1,µ2,µ3.
D. Solution:

a. 𝑊𝑒 ℎ𝑎𝑣𝑒: 𝑋0 = (

𝑋2 = 𝑃2 𝑋0 = (

60000
) ,
40000

0.85
𝑃=(

0.15

2
51250
60000
0.85 0.1
)=(
) ∗(
)
40000
0.15 0.9
48750

0.1
)
0.9

So : There are 51250 subscribers from company A after 2 months.
There are 48750 subscribers from company B after 2 months.
b. (i) From the given information, we have the transition probabilities:
GG

Gg

gg

GG

0.5


0.5

0

Gg

0.25

0.5

0.25

gg

0

0.5

0.5

Or we can write it in the following form:
0.5 0.5
𝑃 = ( 0.25 0.5
0
0.5

0
0.25)
0.5


(ii) We start with 𝑋0 being distributed as 𝜇0 = (𝜇0 (1), 𝜇0 (2), 𝜇0 (3)) = (0,1,0),and, letting

𝑚𝑢𝑛 = (𝜇0 (n), 𝜇0 (n), 𝜇0 (n)) be the distribution of 𝑋𝑛 , we have:


μ𝑛 = μ𝑜 ∗ 𝑃 𝑛

So that:
𝜇1 = 𝜇0 ∗ 𝑃 = (0

𝜇2 = 𝜇0 ∗ 𝑃2 = (0

𝜇3 = 𝜇0 ∗

𝑃3

= (0

1

0.5 0.5
0
0) ∗ (0.25 0.5 0.25 ) = (0.25
0
0.5 0.5

1

0.5 0.5
0

)
0 ∗ ( 0.25 0.5 0.25 ) = (0.25
0
0.5 0.5

0.5

0.25)

1

0.5 0.5
0
)

(
0
0.25 0.5 0.25 ) = (0.25
0
0.5 0.5

0.5

0.25)

2

3

0.5


0.25)

2. Determinant:
A. Defintion:
In mathematics, the determinant is a scalar value that is a function of the entries of a square matrix
An and the determinant of a matrix An is denoted det(A), det A, or |A|.

B. Classification and calculation:
- General matrix:
1) n = 1, A = a11

=> det(A) = a11

2) n = 2, A = a11

a12

a21

a22

=> det(A) = (-1)1+1.a11.|M11| + (-1)1+2.a12.|M12| = a11.a22 – a12.a21


(expand the determinant in row 1)
3) n = 3, A = a11

a12 a13


a21

a22

a23

a31

a32 a33

=> det(A) = (-1)1+1.a11 |M11| + (-1)1+2.a12.|M12| + (-1) 1+3.a13. |M13|
= a11.det a22
a32

a23 – a12.det a21 a23 + a13 .det a21

a22

a33

a32

a31

a33

a31

= a11.a22.a33 – a11.a23.a32 – a12.a21.a33 + a12.a23.a31 + a13.a21.a32 – a13.a22.a31
= a11.a22.a33 + a12.a23.a31 + a13.a21.a32 – a11.a23.a32 – a12.a21.a33 – a13.a22.a31

(expand the determinant in row 1)
*Especially: We can calculate the determinant of A3 by the fastest way like this:
+ Rewrite the elements in the matrix in rows and columns respectively.

a11

a12 a13

a21

a22 a23

a31

a32 a33

+ Add the first 2 columns of the matrix to the right of the previously written elements.
a11

a12 a13 a11 a12

a21

a22 a23 a21 a22

a31

a32 a33 a31 a32

+ det(A) = ∑ (product of elements on each blue diagonal) – ∑ (product of elements on each red

diagonal).
a11

a12 a13 a11 a12

a21

a22 a23 a21 a22


a31

a32 a33 a31 a32

=> det(A) = a11.a22.a33 + a12.a23.a31 + a13.a21.a32 – a11.a23.a32 – a12.a21.a33 – a13.a22.a31

4) n = 4, A = a11

a12 a13

a14

a21

a22 a23 a24

a31

a32 a33 a34


a41

a42 a43 a44

=> det(A) = (-1)1+1.a11.|M11| + (-1)1+2.a12.|M12| + (-1)1+3. a13.|M13| + (-1)1+4.a14. |M14|
= (-1)1+1.a11.det a22 a23

a24 + (-1)1+2.a12.det a21 a23 a24

a32

a33 a34

a31

a33 a34

a42

a43 a44

a41

a43 a44

a24 + (-1)1+4.a14.det a21

a22 a23

+(-1)1+3. a13.det a21 a22

a31

a32 a34

a31

a32 a33

a41

a42 a44

a41

a42 a43

= a11.a22.a33.a44 + a11.a23.a34.a42 + a11.a24.a32.a43 – a11.a24.a33.a42 –

a11.a22.a34.a43

– a11.a23.a32.a44 – a12.a21.a33.a44 – a12.a23.a34.a41 – a12.a24.a31.a43 + a12.a24.a33.a41 + a12.a21.a34.a43 +
a12.a23.a31.a44 + a13.a21.a32.a44 + a13.a22.a34.a41 + a13.a24.a31.a42 – a13.a24.a32.a41 – a13.a21.a34.a42 –
a13.a22.a31.a44 – a14.a21.a32.a43 – a14.a22.a33.a41 – a14.a23.a31.a42 + a14.a23.a32.a41 + a14.a21.a33.a42 +
a14.a22.a31.a43 .

5) n ≥ 5, we should turn the matrix An into the upper triangular matrix A’n and det (An) = det(A’n)
= product of elements on the main diagonal of A’n.


An =


a11

a12 a13 … a1n

a a1 a2 …….. ax

a21

a22 a23 … a2n

0

a31

a32 a33 … a3n

=>

A’n =

0

b
0

b1 …….. by
c ……... cz

……………………


……………………

an1

0

an2 an3 … ann

0

0 ………. m

=> det(An) = det(A’n) = a.b.c…m
- Diagonal matrix:

An =

a 0

0 ………. 0

0

b

0 ………. 0

0


0

c ………. 0

=> det(An) = a.b.c…m

…………………...
0

0

0 ……… m

- Identity matrix:

In =

1

0

0 ……… 0

0

1

0 ……… 0

0


0

1 ……… 0

=> det(In) = 1

…………………..
0

0

0 ……… 1

- Triangular matrix:

An =

a a1 a2 …….. ax

a 0

0 ……… 0

0

b

b1 …….. by


b1 b

0 ……… 0

0

0

c ……... cz

0..........0................

or

An =

c2 c1 c ……… 0
………………….0


0

0

0………. m

mx my mz …… m

=> det (An) = a.b.c…m


C. Properties of determinant:
+ When we swap 2 rows or swap 2 columns, the determinant is changed sign.
Example: det 1
3

2 = 1.4 – 2.3 = -2 => det 3

4

4

2

1

det 1

2

= 1.4 – 2.3 = -2 => det 2

3

4

4

= 3.2 – 1.4 = 2

1 = 2.3 – 4.1 = 2

3

+ If matrix A has 2 proportional rows or 2 proportional columns then det(A) = 0.

Example: det 1

4 =8–4=0

2

8

+ If matrix A has all elements on a row = 0 or on a column = 0, then det(A)=0.
0

0

0

Example: det 1

2

3

4

5

6


=

0

0

1

2

4

5

0

0

0

6

4

5

= 0.2.6 + 0.3.4 + 0.1.5 – 4.2.0 – 5.3.0 – 6.1.0 = 0
+ The common factor of a row or the common factor of a column can be taken out of the
determinant.

Example:

6

8

10

3

4

5

1

4

5

det 9

5

7

= 2.det 9

5


7 = 2.3.det 3

5

7

15 2

4

2

4

15 2 4

5


+ det(An) = det(ATn)
Example: det 6
8

7 = det 6

8 = 6.9 – 7.8 = -2

9

9


7

+ det(An . Bn) = det(An).det(Bn)
Example: det 1
3

2 . 5

6

= det 1

4

8

3

7

2 . det 5

6 = (4 – 3.2).(5.8 – 7.6) = 4

4

8

7


+ det(α.An) = αn. det(An)
Example: det 2. 3

7

= det 6

8

2

14 = 22.det 3

16 4

8

7 = 4.(3.2 – 8.7) = -200
2

+ det(An) = (det A)n
Example: det 3

2

5

7


= (3.9 – 7.5)2 = 64

9

Let A, B and C be defined as complex numbers in the complex plane.
The vectors from C to A and from C to B are given by
z1 = (x1−x3) + i(y1−y3)z1=(x1−x3) + i(y1−y3)
z2 = (x2−x3) + i(y2−y3)
so the area of the triangle is:
A= ½ Z1.Z2
A= ½ | (Im ( (x1−x3)−i(y1−y3)) ((x2−x3)−i(y2−y3)) ) |


= 1/2|(x1−x3)(y2−y3)−(y1−y3)(x2−x3)|
=1/2|x1y2−y1x2+x2y3−y2x3+x3y1−y3x1|
Problem2:

Find the area of the triangle??

x

y

1

point 1

-2

2


1

point 2

1

5

1

point 3

6

-1

1

Evaluate that determinant. We will expand on column 1.

2

2

1

1

5


1

6

1

1

=

+ (2)

5

1

1

1

1

2

1

1

1


+
6

2

1

5

1


= -2 ( 5 + 1 ) - 1 ( 2 + 1 ) + 6 ( 2 - 5 ) = -2 ( 6 ) - 1 ( 3 ) + 6 ( -3 ) = -12 - 3 - 18 =
-33.
So the area of the triangle is ½ detA =33/2= 16.5
Problem2: Calculate the matrix: 1

1

5

3

2

6

8


9

2

5

6

7

1

2

5

6

1

1

5

3

1

1


5

3

1

1

5

3

0

4

-2 3

=> 0

4

-2

3

=> 0

4


-2

3

A=

Solution: 1

1

5

3

2

6

8

9

2

5

6

7


0

3

-1 4

0

0 -5/2 -5/4

0

0 -5/2 -5/4

1

2

5

6

0

1

0

0


0 1/2

0

0

=>

3

9/4

0

2

 det(A)= 1.4.(-5/2).2= -20
3.System of linear equations:
A. Theory:
• In mathematics, a system of linear equations (or linear system) is a collection of
linear equations involving the same set of variables.
• A solution to a linear system is an assignment of numbers to the variables such
that all the equations are simultaneously satisfied.
B. Definition:
• A general linear system of m equations in the n unknowns can be written as:
a11 x1 + a12 x2 +...+ a1j xj +...+ a1n xn = b1
.................................... ... ...
ai1 x1 + ai2 x2 +...+ aij xj +...+ ain xn = bi
.................................... ... ...
am1 x1 + am2 x2 +...+ amj xj +...+ amn xn = bm


(1)


Matrix is called the augmented matrix for the system (1), which is obtained by
adjoining column B to matrix A as the last column.
𝐴𝐵 = (𝑎𝑖𝑗 |𝑏𝑖 )𝑚∗(𝑛+1)



The system (1) is called a homogeneous if B = 0m×1 and a nonhomogeneous if B
0mì1.
ã A non-homogeneous linear system A.X = b, A ∈ Rm×n. If:
- r(A) < r(A|b): there is no solution.
- r(A) = r(A|b) = n: the solution is unique.
- r(A) = r(A|b) = r < n: there is an infinite number of solutions.
• A homogeneous system of linear system with b = 0. If :
- r(A) = n : there is only trivial solution X = 0.
- r(A) < n : there is infinitely many solutions or non-trivial solutions.
C. Practical problems:
a. Problem 1: Balance the chemical equation :
NH3 + O2 → NO + H2O (Not balanced)


Solution :
-

To balance the equation, we insert unknowns, multiplying the reactants and the
products to get an equation of the form:
(x1)NH3 + (x2)O2 → (x3)NO + (x4) H2O


-

Next, by applying Law of Conservation of Matter, we compare the number of
nitrogen (N), hydrogen (H) and oxygen (O) atoms of the reactants with the
number of the products. We obtain three equations :
N : x 1 = x3 ;
H : 3x1 = 2x4 ;
O : 2x2 = x3 + x4 ;

-

It is important to note that we made use of the subscripts because they count the
number of atoms of a particular element. Rewriting these equations in standard
form, we see that we have a homogenous linear system in four unknowns, that is :
x1, x2, x3 and x4 .
x1 - x3 = 0
3x1 - 2x4 = 0
2x2 - x3 - x4 = 0

-

-

Writing this equations or system in matrix form, we have the augmented matrix :
1 0 −1 0 0
( 3 0 0 −2 0)
0 2 −1 −1 0
First, we subtract row 1 multiplied by 3 from row 2: R2 = R2 − 3R1 :
1 0 −1 0 0

( 0 0 3 −2 0)
0 2 −1 −1 0


-

-

-

Swap rows 2 and 3, then divide row 2 by 2: R2 = R2/2 and row 3 by 3: R3 =
R3/3. After that, add row 3 to row 1: R1 = R1 + R3. We obtain :

0
−2/3 0
−1/2 −1/2 0)
0 0
1
−2/3 0
Add row 3 multiplied by 1/2 to row 2: R2= R2 + R3/2. We have :
1 0 0 −2/3 0
( 0 1 0 −5/6 0)
0 0 1 −2/3 0
(

1 0
0 1

Let x4 = x4. We get :
x1 = (2/3).x4

x2 = (5/6).x4
x3 = (2/3).x4
x4 = x4

-

To balance the equation without fractions, we choose x4 = 6.
Then, our balance equation is :
4NH3 + 5O2 → 4NO + 6H2O

b. Problem 2 : A dietitian is planning a meal that supplies certain quantities of vitamin
C, calcium, and magnesium. Three foods will be used, their servings measured in
milligrams. The nutrients supplied by these foods and the dietary requirements are
given in the table below. Determine the servings (mg) of Food 1,2 and 3 necessary to
meet the dietary requirements.

Solution :
-

From the table, we archieve a non-homogenous linear system in three unknowns
Food 1, Food 2, Food 3 denoted as f1, f2, f3 respectively :
30f1 + 45f2 + 15f3 = 1785
20f1 + 45f2 + 20f3 = 1642.5
30f1 + 60f2 + 35f3 = 2472.5


-

Writing this equations or system in matrix form, we have the augmented matrix :


-

)
30 60 35 2472.5
First, we divide row 1 by 30: R1 = R1/30 , subtract row 1 multiplied by 20 from
row 2: R2 = R2 – 20R1 and subtract row 1 multiplied by 30 from row 3:
R3 = R3 − 30R1 :

-

-

(

30
20 45
45 15
20

1 3/2
( 0 15
0 15

59.5
454.5)
687.5

We divide row 2 by 15: R2 = R2/15 , subtract row 2 multiplied by 3/2 from row
1: R1 = R1 − (3R2)/2 , subtract row 2 multiplied by 15 from row 3:
R3 = R3 − 15R2 :


1 0 −1/2 14.25
( 0 1 2/3 181/6)
0 0
10
235
Divide row 3 by 10: R3 = R3/10 , add row 3 multiplied by 1/2 to row 1:
R1 = R1 + R3/2 , subtract row 3 multiplied by 2/3 from row 2:
R2 = R2 – (2R3)/3. We get :

-

1/2
10
20

1785
1642.5

1 0 0
(0 1 0
0 0 1

26
14.5)
23.5

In conclusion, to meet the dietary requirements, the serving size of the meal
should contain:
+ Food 1 : 26 mg

+ Food 2 : 14.5 mg
+ Food 3 : 23.5 mg



×