Chu . o . ng 4 Hˆe . phu . o . ng tr`ınh tuyˆe ´ nt´ınh 4.1 Hˆe . n phu . o . ng tr`ınh v´o . i n ˆa ’ nc´od i . nh th´u . c kh´ac0 132 4.1.1 Phu . o . ng ph´ap ma trˆa . n 133 4.1.2 Phu . o . ng ph´ap Cramer . . . . . . . . . . . . 134 4.1.3 Phu . o . ng ph´ap Gauss . . . . . . . . . . . . . 134 4.2 Hˆe . t`uy ´y c´ac phu . o . ng tr`ınh tuyˆe ´ n t´ınh . . . 143 4.3 Hˆe . phu . o . ng tr`ınh tuyˆe ´ nt´ınh thuˆa ` n nhˆa ´ t . . 165 4.1 Hˆe . n phu . o . ng tr`ınh v´o . i n ˆa ’ nc´od i . nh th´u . ckh´ac 0 Hˆe . phu . o . ng tr`ınh tuyˆe ´ n t´ınh trˆen tru . `o . ng sˆo ´ P d u . o . . cgo . il`ahˆe . Cramer 1 nˆe ´ usˆo ´ phu . o . ng tr`ınh b˘a ` ng sˆo ´ ˆa ’ nv`ad i . nh th´u . ccu ’ a ma trˆa . nco . ba ’ n (ma trˆa . nhˆe . sˆo ´ )cu ’ ahˆe . l`a kh´ac khˆong. 1 G. Cramer (1704-1752) l`a nh`a to´an ho . c Thu . yS˜ı. 4.1. Hˆe . n phu . o . ng tr`ınh v´o . i n ˆa ’ nc´od i . nh th´u . c kh´ac 0 133 Hˆe . Cramer c´o da . ng a 11 x 1 + a 12 x 2 + ···+ a 1n x n = h 1 , a 21 x 1 + a 22 x 2 + ···+ a 2n x n = h 2 , . . . . . . a n1 x 1 + a n2 x 2 + ···+ a nn x n = h n (4.1) hay du . ´o . ida . ng ma trˆa . n AX = H (4.2) trong d ´o A = a 11 a 12 . a 1n a 21 a 22 . a 2n ··· . . . . . . . . . a n1 a n2 . a nn ,X= x 1 x 2 . . . x n ,H= h 1 h 2 . . . h n ho˘a . c a 11 a 21 . . . a n1 x 1 + a 12 a 22 . . . a n2 x 2 + ···+ a 1n a 2n . . . a nn x n = h 1 h 2 . . . h n . 4.1.1 Phu . o . ng ph´ap ma trˆa . n V`ı detA =0nˆentˆo ` nta . i ma trˆa . n nghi . ch da ’ o A −1 . Khi d´ot`u . (4.2) ta thu d u . o . . c A −1 AX = A −1 H ⇒ EX = X = A −1 H. Vˆa . yhˆe . nghiˆe . m duy nhˆa ´ tl`a X = A −1 H. (4.3) Tuy nhiˆen viˆe . c t`ım ma trˆa . n nghi . ch d a ’ o n´oi chung l`a rˆa ´ tph´u . cta . pnˆe ´ u cˆa ´ pcu ’ a ma trˆa . n A l´o . n. 134 Chu . o . ng 4. Hˆe . phu . o . ng tr`ınh tuyˆe ´ n t´ınh 4.1.2 Phu . o . ng ph´ap Cramer Nghiˆe . m duy nhˆa ´ tcu ’ ahˆe . Cramer du . o . . c x´ac d i . nh theo cˆong th´u . c Cramer: x j = det(A j ) detA ,j= 1,n (4.4) trong d ´o A j l`a ma trˆa . nthudu . o . . ct`u . ma trˆa . n A b˘a ` ng c´ach thay cˆo . t th´u . j bo . ’ icˆo . t c´ac hˆe . sˆo ´ tu . . do H, v`a c´ac cˆo . t kh´ac gi˜u . nguyˆen. 4.1.3 Phu . o . ng ph´ap Gauss Nˆo . i dung chu ’ yˆe ´ ucu ’ aphu . o . ng ph´ap Gauss (hay thuˆa . t to´an Gauss) l`a khu . ’ liˆen tiˆe ´ p c´ac ˆa ’ ncu ’ ahˆe . . Thuˆa . t to´an Gauss du . . a trˆen c´ac ph´ep biˆe ´ n d ˆo ’ iso . cˆa ´ p hˆe . phu . o . ng tr`ınh. D ´o l`a c´ac ph´ep biˆe ´ ndˆo ’ i: 1 + Nhˆan mˆo . tphu . o . ng tr`ınh n`ao d ´ocu ’ ahˆe . v´o . imˆo . tsˆo ´ kh´ac 0. 2 + Thˆem v`ao mˆo . tphu . o . ng tr`ınh n`ao d ´ocu ’ ahˆe . mˆo . tphu . o . ng tr`ınh kh´ac nhˆan v´o . imˆo . tsˆo ´ t`uy ´y. 3 + Dˆo ’ ichˆo ˜ hai phu . o . ng tr`ınh cu ’ ahˆe . . D - i . nh l´y. Mo . iph´ep biˆe ´ nd ˆo ’ iso . cˆa ´ p thu . . chiˆe . ntrˆen hˆe . phu . o . ng tr`ınh (4.1) d ˆe ` udu . ad ˆe ´ nmˆo . thˆe . phu . o . ng tr`ınh m´o . itu . o . ng d u . o . ng. Viˆe . c thu . . chiˆe . n c´ac ph´ep biˆe ´ nd ˆo ’ iso . cˆa ´ ptrˆenhˆe . phu . o . ng tr`ınnh (4.1) thu . . cchˆa ´ t l`a thu . . chiˆe . n c´ac ph´ep biˆe ´ nd ˆo ’ iso . cˆa ´ p trˆen c´ac h`ang cu ’ a ma trˆa . nmo . ’ rˆo . ng cu ’ ahˆe . . Do d ´o sau mˆo . tsˆo ´ bu . ´o . cbiˆe ´ nd ˆo ’ itathudu . o . . chˆe . (4.1) tu . o . ng d u . o . ng v´o . ihˆe . tam gi´ac b 11 x 1 + b 12 x 2 + ···+ b 1n x n = h 1 b 22 x 2 + ···+ b 2n x n = h 2 . . . b nn x n = h n T`u . d ´or´ut ra x n ,x n−1 , .,x 2 ,x 1 . 4.1. Hˆe . n phu . o . ng tr`ınh v´o . i n ˆa ’ nc´od i . nh th´u . c kh´ac 0 135 C ´ AC V ´ IDU . V´ı d u . 1. Gia ’ ic´achˆe . phu . o . ng tr`ınh sau b˘a ` ng phu . o . ng ph´ap ma trˆa . n 1) x 1 + x 2 + x 3 =4, x 1 +2x 2 +4x 3 =4, x 1 +3x 2 +9x 3 =2. (4.5) 2) 3x 1 +2x 2 − x 3 =1, x 1 + x 2 +2x 3 =2, 2x 1 +2x 2 +5x 3 =3. (4.6) Gia ’ i. 1) Ta k´yhiˆe . u A = 111 124 139 ,X= x 1 x 2 x 3 ,H= 4 4 2 . Khi d ´ophu . o . ng tr`ınh (4.5) c´o da . ng AX = H. V`ı detA =2=0nˆenA c´o ma trˆa . n nghi . ch d a ’ o v`a do vˆa . yhˆe . (4.5) c´o nghiˆe . m duy nhˆa ´ t: X = A −1 H. Dˆe ˜ d`ang thˆa ´ yr˘a ` ng A −1 = 3 −31 − 5 2 4 − 3 2 1 2 −1 1 2 v`a do d ´o x 1 x 2 x 3 = 3 −31 − 5 2 4 − 3 2 1 2 −1 1 2 4 4 2 . 136 Chu . o . ng 4. Hˆe . phu . o . ng tr`ınh tuyˆe ´ n t´ınh Thu . . chiˆe . n ph´ep nhˆan ma trˆa . no . ’ vˆe ´ pha ’ itathud u . o . . c x 1 =3· 4 − 3 · 4+1· 2=2, x 2 = − 5 2 · 4+4· 4 − 3 2 · 2=3, x 3 = 1 2 · 4 − 1 · 4+ 1 2 · 2=−1. 2) Viˆe ´ t ma trˆa . n A cu ’ ahˆe . v`a t`ım A −1 : A = 32−1 11 2 22 5 ⇒ A −1 = 1 −12 5 −117−7 0 −21 . T`u . d ´o suy r˘a ` ng x 1 x 2 x 3 = 1 −12 5 −117−7 0 −21 1 2 3 = −8 12 −1 t´u . cl`a x 1 =8,x 2 =12,x 3 = −1. V´ı d u . 2. ´ Ap du . ng quy t˘a ´ c Cramer, gia ’ ic´achˆe . phu . o . ng tr`ınh 1) x 1 +2x 2 +3x 3 =6, 2x 1 − x 2 + x 3 =2, 3x 1 − x 2 − 2x 3 =2. (4.7) 2) x 1 − 2x 2 +3x 3 − x 4 =6, 2x 1 +3x 2 − 4x 3 +4x 4 =7, 3x 1 + x 2 − 2x 3 − 2x 4 =9, x 1 − 3x 2 +7x 3 +6x 4 = −7. (4.8) Gia ’ i. 1) ´ Ap du . ng cˆong th´u . c (4.4) x j = det(A j ) detA ,j= 1, 3 4.1. Hˆe . n phu . o . ng tr`ınh v´o . i n ˆa ’ nc´od i . nh th´u . c kh´ac 0 137 trong d´o detA = 12 3 3 −11 31−2 =30= 0; detA 1 = 62 3 2 −11 21−2 = 30; detA 2 = 16 3 22 1 32−2 = 30; detA 3 = 126 2 −12 312 =30. T`u . d ´o suy ra x 1 =1,x 2 =1,x 3 =1. 2) T´ınh d i . nh th´u . ccu ’ ahˆe . : detA = 1 −23−1 23−44 31−2 −2 1 −37 6 =35. V`ı detA =0nˆen hˆe . c´o nghiˆe . m duy nhˆa ´ t v`a nghiˆe . md u . o . . c t`ım theo cˆong th´u . c (4.4). Ta t´ınh c´ac d i . nh th´u . c det(A 1 )= 6 −23−1 −73−44 91−2 −2 −7 −37 6 =70, 138 Chu . o . ng 4. Hˆe . phu . o . ng tr`ınh tuyˆe ´ n t´ınh det(A 2 )= 16 3−1 2 −7 −44 39−2 −2 1 −77 6 = −35, det(A 3 )= 1 −26−1 23−74 31 9−2 1 −3 −76 =0, det(A 4 )= 1 −23 6 23−4 −7 31−29 1 −37−7 = −70. Do d ´o x 1 = det(A 1 ) detA =2,x 2 = det(A 2 ) detA = −1, x 3 = det(A 3 ) detA =0,x 4 = det(A 4 ) detA = −2. V´ı d u . 3. ´ Ap du . ng phu . o . ng ph´ap Gauss gia ’ ic´achˆe . phu . o . ng tr`ınh 1) x 1 − 2x 3 = −3, −2x 1 + x 2 +6x 3 =11, −x 1 +5x 2 − 4x 3 = −4. 2) 2x 1 − x 2 +3x 3 − x 4 =9, x 1 + x 2 − 2x 3 +4x 4 = −1, 3x 1 +2x 2 − x 3 +3x 4 =0, 5x 1 − 2x 2 + x 3 − 2x 4 =9. 4.1. Hˆe . n phu . o . ng tr`ınh v´o . i n ˆa ’ nc´od i . nh th´u . c kh´ac 0 139 Gia ’ i. 1) Lˆa . p ma trˆa . nmo . ’ rˆo . ng v`a thu . . chiˆe . n c´ac ph´ep biˆe ´ nd ˆo ’ i: A = 10−2 −3 −21 6 11 −15−4 −4 h 2 +2h 1 → h 2 h 3 + h 1 → h 3 −→ 10−2 −3 01 2 5 05−6 −7 −→ h 3 − 5h 2 → h 3 10 −2 −3 01 2 5 00−16 −32 . T`u . d ´o suy ra x 1 − 2x 3 = −3 x 2 +2x 3 =5 −16x 3 = −32 ⇒ x 1 =1,x 2 =1,x 3 =2. 2) Lˆa . p ma trˆa . nmo . ’ rˆo . ng v`a thu . . chiˆe . n c´ac ph´ep biˆe ´ nd ˆo ’ iso . cˆa ´ p: 2 −13−1 9 11−24 −1 32−13 0 5 −21−2 9 h 1 → h 2 h 2 → h 1 −→ 11−24 −1 2 −13−1 9 32−13 0 5 −21−2 9 −→ h 2 − 2h 1 → h 2 h 3 − 3h 1 → h 3 h 4 − 5h 1 → h 4 11−24 −1 0 −37 −9 11 0 −15 −9 3 0 −711−22 14 h 2 → h 3 h 3 → h 2 −→ 140 Chu . o . ng 4. Hˆe . phu . o . ng tr`ınh tuyˆe ´ n t´ınh −→ 11−24 −1 0 −15 −9 3 0 −37 −9 11 0 −711−22 14 h 3 − 3h 2 → h 3 h 4 − 7h 2 → h 4 −→ 11 −24 −1 0 −15−9 3 00 −818 2 00−24 41 −7 −→ h 4 − 3h 3 → h 4 11−24 −1 0 −15 −9 3 00−818 2 00 0−13 −13 T`u . d ´o suy ra r˘a ` ng x 1 =1,x 2 = −2, x 3 =2,x 4 =1. B ` AI T ˆ A . P Gia ’ i c´ac hˆe . phu . o . ng tr`ınh tuyˆe ´ n t´ınh sau 1. x 1 − x 2 +2x 3 =11, x 1 +2x 2 − x 3 =11, 4x 1 − 3x 2 − 3x 3 =24. .(D S. x 1 =9,x 2 =2,x 3 =2) 2. x 1 − 3x 2 − 4x 3 =4, 2x 1 + x 2 − 3x 3 = −1, 3x 1 − 2x 2 + x 3 =11. .(D S. x 1 =2,x 2 = −2, x 3 =1) 3. 2x 1 +3x 2 − x 3 =4, x 1 +2x 2 +2x 3 =5, 3x 1 +4x 2 − 5x 3 =2. .(D S. x 1 = x 2 = x 3 =1) 4.1. Hˆe . n phu . o . ng tr`ınh v´o . i n ˆa ’ nc´od i . nh th´u . c kh´ac 0 141 4. x 1 +2x 2 + x 3 =8, −2x 1 +3x 2 − 3x 3 = −5, 3x 1 − 4x 2 +5x 3 =10. .(D S. x 1 =1,x 2 =2,x 3 =3) 5. 2x 1 + x 2 − x 3 =0, 3x 2 +4x 3 = −6, x 1 + x 3 =1. .(D S. x 1 =1,x 2 = −2, x 3 =0) 6. 2x 1 − 3x 2 − x 3 +6 =0, 3x 1 +4x 2 +3x 3 +5 =0, x 1 + x 2 + x 3 +2 =0. .(D S. x 1 = −2, x 2 =1,x 3 = −1) 7. x 2 +3x 3 +6 =0, x 1 − 2x 2 − x 3 =5, 3x 1 +4x 2 − 2x =13. .(D S. x 1 =3,x 2 =0,x 3 = −2) 8. 2x 1 − x 2 + x 3 +2x 4 =5, x 1 +3x 2 − x 3 +5x 4 =4, 5x 1 +4x 2 +3x 3 =2, 3x 1 − 3x 2 − x 3 − 6x 4 = −6. . (D S. x 1 = 1 3 , x 2 = − 2 3 , x 3 =1,x 4 = 4 3 ) 9. x 1 − 2x 2 +3x 3 − x 4 = −8, 2x 1 +3x 2 − x 3 +5x 4 =19, 4x 1 − x 2 + x 3 + x 4 = −1, 3x 1 +2x 2 − x 3 − 2x 4 = −2. . (D S. x 1 = − 1 2 , x 2 = 3 2 , x 3 = − 1 2 , x 4 =3) 10. x 1 − x 3 + x 4 =3, 2x 1 +3x 2 − x 3 − x 4 =2, 5x 1 − 3x 4 = −6 x 1 + x 2 + x 3 + x 4 =2. . (D S. x 1 =0,x 2 =1,x 3 = −1, x 4 =2)