Randomized Algorithms课件.ppt

  1. 1、本文档共34页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Randomized Algorithms课件

Chapter 11;Randomized algorithms ;The closest pair problem ;A randomized algorithm for closest pair finding;Step 3: Construct four sets of squares T1, T2, T3 and T4 derived from T by doubling the mesh-size to 2? . Step 4: For each Ti, find the induced decomposition S=S1(i) ?S2(i) ? … ? Sj(i), 1?i ?4, where Sj(i) is a non-empty intersection of S with a square of Ti. Step 5: For each xp, xq?Sj(i), compute d(xp, xq). Let xa and xb be the pair of points with the shortest distance among these pairs. Return xa and xb as the closest pair.;6δ;6δ;X3;Time complexity;Analysis of Step 5; Construct T1, T2, …, T16 mesh-size: 4?0 The probability that each square in T falls into at least one square of Ti , i = 1, 2, …, 16 is The probability that ;Let the square in T0 with the largest number of elements among the 16 squares have k elements. N(T0) ? c0n = N(Ti ) ? cin;A randomized algorithm to test whether a number is prime. ;Randomized prime number testing algorithm;Examples for randomized prime number testing;Example 2: N = 11 Randomly choose 2, 5, 7 (1) 211-1=1024≡1 mod 11 j=1, (N-1)/2j==5 GCD(25-1, 11) = 1 W(2) does not hold . (2) 511-1=9765625≡1 mod 11 GCD(55-1, 11) = 11 W(5) does not hold . (3) 711-1=282475249≡1 mod 11 GCD(75-1, 11) = 1 W(7) does not hold . Thus, 11 is a prime number with the probability of correctness being at least 1-2-3= 7/8 .;Theorem for number theory ;Pattern matching;Binary representation;Fingerprints of binary strings;Examples for using fingerprints;e.g. X = 10110 , Y = 10011 , P = 3 Bp(X) = (22)3 = 1 Bp(Y(1)) = (19)3 = 1 ? X= Y(1) WRONG! If Bp(X) ? Bp(Y(i)), then X ? Y(i) . If Bp(X) = Bp(Y(i)), we may do a bit by bit checking or compute k different fingerprints by using k different prime numbers in {1,2,…nt2} . ;A randomized algorithm for pattern matching;Step 1: Randomly choose k prime numbers p1, p2, …, pk from {1,2,…,nt2}, where t = m - n + 1. Step 2: i = 1. Step 3: j = 1. Step 4: If B(X)

文档评论(0)

dmdt5055 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档