Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 33 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
33
Dung lượng
1,31 MB
Nội dung
TON RI RC Discrete Mathematics Fall 2009 Toỏn ri rc Nguyễn Đức Nghĩa Bộ môn Khoa học Máy tính Đại học Bách khoa Hà nội Tel: 0438696121 (Off), 0903210111 (Mob) nghiand@it-hut.edu.vn Toỏn ri rc ngh vi cỏc lp trng Hóy gi cho tụi danh sỏch lp theo a ch email ó nờu Toỏn ri rc Toỏn ri rc l gỡ? What is discrete mathematics? L b phn ca toỏn hc nghiờn cu cỏc i tng ri rc Ri rc bao hm ý cỏc phn t phõn bit hay khụng liờn tc Cỏc phộp toỏn: T hp: m cỏc i tng ri rc Cỏc phộp toỏn logic, quan h: núi lờn mi quan h gia cỏc i tng ri rc Lm vic vi: Cỏc i tng ri rc: hp, mnh Toỏn ri rc nh ngha hỡnh thc - Wikipedia Discrete mathematics, sometimes called finite mathematics, is the study of mathematical structures that are fundamentally discrete, in the sense of not supporting or requiring the notion of continuity Most, if not all, of the objects studied in finite mathematics are countable sets, such as the integers Discrete mathematics has become popular in recent decades because of its applications to computer science Concepts and notations from discrete mathematics are useful to study or express objects or problems in computer algorithms and programming languages In some mathematics curricula, finite mathematics courses cover discrete mathematical concepts for business, while discrete mathematics courses emphasize concepts for computer science majors Discrete mathematics usually includes : logic - a study of reasoning set theory - a study of collections of elements number theory combinatorics - a study of counting graph theory algorithmics - a study of methods of calculation information theory the theory of computability and complexity - a study on theoretical limitations on algorithms Toỏn ri rc Nhp mụn Toỏn ri rc Cỏc ng dng ca TRR: Formal Languages (computer languages) Machine translation Compiler Design Artificial Intelligence Relational Database Theory Network Routing Algorithm Design many more (almost all areas of computer science) A building block of computer science ! Toỏn ri rc Nhp mụn Toỏn ri rc Cỏc chớnh c cp giỏo trỡnh ny: C s: logic, hp, ỏnh x Lý thuyt t hp (Combinatorial Theory) Lý thuyt th (Graph theory): Bi toỏn m Bi toỏn tn ti Bi toỏn lit kờ Bi toỏn ti u th, ng i, Liờn thụng Biu din th Duyt th Cỏc bi toỏn ti u trờn th Toỏn ri rc Ti liu tham kho Rosen K.H Discrete Mathematics and its Applications McGraw - Hill Book Company, 2003 Johnsonbaugh R Discrete Mathematics Prentice Hall Inc., N J., 1997 Grimaldi R.P Discrete and Combinatorial Mathematics (an Applied Introduction), AddisonWesley, 5th edition, 2004 R Graham, O Patashnik, and D.E Knuth Concrete Mathematics, Second Edition AddisonWesley, 1994 Ti liu tham kho Phan ỡnh Diu Lý thuyt ụtụmat hu hn v thut toỏn NXB HTHCN, H ni, 1977 Nguyn Hu Anh Toỏn ri rc, NXB Giỏo dc,1999 Nguyn Xuõn Qunh C sToỏn ri rc v ng dng NXB KHKT, H ni, 1996 c Giỏo Toỏn ri rc NXB KHKT, H ni, 2001 Hong Chỳng i cng v toỏn hu hn NXB Giỏo dc, 1997 Rosens Book http://www.mhhe.com/math/advmath/rosen/index.mhtml Rosen K.H Discrete Mathematics and its Applications 5th Edition, McGraw - Hill Book Company, 2003 10 Mc lc Phần I Lý thuyết Tổ hợp Chng M u 1.1 S lc v t hp 1.2 Nhc li lý thuyt hp 1.3 Mt s nguyờn lý c bn 1.4 Cỏc cu hỡnh t hp n gin Chng Bi toỏn m 2.1 Gii thiu bi toỏn 2.2 Nguyờn lý bự tr 2.3 Quy v cỏc bi toỏn n gin 2.4 Cụng thc truy hi 2.5 Lit kờ Chng Bi toỏn tn ti 3.1 Gii thiu bi toỏn 3.2 Phng phỏp phn chng 3.3 Nguyờn lý Dirichlet 3.4 H i din phõn bit Chng Bi toỏn lit kờ 4.1 Gii thiu bi toỏn 4.2 Thut toỏn v phc tớnh toỏn 4.3 Phng phỏp sinh 4.4 Thut toỏn quay lui Chng Bi toỏn ti u 5.1 Phỏt biu bi toỏn 5.2 Cỏc thut toỏn duyt 5.3 Thut toỏn nhỏnh cn gii bi toỏn ngi du lch 5.4 Bi toỏn lp lch gia cụng trờn hai mỏy Phần Lý thuyết đồ thị Chng Cỏc khỏi nim c bn ca lý thuyt th 1.1 nh ngha th 1.2 Cỏc thut ng c bn 1.3 ng i, Chu trỡnh, th liờn thụng 1.4 Mt s dng th c bit Chng Biu din th trờn mỏy tớnh 2.1 Ma trn k Ma trn trng s, 2.2 Danh sỏch cnh 2.3 Danh sỏch k Chng Cỏc thut toỏn tỡm kim trờn th v ng dng 3.1 Tỡm kim theo chiu sõu trờn th 3.2 Tỡm kim theo chiu rng trờn th 3.3 Tỡm ng i v kim tra tớnh liờn thụng Chng th Euler v th Hamilton 4.1 th Euler 4.2 th Hamilton Chng Cõy v cõy khung ca th 5.1 Cõy v cỏc tớnh cht ca cõy 5.2 Cõy khung ca th 5.3 Xõy dng cỏc chu trỡnh c bn ca th 5.4 Bi toỏn cõy khung nh nht Chng Bi toỏn ng i ngn nht Chng Bi toỏn lung cc i mng Phần Hàm đại số lôgic Chng M u Chng Dng tuyn chun tc ca hm i s lụgic Chng Thut toỏn tỡm dng tuyn chun tc ti thiu Ti liu tham kho 19 Quetions? 20 Fall 2006 Toỏn ri rc 21 Fall 2006 Toỏn ri rc 22 ng dng: Ngụn ng hỡnh thc Formal Language Formal language: Ngụn ng c sinh bi ng phỏp (grammars) Grammars: T (Words): Sinh cỏc t (words) ca ngụn ng Xỏc nh mt t cú thuc ngụn ng hay khụng Cú th t hp bng nhiu cỏch Ng phỏp cho bit t hp t cú l mt cõu hp l (valid sentence) hay khụng ng dng: Thit k cỏc Ngụn ng lp trỡnh v Chng trỡnh dch (Programming Languages and Compilers) Fall 2006 Toỏn ri rc 23 ng dng: Ngụn ng hỡnh thc Vớ d 1: Ngụn ng t nhiờn: English Cú phi the hungry rabbits eats quickly l cõu ting Anh? Cõy cỳ phỏp ca cõu (Derivation tree of the sentence): sentence noun phrase Fall 2006 verb phrase article adjective noun verb adverb the hungry eats quickly rabbit Toỏn ri rc 24 ng dng: Ngụn ng hỡnh thc Vớ d 2: Bi toỏn in hỡnh xõy dng Chng trỡnh dch Xỏc nh t cbab cú thuc ngụn ng sinh bi ng phỏp G = (V, T, S, P), ú: V = { a, b, c, A, B, C, S } T = { a, b, c } S l ký t u tiờn (starting symbol) P l cỏc lut sn xut (productions): S AB B Cb Cb Fall 2006 A Ca Bb B Ba C cb Toỏn ri rc 25 ng dng: Ngụn ng hỡnh thc Vớ d (tip tc): Gii: Bt u bi S v tỡm cỏch dn cbab s dng dóy cỏc lut sn xut Do ch cú mt lut bt u viS, ta phi bt u vi Fall 2006 S AB S dng lut i vi A thu c: S AB CaB S dng lut i vi C cb vỡ cbab bt u bi cb: S AB CaB cbaB Cui cựng s dng lut i vi B b: S AB CaB cbaB cbab Toỏn ri rc 26 ng dng: Graph Theory Vớ d Bi toỏn v cỏi cu (Konigsberg 7-bridge problem) Konigsberg l thnh ph ca Nga Cú vựng t, v cỏi cu ni chỳng Euler gii c bi toỏn nm 1736; l ngun ca lý thuyt th Fall 2006 Toỏn ri rc 27 ng dng: Graph Theory Bi toỏn: V ng i (hoc vũng kớn) bi bỳt chỡ cho cú th i qua mi cỏi cu ỳng mt ln m khụng c nhc u bỳt mt giy (v mt nột) Fall 2006 Toỏn ri rc 28 ng dng: Lý thuyt hp (Set Theory) Cú phi s lng s nguyờn l nhiu hn s lng s nguyờn dng? Cú phi s lng s nguyờn l nhiu hn s lng s thc? Fall 2006 Toỏn ri rc 29 ng dng: Lý thuyt phc (Complexity Theory) Vớ d 5: Bi toỏn ngi du lch (The Traveling Salesman Problem) Cú ng dng quan trng Cho: Thit k mch (circuit design) Hng l trờn mng (network routing) v nhiu bi toỏn tin hc khỏc n thnh ph c , c , , c khong cỏch gia thnh ph i v j l d Fall 2006 n ij Tỡm hnh trỡnh ngn nht Toỏn ri rc 30 ng dng: Lý thuyt phc Vớ d (tip): Fall 2006 Cú bao nhiờu hnh trỡnh khỏc nhau? Thnh ph u tiờn cú th chn bi n cỏch, # hnh trỡnh = n (n-1) (n-2) (2) (1) = n! (T hp) Tng s phộp cng = (n-1) ì n! (Qui tc nhõn - Rule of Product) thnh ph th hai, n-1 cỏch, thnh ph th ba, n-2 cỏch, v.v Tớnh di ca mt hnh trỡnh ũi hi n-1 phộp cng Toỏn ri rc 31 ng dng: Lý thuyt phc Vớ d (tip): Gi s cú PC tc rt cao: Fall 2006 GHz = 1,000,000,000 ops/sec flop = nanosecond = 10-9 sec Nu n=8, T(n) = 78! = 282,240 flops