Day 1:数论——[整除性及组合数学篇]
注:
1.我们用 Z \mathbb{Z} Z 表示整数, ∀ \forall ∀ 表示任意, ∈ \in ∈ 表示属于, ∃ \exists ∃ 表示存在。
2.似乎 ∣ \mid ∣ 的运算优先级特别低,所以注意打括号。
一、整除
1.定义
若有 Z \mathbb{Z} Z a , b a,b a,b , a ≠ 0 a \neq 0 a=0 ,如果 ∃ \exists ∃ 一个 Z \mathbb{Z} Z q q q ,使得 a ⋅ q = b a \cdot q = b a⋅q=b ,则 b b b 能被 a a a 整除( b b b 为 a a a 的倍数),记作 a ∣ b a \mid b a∣b,否则记为 a ∤ b a \nmid b a∤b 。
2.性质
① ① ① 传递性:如果 a ∣ b a \mid b a∣b 且 b ∣ c b \mid c b∣c ,则 a ∣ c a \mid c a∣c 。
证明: ∵ \because ∵ a ∣ b a \mid b a∣b ∴ \therefore ∴ 令 a ⋅ x = b a \cdot x = b a⋅x=b ( x ∈ Z x \in \mathbb{Z} x∈Z 且 x ≠ 0 x \neq 0 x=0 )
又 ∵ \because ∵ b ∣ c b \mid c b∣c ∴ \therefore ∴ 令 b ⋅ y = c b \cdot y = c b⋅y=c ( y ∈ Z y \in \mathbb{Z} y∈Z 且 y ≠ 0 y \neq 0 y=0 )
∴ \therefore ∴ a ⋅ x ⋅ y = c a \cdot x \cdot y = c a⋅x⋅y=c
又 ∵ \because ∵ x , y ∈ Z x, y \in \mathbb{Z} x,y∈Z
∴ \therefore ∴ a ∣ c a \mid c a∣c
② ② ② 如果 a ∣ b a \mid b a∣b 且 b ∣ c b \mid c b∣c ,若有 ∀ \forall ∀ 的 Z \mathbb{Z} Z x , y x, y x,y ,有 a ∣ ( b ⋅ x + c ⋅ y ) a \mid (b \cdot x + c \cdot y) a∣(b⋅x+c⋅y)。
证明: ∵ \because ∵ a ∣ b a \mid b a∣b ∴ \therefore ∴ 令 a ⋅ s = b a \cdot s = b a⋅s=b ( s ∈ Z s \in \mathbb{Z} s∈Z 且 s ≠ 0 s \neq 0 s=0 )
又 ∵ \because ∵ b ∣ c b \mid c b∣c ∴ \therefore ∴ 令 b ⋅ t = c b \cdot t = c b⋅t=c ( t ∈ Z t \in \mathbb{Z} t∈Z 且 t ≠ 0 t \neq 0 t=0 )
有 b ⋅ x + c ⋅ y = a ⋅ s ⋅ x + a ⋅ t ⋅ y b \cdot x + c \cdot y = a \cdot s \cdot x + a \cdot t \cdot y b⋅x+c⋅y=a⋅s⋅x+a⋅t⋅y
∴ \therefore ∴ a ∣ [ a ⋅ ( s ⋅ x + t ⋅ y ) ] a \mid [a \cdot (s \cdot x + t \cdot y)] a∣[a⋅(s⋅x+t⋅y)] ∴ \therefore ∴ a ∣ ( b ⋅ x + c ⋅ y ) a \mid (b \cdot x + c \cdot y) a∣(b⋅x+c⋅y)
③ ③ ③ 若 m ≠ 0 m \neq 0 m=0,则 a ∣ b a \mid b a∣b 等价于 ( m ⋅ a ) ∣ ( m ⋅ b ) (m \cdot a) \mid (m \cdot b) (m⋅a)∣(m⋅b)
证明: ∵ \because ∵ a ∣ b a \mid b a∣b ∴ \therefore ∴ 令 a ⋅ x = b a \cdot x = b a⋅x=b ( x ∈ Z , x ≠ 0 x \in \mathbb{Z}, x \neq 0 x∈Z,x=0)
∴ \therefore ∴ a ⋅ x ⋅ m = b ⋅ m a \cdot x \cdot m = b \cdot m a⋅x⋅m=b⋅m ( m ∈ Z , m ≠ 0 m \in \mathbb{Z}, m \neq 0 m∈Z,m=0)
∴ \therefore ∴ x ⋅ a ⋅ m = b ⋅ m x \cdot a \cdot m = b \cdot m x⋅a⋅m=b⋅m ( a ⋅ m a \cdot m a⋅m的 x x x 倍为 b ⋅ m b \cdot m b⋅m)
∴ \therefore ∴ ( a ⋅ m ) ∣ ( b ⋅ m ) (a \cdot m) \mid (b \cdot m) (a⋅m)∣(b⋅m)
④ ④ ④ 设 Z \mathbb{Z} Z x , y x, y x,y 满足下式: a ⋅ x + b ⋅ y = 1 a \cdot x + b \cdot y = 1 a⋅x+b⋅y=1,且 a ∣ n a \mid n a∣n 、 b ∣ n b \mid n b∣n,那么 a ⋅ b ∣ n a \cdot b \mid n a⋅b∣n。
证明: ∵ \because ∵ a ∣ n a \mid n a∣n 、 b ∣ n b \mid n b∣n
n = s ⋅ a = t ⋅ b n = s \cdot a = t \cdot b n=s⋅a=t⋅b ( s , t ∈ Z 且 a 、 b 、 s 、 t ≠ 0 s, t \in \mathbb{Z} 且 a 、b、s、t \neq 0 s,t∈Z且a、b、s、t=0)
又 ∵ \because ∵ a ⋅ x + b ⋅ y = 1 a \cdot x + b \cdot y = 1 a⋅x+b⋅y=1
∴ \therefore ∴ x b + y a = 1 a ⋅ b \dfrac{x}{b} + \dfrac{y}{a} = \dfrac{1}{a \cdot b} bx+ay=a⋅b1
∴ \therefore ∴ n a ⋅ b = n ⋅ ( x b + y a ) = n ⋅ x b + n ⋅ y a \dfrac{n}{a \cdot b} = n \cdot (\dfrac{x}{b} + \dfrac{y}{a}) = \dfrac{n \cdot x}{b} + \dfrac{n \cdot y}{a} a⋅bn=n⋅(bx+ay)=bn⋅x+an⋅y
又 ∵ \because ∵ x 、 y 、 s 、 t ≠ 0 x 、y、s、t \neq 0 x、y、s、t=0
∴ \therefore ∴ n a ⋅ b ∈ Z \dfrac{n}{a \cdot b} \in \mathbb{Z} a⋅bn∈Z ∴ \therefore ∴ a ⋅ b ∣ n a \cdot b \mid n a⋅b∣n
⑤ ⑤ ⑤ 若 b = q ⋅ d + c ( q ∈ Z ) b = q \cdot d + c (q \in \mathbb{Z}) b=q⋅d+c(q∈Z) ,那么 d ∣ b d \mid b d∣b 的充要条件(充分必要条件)是 d ∣ c d \mid c d∣c。
相当于证明:已知
第一组证明: ∵ \because ∵ d ∣ c d \mid c d∣c
∴ \therefore ∴ d ⋅ c ≡ c ( x ∈ Z , x ≠ 0 ) d \cdot c \equiv c(x \in \mathbb{Z},x \neq 0) d⋅c≡c(x∈Z,x=0)
∴ \therefore ∴ b = q ⋅ d + x ⋅ d = ( q + x ) ⋅ d b = q \cdot d + x \cdot d = (q + x) \cdot d b=q⋅d+x⋅d=(q+x)⋅d
∴ \therefore ∴ d ∣ b d \mid b d∣b
第二组证明: ∵ \because ∵ d ∣ b d \mid b d∣b
∴ \therefore ∴ d ⋅ y = b ( y ∈ Z , y ≠ 0 ) d \cdot y = b(y \in \mathbb{Z},y \neq 0) d⋅y=b(y∈Z,y=0)
∴ \therefore ∴ d ⋅ y = q ⋅ d + c d \cdot y = q \cdot d + c d⋅y=q⋅d+c, c = d ⋅ ( y − d ) c = d \cdot (y - d) c=d⋅(y−d)
∵ \because ∵ ( y − d ) ∈ Z (y - d) \in \mathbb{Z} (y−d)∈Z
∴ \therefore ∴ d ∣ c d \mid c d∣c
二、模运算
1.定义
对于 Z \mathbb{Z} Z a , b a, b a,b ,其中 b ≠ 0 b \neq 0 b=0,求 a a a 除以 b b b 的余数,称为 a a a 模 b b b ,记作 a a a m o d mod mod b b b 或 a % b a \% b a%b (似乎数学不能用 % \% % )
2.分配律
① ① ① ( a ± b ) % c = ( a % c ± b % c ) % c (a \pm b) \% c = (a \% c \pm b \% c) \% c (a±b)%c=(a%c±b%c)%c
证明:令 r 1 = a % c , r 2 = b % c r_1 = a \% c, r_2 = b \% c r1=a%c,r2=b%c
∴ \therefore ∴ a = q 1 ⋅ c + r 1 , b = q 2 ⋅ c + r 2 a = q_1 \cdot c + r_1, b = q_2 \cdot c + r_2 a=q1⋅c+r1,b=q2⋅c+r2
∴ \therefore ∴ ( q 1 ⋅ c ± q 2 ⋅ c + r 1 ± r 2 ) % c = ( r 1 ± r 2 ) % c = ( a % c + b % c ) % c (q_1 \cdot c \pm q_2 \cdot c + r_1 \pm r_2) \% c = (r_1 \pm r_2) \% c = (a \% c + b \% c) \% c (q1⋅c±q2⋅c+r1±r2)%c=(r1±r2)%c=(a%c+b%c)%c
② ② ② ( a ⋅ b ) % c = ( a % c ⋅ b % c ) % c (a \cdot b) \% c = (a \% c \cdot b \% c) \% c (a⋅b)%c=(a%c⋅b%c)%c
证明:令 a % c = m a , b % c = m b , a c = s a , b c = s b ( m a , m b , s a , s b ∈ Z ) a \% c = m_a, b \% c = m_b, \dfrac{a}{c} = s_a, \dfrac{b}{c} = s_b(m_a, m_b, s_a, s_b \in \mathbb{Z}) a%c=ma,b%c=mb,ca=sa,cb=sb(ma,mb,s

这篇博客详细介绍了数论的基础概念,包括整除的定义和性质,模运算的定义、分配律和推论,以及同余的概念、性质和证明方法。还探讨了排列组合中的基本概念和公式,例如排列和组合的定义及其计算方法。内容深入浅出,适合学习算法和数学基础的人阅读。
最低0.47元/天 解锁文章
1151

被折叠的 条评论
为什么被折叠?



