TANG LIEN DOAN LAO DING VIaT NAM TRUONG DAI HaC TON DUC THANG KHOA CONG NGHE THONG TIN
727 BAO CAO CUOI KY
MON CAU TRUC ROI RAC
Người hướng din TS NGUYEN THE HUYNH TRAM
Người thực hiện NGUYÊN VÕ CÔNG HUY
Lép : 20050301
Khoá : 24
THÀNH PHÓ HÒ CHÍ MINH, NĂM 2021
Trang 2TANG LIEN DOAN LAO DING VIaT NAM TRUONG DAI HaC TON DUC THANG KHOA CONG NGHE THONG TIN
BAO CAO CUOI KY
MON CAU TRUC ROI RAC
Ngưái huéng din: TS NGUYEN THE HUYNH TRAM
Ngưái thực hán: NGUYÊN VÕ CÔNG HUY
Lép : 20050301 Khoá : 24
THANH PHO HO CHi MINH, NAM 2021
Trang 3LOI CAM ON
Em xin chân thành cÁm ơn đạn cô Nguyén Thé Huynh Tram, va déi ngii giAng viên trưáng đại học Tôn Đức ThÁng đã tạn tình giÁng dạy trong suét dai déch giip em hoàn thành bài cáo này.
Trang 4Ngoài ra, trong luạn văn còn sợ dụng mệt sề nhạn xét, đánh giá cũng như sẽ liáu
của các tác giÁ khác, cơ quan tã chức khác đều có trích dẫn và chú thích nguán gêc Nấu phát hiền có bất kỳ sự gian lấn nào tôi xin hoàn toàn chều trách nhiềm về nội dung luẫn văn cya mình Trưáng đại học Tôn Đức ThÁng không liên quan đạn nhụng vi phạm tác quyên, bÁn quyền do tôi gây ra trong quá trình thực hián (nạu có)
TP Hồ Chí Minh, ngày 25 tháng 12 năm 2021
Tác giả Huy
Nguyễn Võ Công Huy
Trang 51H
TÓM TÀT
Bai bao cdo bao gam cac néi dung cét lõi, chung nhất của môn Cầu Trúc Rái Rạc, giúp nÁm vụng nền móng các hưởng tư duy thuần cơ bÁn nhằm giúp sinh viên ghi nhê và hiáu sâu hơn về bê môn nay.
Trang 6MUC LUC
0100909005 i
¡y0 — ,ÔỎ iii \ 10090 0091 ÔỎ 1 DANH MUC KI HIaU VA CHU VIẾT TẮTT ¿ 555¿222ssstzxerrrrvrrrrrrrrrrrrree 2 DANH MỤC CÁC BANG BIAaU, HINH VE, Da THI oo.eeeseecscsscsseseeseesesetseeseeseeeeseesees 3 Question 1 — Euclid’s algorithm and Bezouf”s 1e€nIfy . 55-525 <2< 2s ssrsersers 4 6): )00 00-00-09 0n 5
Trang 7DANH MUC ki HIEU VA CHU VIAT TAT
CAC KY HIEU CAC CHU VIAT TAT
Trang 8DANH MUC CAC BANG BIaU, HINH VE, DO THE
DANH MỤC HÌNH
DANH MỤC BẢNG
Trang 9Question 1: Euclid’s algorithm and Bezout’s identity
a Using Euclid’s algorithm to calculate ged(2021, 1000 + m) and Icm(2021, 1000 + m), where m is the last 3 digits of your student ID
Solve Student ID : 52000765 } m= 765
Let’s trace Euclid’s algorithm to calculate gcd(2021;1765) gcd(2021;1765)
2021 = 1765*1 + 256 gcd(1765;256) 1765 = 256*6 + 229 <— ged(256;229)
256 = 229*1 + 27 < ged(229;27) 229 = 27*8 + 13 — ged(27313)
27 = 13*2 + 1 & ged(1331) 13 = 1*13 +0 © ged(1;0)
gcd(a;b) * Iem(a;b) = a * b
> lem = ray” seacnmnaray™ y= 3557065
b Apply above result(s) in to find 5 integer solution pairs (x,y) of this equation: 2021x + (1000 + m)y = gcd(2021; 1000 + m)
Solve Student ID : 52000765 } m= 765
> Equation : 2021x + 1765y = gcd(2021; 1765)
Trang 101 = 27 - 13*2 = 274 13*(-2)
= 27 + (229 — 27*8)*(—-2) = 229*(-2) + 27*17 = 229*(—2) + (256 — 229)*17
= 229*(-19) + 256*17 = (1765 — 256*6)*(-19) 4+ (2021 — 1765)*17 = [1765 — (2021 — 1765)*6]*( —19) + (2021 — 1765)*17
= [2021*(-6) + 1765*7]*( -19) + (2021 — 1765)*17 = 2021*131 + 1765*(-150)
Thus 1 = 2021*131 + 1765*(-150) Due to the form of equation: ax + by = d, so
Once a solution pair (x, y) is found, additional pairs may be generated by
ORD
(xe oH ; 1 a” where k is any integer O8a : :
ORD ORG _ Rab
Proof steck: a * (x ¢ Sm FOO Rg) = axe > A #by ©Ãab_ a = OF
1 = 2021*131 + 1765*(-150)
Question 2: Recurrence relation
Solve the recurrence relation
Trang 11ae=5 and ai=m=65
This sequence sitisfies part of the hypothesis of the single-root theorem because it satisfies a second-order linear homogeneous recurrence relation with constant coefficients(A = 8 and B = -15) To check that it satisfies the second part of the hypothesis, examine the characteristic equation
®—8t+ 15=0
By the quadratic formula t = 5, t = 3 [since — 8 + 15 = (t — 5)*(t— 3)] and so the roots are distinct Thus it follows from the distinct-roots theorem that the sequence is given by the explicit formula
an = C*5"° 4+ D*3" for each integer n 20
Where C and D are the numbers whose values are determined by the fact that ao= 5; ai = 65 To find C and D, write ap = 5 = C + D and ai = 65 = 5*C + 3*D
Trang 12Question 3: Set
a Create a set I’ of characters from your case-insensitive non-diacritical full name For example, the set corresponding with “Tén Duc ThAng= is A= {A,C, D, G,H,N, O, T, U}
Solve My full name: “Nguyễn Võ Công Huy= >1 ={C,EF,G,H,N,O,U,V,Y}
b Find the union, intersect, non-symmetric difference, and symmetric difference of and A, where I’ and A are from question 3a
Solve Rewrite : 1 = {C, E, G, H, N, O, U, V, Y} and A= {A, C, D, G, H, N, O, T, U} The union:
TUA={xEU|x El ex EA}
A= {A,C,D,G,H,N,0,T, The intersect:
TN A={x €U|x El ax EA}
F={Œ,E,6, ch N0 10T ¬
A ={A,C,D,G,H,N,O,T, The non-symmetric difference:
A\T={x €U|x €Aax €T}
F={Œ,E,6, eee AS rete vey)
A= {A,C,D,G,H,N,0,T, The symmetric difference:
Tl OA={x€Ulx€A@x £7}
T = {C,E,G,H,N,0,U,V,Y }= A ={A,C,D,G,H,N,O,T, 7
Trang 13Question 4: Relations
Let 8 be a binary relation defined on 2 integers as follow: Va, b EN (aRbO@N|(a.b)) where m is the last 2 digits of your student ID
By definition of R, this means that
For every a EN , 65|(a.a),
which is false because a.a = a” and 3a € N such that 65} a? Asa counterexample, let a
=4 > a= 16 and 65/16
R is symmetric: To show that R is symmetric, it is necessary to show that For every a € N, if aRb then bRa
By definition of R, this means that
For every a € N, if 65|(a.b) then 65|(b.a)
which is true because a.b = b.a by the commutative law of multiplication Fl(A-1 Epp)
Trang 14R is not anti-symmetric: To show that R is anti-symmetric, it is necessary to show that For every a € N, if aRb and bRa then b=a
By definition of R, this means that
For every a EN, if 65|(a.b) and 65|(b.a) then b =a
which is false because 65|(a.b) and 65|(b.a) but a and b can be different As a counterexample, a = | and b = 65 then 65|(a.b) and 65|(b.a) but 1 4 65
R is not transitive: To show that R is transitive, it is necessary to show that
For every a,b,c EN, ifaRbandbRcthenaRe
By definition of R, this means that:
For every a,b,c € N, if 65|(a + b) and 65|(b+ c) then 65|(a + c)
which is false because a = 42, b = 23, c = 107 then 2|(a + b) and 2|(b+ c) but 65t(a +c)
Question 5: Multiplicative invertion
a Study and present your knowledge about Extended Euclidean algorithm to compute multiplicative inverses in modular structures
Solve
Trang 1510
b Apply the algorithm to find (m+1)! (mod 101) where m is the last 2 digits of your student ID
Solve StudentID : 52000765 ® m = 66
=> (m+1}'! (mod 101) = 66!(mod 101)
Let’s trace Euclhid”s algorithm to caleulate gcd(66,101)
101 = 66 + 35 66 = 35 + 31
35=31+4 31 =4*7+3
4=1*34+1 Thus gced(66,101) = 1 1=4-1.3
= 4*8 — 3] = 8*35 — 9*3]
= 8*(101 — 66) — 9*(66 — 35) = 8*{101 — 66) — 9*[66 — (101 — 66)]
=—-26*16 + 17*101 Thus | = (-26)*66 + 17*101 1 = (-26)*66 + 17*101(mod 101) => | = (-26)*66 (mod 101)
Trang 1611
Question 6: Kruskal’s Algorithm
Propose a solution for circuit-checking in Kruskal's algorithm Solve
This is a graph example to find a solution for circuit-checking in Kruskal’s algorithm
as follow:
Trang 17A,C 3
D,T 2
2
Trang 19minimumcos spanning tree
7 AA 8)
@) 1 a 2 vy a
Eo) 3 DL e
Trang 20Question 7: Eulerian circuit
a Does the following graph have an Eulerian circuit or Eulerian path? Why?
Trang 22
c If the graph has an Eulerian circuit, use Hierholzer's algorithm to find an Eulerian circuit of that graph when the initial circuit R1 is:
i If abcd % 4 = 0 then R1 is EINME ii If abcd % 4 = 1 then R1 is abhga iii If abcd % 4 = 2 then R1 is UVbaU iv If abcd % 4 = 3 then R1 is XCdX
Solve Student ID : 52000765 } abcd % 4= 1 R1 is abhga The initial circuit RI:a > bP>hA>egDa
Circut R2: a ® U Ð VÐĐP2ZSĐOQ>LOEĐROSFA>LK>A2S]2SKSP ^ĐO>U>>TNO>2J2>IAE-INĐM>E>B>M>S^B >Y2ec>BG>cf>k GD klD>mĐnĐD>H> n>>¡i>j>C>Hjdcb>VYĐW>QO>R>FC>R>>XxX>C >d>X>>Wcih>m>lSgfZ2YS>TZ>a Completed Eulerian circuit:
Trang 23Question 8: Map Coloring
Give this map:
Trang 30Modulo, va Dénh ly sé du Trung Quéc
3 Chuong Le Hoang (wordpress.com) — Thuat toán Kruskal — Tìm cây bao trùm nhỏ nhất
Applications Berlin, Springer.
Trang 3126
PHU LUC