作者decimal (好恐怖)
看板Grad-ProbAsk
标题Re: [问题] 离散 问题
时间Wed Mar 18 22:23:35 2009
※ 引述《yshihyu (yshihyu)》之铭言:
: X 余 2 (mod 3)
: X 余 1 (mod 4)
: X 余 2 (mod 5)
: 要找X 最小两个整数值
: 请问最小两个要怎麽找?
: 答案应该是 17, 77
: 谢谢
利用中国余数定理
r1 = 2 , r2 = 1 , r3 = 2
n1 = 3 , n2 = 4 , n3 = 5 , n = 60
N1 = 20 , N2 = 15 , N3 = 12
M1 = 20^-1 mod 3 = -1
M2 = 15^-1 mod 4 = -1
M3 = 12^-1 mod 5 = 2
x = r1*M1*N1 + r2*M2*N2 + r3*M3*N3 (mod 60) = 17
x = 17 + 60t (t = 0 ,1)
thus, x = 17 , 77
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 218.211.12.224
1F:→ yshihyu:原来是这样~ @@.. 03/18 23:59