1. Trang chủ
  2. » Giáo Dục - Đào Tạo

BÁO cáo CUỐI kỳ môn cấu TRÚC rời rạc

32 55 4

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Nội dung

TỔNG LIÊN ĐOÀN LAO ĐỘNG VIỆT NAM TRƯỜNG ĐẠI HỌC TÔN ĐỨC THẮNG KHOA CÔNG NGHỆ THÔNG TIN BÁO CÁO CUỐI KỲ MÔN CẤU TRÚC RỜI RẠC Người hướng dẫn: TS NGUYỄN THỊ HUỲNH TRÂM Người thực hiện: NGUYỄN VÕ CƠNG HUY Lớp : 20050301 Khố THÀNH PHỐ HỒ CHÍ MINH, NĂM 2021 0 : 24 TỔNG LIÊN ĐOÀN LAO ĐỘNG VIỆT NAM TRƯỜNG ĐẠI HỌC TÔN ĐỨC THẮNG KHOA CÔNG NGHỆ THÔNG TIN BÁO CÁO CUỐI KỲ MÔN CẤU TRÚC RỜI RẠC Người hướng dẫn: TS NGUYỄN THỊ HUỲNH TRÂM Người thực hiện: NGUYỄN VÕ CÔNG HUY Lớp : 20050301 Khố THÀNH PHỐ HỒ CHÍ MINH, NĂM 2021 0 : 24 i LỜI CẢM ƠN Em xin chân thành cảm ơn đến cô Nguyễn Thị Huỳnh Trâm, đội ngũ giảng viên trường đại học Tôn Đức Thắng tận tình giảng dạy suốt đại dịch giúp em hoàn thành cáo 0 ii CƠNG TRÌNH ĐƯỢC HỒN THÀNH TẠI TRƯỜNG ĐẠI HỌC TƠN ĐỨC THẮNG Tơi xin cam đoan cơng trình nghiên cứu riêng hướng dẫn khoa học TS Nguyễn Thị Huỳnh Trâm; Các nội dung nghiên cứu, kết đề tài trung thực chưa cơng bố hình thức trước Những số liệu bảng biểu phục vụ cho việc phân tích, nhận xét, đánh giá tác giả thu thập từ nguồn khác có ghi rõ phần tài liệu tham khảo Ngồi ra, luận văn cịn sử dụng số nhận xét, đánh số liệu tác giả khác, quan tổ chức khác có trích dẫn thích nguồn gốc Nếu phát có gian lận tơi xin hoàn toàn chịu trách nhiệm nội dung luận văn Trường đại học Tơn Đức Thắng khơng liên quan đến vi phạm tác quyền, quyền tơi gây q trình thực (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 0 iii TÓM TẮT Bài báo cáo bao gồm nội dung cốt lõi, chung môn Cấu Trúc Rời Rạc, giúp nắm vững móng hướng tư nhằm giúp sinh viên ghi nhớ hiểu sâu môn 0 MỤC LỤC LỜI CẢM ƠN i TÓM TẮT iii MỤC LỤC DANH MỤC KÍ HIỆU VÀ CHỮ VIẾT TẮT DANH MỤC CÁC BẢNG BIỂU, HÌNH VẼ, ĐỒ THỊ Question – Euclid’s algorithm and Bezout’s identity Question – Recurrence relation Question – Set Question – Relations Question – Multiplicative inversion Question – Kruskal’s algorithm .11 Question – Eulerian circuit 15 Question – Map coloring 18 TÀI LIỆU THAM KHẢO 25 PHỤ LỤC 26 0 DANH MỤC KÍ HIỆU VÀ CHỮ VIẾT TẮT CÁC KÝ HIỆU CÁC CHỮ VIẾT TẮT 0 DANH MỤC CÁC BẢNG BIỂU, HÌNH VẼ, ĐỒ THỊ DANH MỤC HÌNH DANH MỤC BẢNG 0 Question 1: Euclid’s algorithm and Bezout’s identity a Using Euclid’s algorithm to calculate gcd(2021, 1000 + m) and lcm(2021, 1000 + m), where m is the last 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  gcd(256;229) 256 = 229*1 + 27  gcd(229;27) 229 = 27*8 + 13  gcd(27;13) 27 = 13*2 +  gcd(13;1) 13 = 1*13 +  gcd(1;0) Thus gcd(2021;1765) = gcd(a;b) * lcm(a;b) = a * b  lcm(a;b) = = = = 3567065 b Apply above result(s) in to find 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) = 27 – 13*2 = 27 + 13*(–2) 0 = 27 + (229 – 27*8)*(–2) = 229*(–2) + 27*17 = 229*(–2) + (256 – 229)*17 = 229*(–19) + 256*17 = (1765 – 256*6)*(-19) + (2021 – 1765)*17 = [1765 – (2021 – 1765)*6]*( –19) + (2021 – 1765)*17 = [2021*(–6) + 1765*7]*( –19) + (2021 – 1765)*17 = 2021*131 + 1765*(–150) Thus = 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 , where k is any integer Proof steck: = 2021*131 + 1765*(–150) k=1 => k = 19 => k = 11 => k=2 => = (1896; –2171) = (35431; –40570) = (54846; –62801) = (58376; –66843) k = 2002 => = (3591906; –4112885) Question 2: Recurrence relation Solve the recurrence relation an = 8an−1 – 15an−2 with a0 = and a1 = m, where m is the last digits of your student ID Solve Student ID : 52000765  m = 65 0 13 Next cost is 3, and associated edges are A,C and C,D We add them again 0 14 Next cost in the table is 4, and we observe that adding it will create a circuit in the graph So we ignore it In the process we shall avoid all edges that create a circuit We observe that edges with cost and also create circuits We ignore them and move on Now we are left with only one node to be added Between the two least cost edges available and 8, we shall add the edge with cost By add edge S,A we have minimumcos spanning tree 0 15 Question 7: Eulerian circuit a Does the following graph have an Eulerian circuit or Eulerian path? Why? Solve The graph have Eulerian circuit the graph have an Eulerian path that starts and ends on the same vertex (this thing is proven in c) and a necessary conditional for the existence of Eulerian circuit is that all vertives in the graph have an even degree, and stated without proof that connected graphs with all vertives of even degree have an Eulerian circuit The first complete proof of this latter claim was published posthumously in 1873 by Carl Hierholzer Thus, the graph don’t have Eulerian path 0 Question 4: Relations Let ℜ be a binary relation defined on integers as follow: ∀ ∀ , � ∈ N (aRb↔� |(�.�)) where m is the last digits of your student ID Is R reflexive, symetric, anti-symetric, transitive? Prove your answer Solve Student ID : 52000765  m = 65 Rewrite the binary relation defined on integers subtituted: ∀ ∀, � ∈ N (aRb↔65|(�.�)) R is not reflexive: To show that R is reflexive, it is necessary to show that For every a ∈ N, aRa By definition of R, this means that For every a ∈ N , 65|(a.a), which is false because a.a = a2 and ∃a ∈ N such that 65∤ a2 As a counterexample, let a =  a2 = 16 and 65∤16 Hence R is not reflexive 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 F1(A-1 Epp) Hence R is symmetric 0 R 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 ∈ N, 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 ≠ 65 Hence R is not anti-symmetric R is not transitive: To show that R is transitive, it is necessary to show that For every a ,b, c ∈ N, if a R b and b R c then a R c 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 65∤(a + c) Hence R is not transitive Question 5: Multiplicative invertion a Study and present your knowledge about Extended Euclidean algorithm to compute multiplicative inverses in modular structures Solve The version of the Euclidean algorithm described above (and by Euclid) can take many subtraction steps to find the GCD when one of the given numbers is much bigger than the other A more efficient version of the algorithm shortcuts these steps, instead replacing the larger of the two numbers by its remainder when divided by the smaller of the two (with this version, the algorithm stops when reaching a zero 0 remainder) With this improvement, the algorithm never requires more steps than five times the number of digits (base 10) of the smaller integer 10 b Apply the algorithm to find (m+1)-1 (mod 101) where m is the last digits of your student ID Solve StudentID : 52000765  m = 66  (m+1)–1 (mod 101) = 66-1(mod 101) Let’s trace Euclid’s algorithm to calculate gcd(66,101) 101 = 66 + 35 66 = 35 + 31 35 = 31 + 31 = 4*7 + = 1*3 + Thus gcd(66,101) = 1 = – 1.3 = 4*8 – 31 = 8*35 – 9*31 = 8*(101 – 66) – 9*(66 – 35) = 8*(101 – 66) – 9*[66 – (101 – 66)] = –26*16 + 17*101 Thus = (-26)*66 + 17*101 = (-26)*66 + 17*101(mod 101) => ≡ (-26)*66 (mod 101) 66-1 = -26 mod 101 = (-26 + 101) mod 101 = 75 mod 101 0 11 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: 0 0 12 Step 1: Remove all loops and ParallelEdges (*Note: In case of parallel edges, keep the one which has the least cost associated and remove all others) Step 2: Create a set of edges and weight, and arrange them in an ascending order of weightage (cost) B,D D,T A,C C,D C,B B,T 2 3 Step 3: Add the edge which has the least weightage A,B S,A S,C Now we start adding edges to the graph The least cost is and edges involved are B,D and D,T We add them Adding them does not violate spanning tree properties, so we continue to our next edge selection 0 13 Next cost is 3, and associated edges are A,C and C,D We add them again 0 14 Next cost in the table is 4, and we observe that adding it will create a circuit in the graph So we ignore it In the process we shall avoid all edges that create a circuit 0 We observe that edges with cost and also create circuits We ignore them and move on Now we are left with only one node to be added Between the two least cost edges available and 8, we shall add the edge with cost By add edge S,A we have minimumcos spanning tree 0 ... LIÊN ĐOÀN LAO ĐỘNG VIỆT NAM TRƯỜNG ĐẠI HỌC TÔN ĐỨC THẮNG KHOA CÔNG NGHỆ THÔNG TIN BÁO CÁO CUỐI KỲ MÔN CẤU TRÚC RỜI RẠC Người hướng dẫn: TS NGUYỄN THỊ HUỲNH TRÂM Người thực hiện: NGUYỄN VÕ CƠNG HUY... Nguyễn Võ Công Huy 0 iii TÓM TẮT Bài báo cáo bao gồm nội dung cốt lõi, chung môn Cấu Trúc Rời Rạc, giúp nắm vững móng hướng tư nhằm giúp sinh viên ghi nhớ hiểu sâu môn 0 MỤC LỤC LỜI CẢM ƠN ... ngũ giảng viên trường đại học Tơn Đức Thắng tận tình giảng dạy suốt đại dịch giúp em hoàn thành cáo 0 ii CƠNG TRÌNH ĐƯỢC HỒN THÀNH TẠI TRƯỜNG ĐẠI HỌC TƠN ĐỨC THẮNG Tơi xin cam đoan cơng trình

Ngày đăng: 10/08/2022, 07:02

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w