数论、组合数学、具体数学.ppt

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

2888 一条项链,n个珠子,m种颜色,给定k对颜色不能相邻,循环同构,求方案数? * 数论、组合数学、具体数学 李 寅 Euclidean algorithm Gcd( a , b ) = gcd( b*(a/b)+(a%b) , b ) = gcd( b , a%b ) = … Extended Euclidean algorithm The iterative method The recursive method The iterative method Recursive method Miller Rabbin BASIS: a^p mod p = a That is , a^(p-1) mod p = 1 TOOLS: power_product Cycle detection Rho How to calculate : HASH? Floyds cycle-finding algorithm The key insight in the algorithm is that, whenever i 0 is a multiple of λ that is greater than μ, xi = x2i (and conversely). Thus, we need only check for repeated values of this special form to find a period ν of a repetition that is a multiple of λ. Once ν is found, we may retrace the sequence from its start to find the first repetition of length ν; since λ divides ν, xν + μ = xμ, the start of the first repetition. Finally, from xμ it is trivial to find the length of the shortest repeating cycle, xμ + λ = xμ. Brents algorithm X1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 Pollard Rho – factorize bigint The rho algorithm is based on Floyds cycle-finding algorithm and on the observation that (as in the birthday paradox) two numbers x and y are congruent modulo p with probability 0.5 after numbers have been randomly chosen. If p is a factor of n, the integer we are aiming to factor, then since p divides both and n. Note that this algorithm will return failure for all prime n, but it can also fail for composite n. In that case, use a different f(x) and try again Practice POJ 1811 modular_linear_equation ax mod n = b ax = ny + b ax – ny =b d = gcd(a, n) If( b % d !=0 ) :: no solution else solve ax0 – ny0 = d X = (x0 * b/d + n) % n Euler Function (1) (2) (3) (4) (5) pku2480 Solution: Euler递推式 若(N%a==0 (N/a)%a==0) 则有: 若(N%a==0 (N/a)%a!=0) 则有: The Farey Sequence Fn for any integer n with n = 2 is the set of irreducible rational numbers a/b with 0 a b = n and gcd(a,b) = 1 arrang

文档评论(0)

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

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

1亿VIP精品文档

相关文档