- 7
- 0
- 约2.68万字
- 约 100页
- 2018-10-14 发布于广西
- 举报
Congruence equations(cont. 7) Theorem 6: If the common solution for (7) exists, it can be computed as (8) where Miller-Ribin method for quasi-primality testing Lemma 1: If p is a prime number, then Congruence equations(cont. 8) (9) iff. x??1 (mod p). Lemma 2: If the following quadratic congruence equation has solution not equal to ?1 , (10) then m is a composite number (not prime number). Theorem 6(Quasi-primality testing): Given any odd integer m, m can be represented as m=1+2jd, where 2j||(m-1). Randomly choose an integer within 1~m, the so-called b-sequence is defined by Congruence equations(cont. 9) (11) Due to lemma 2, if m is a prime, the b-sequence modulo m results in residue numbers as where ?s represent integers not equal to 1. Congruence equations(cont. 10) Key point: In the b-sequence modulo m result sequence, (a) the result before the first 1 cannot be ?; ( can be the before beginning or -1) (b) 1 has to occur in the result sequence. If b-sequence satisfies above (a) and (b), m is passed the primality testing based on b-sequence. Theorem 7: Randomly choose k integers b1,b2,···,bk within 1~m, the probability that m can get pass above quasi-primality testing based on every bi-sequence (i=1,2,···,k) is 1/4k. Congruence equations(cont. 11) k 1/4k 10 10-6 25 10-15 30 10-18 50 10-30 100 10-60 168 10-101 1000 10-602 ACM exercise 1: Given a large positive integer, present that it is a prime or not. Input: The first line is an integer T, representing T integers need to test. Beneath the first line, there are T lines providing T integers denoted by N (2N21024). Output: If N is prime, output prime in a line, otherwise output not prime. Algorithm description: 1) k=1000; // probability of composite number10-601 2) read N; 3) computing j and d; 4) generating a random number b within 1~N. 5) r0=-1; r=bd mod N; i=1; 6) if (r=1) or (i=j), then goto 9); otherwise do 7); 7) r0=r; r=(r?r) mod N; i++; 8
您可能关注的文档
- 10体育说课-(精品课件).ppt
- 10-项目成本计划-(精品课件).ppt
- 10章甾体激素类药物的分析-(精品课件).ppt
- 011电路与电路模型-(精品课件).ppt
- 11、万千气象的宋代社会风貌-(精品课件).ppt
- 11_难忘的泼水节-(精品课件).ppt
- 11-15专项区域规划-(精品课件).ppt
- 11《中国早期政治制度的特点》-(精品课件).ppt
- 11C语言程序的结构-(精品课件).ppt
- 11鸽巢原理的简单形式-(精品课件).ppt
- 2025年全国演出经纪人员资格认定考试试卷带答案(研优卷).docx
- 2025年全国演出经纪人员资格认定考试试卷完整版.docx
- 2025年全国演出经纪人员资格认定考试试题库及完整答案.docx
- 2025年全国演出经纪人员资格认定考试试卷完美版.docx
- 2025年全国演出经纪人员资格认定考试试卷含答案(实用).docx
- 2025年全国演出经纪人员资格认定考试试卷及答案(各地真题).docx
- 2025年下半年内江市部分事业单位公开考试招聘工作人员(240人)备考题库附答案.docx
- 2025年全国演出经纪人员资格认定考试试卷及答案1套.docx
- 2025年下半年四川成都市郫都区面向社会引进公共类事业单位人员2人备考题库最新.docx
- 2025年下半年内江市部分事业单位公开考试招聘工作人员(240人)备考题库附答案.docx
最近下载
- 塔吊工作安全培训内容课件.pptx VIP
- 2024-2025学年天津市部分区七年级(上)期末历史试卷(含答案).docx
- 天津大学物理化学教学课件ppt合集.pptx
- 土豆种植时间和方法.doc VIP
- SMAR公司DT301密度计说明书.pdf
- 2、高鸿业宏观经济学教案.doc VIP
- 高杆灯取电照明装置.pdf VIP
- Unit 2 Expressing yourself Part B let's learn 教案 三年级英语下册 人教PEP版.docx VIP
- 【通用】马年猜猜乐PPT(猜成语)打印版【课件】.pptx
- PDCA循环-提高手术间无菌物品定位放置规范率PPT优秀案例.pptx
原创力文档

文档评论(0)