Day 1:数论——[整除性及组合数学篇]

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

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 aq=b ,则 b b b 能被 a a a 整除( b b b a a a 的倍数),记作 a ∣ b a \mid b ab,否则记为 a ∤ b a \nmid b ab

2.性质

① ① 传递性:如果 a ∣ b a \mid b ab b ∣ c b \mid c bc ,则 a ∣ c a \mid c ac

证明: ∵ \because a ∣ b a \mid b ab ∴ \therefore a ⋅ x = b a \cdot x = b ax=b x ∈ Z x \in \mathbb{Z} xZ x ≠ 0 x \neq 0 x=0

​ 又 ∵ \because b ∣ c b \mid c bc ∴ \therefore b ⋅ y = c b \cdot y = c by=c y ∈ Z y \in \mathbb{Z} yZ y ≠ 0 y \neq 0 y=0

∴ \therefore a ⋅ x ⋅ y = c a \cdot x \cdot y = c axy=c

​ 又 ∵ \because x , y ∈ Z x, y \in \mathbb{Z} x,yZ

∴ \therefore a ∣ c a \mid c ac

② ② 如果 a ∣ b a \mid b ab b ∣ c b \mid c bc ,若有 ∀ \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(bx+cy)

证明: ∵ \because a ∣ b a \mid b ab ∴ \therefore a ⋅ s = b a \cdot s = b as=b s ∈ Z s \in \mathbb{Z} sZ s ≠ 0 s \neq 0 s=0

​ 又 ∵ \because b ∣ c b \mid c bc ∴ \therefore b ⋅ t = c b \cdot t = c bt=c t ∈ Z t \in \mathbb{Z} tZ 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 bx+cy=asx+aty

∴ \therefore a ∣ [ a ⋅ ( s ⋅ x + t ⋅ y ) ] a \mid [a \cdot (s \cdot x + t \cdot y)] a[a(sx+ty)] ∴ \therefore a ∣ ( b ⋅ x + c ⋅ y ) a \mid (b \cdot x + c \cdot y) a(bx+cy)

③ ③ m ≠ 0 m \neq 0 m=0,则 a ∣ b a \mid b ab 等价于 ( m ⋅ a ) ∣ ( m ⋅ b ) (m \cdot a) \mid (m \cdot b) (ma)(mb)

证明: ∵ \because a ∣ b a \mid b ab ∴ \therefore a ⋅ x = b a \cdot x = b ax=b ( x ∈ Z , x ≠ 0 x \in \mathbb{Z}, x \neq 0 xZ,x=0)

∴ \therefore a ⋅ x ⋅ m = b ⋅ m a \cdot x \cdot m = b \cdot m axm=bm ( m ∈ Z , m ≠ 0 m \in \mathbb{Z}, m \neq 0 mZ,m=0)

∴ \therefore x ⋅ a ⋅ m = b ⋅ m x \cdot a \cdot m = b \cdot m xam=bm ( a ⋅ m a \cdot m am x x x 倍为 b ⋅ m b \cdot m bm)

∴ \therefore ( a ⋅ m ) ∣ ( b ⋅ m ) (a \cdot m) \mid (b \cdot m) (am)(bm)

④ ④ Z \mathbb{Z} Z x , y x, y x,y 满足下式: a ⋅ x + b ⋅ y = 1 a \cdot x + b \cdot y = 1 ax+by=1,且 a ∣ n a \mid n an b ∣ n b \mid n bn,那么 a ⋅ b ∣ n a \cdot b \mid n abn

证明: ∵ \because a ∣ n a \mid n an b ∣ n b \mid n bn

n = s ⋅ a = t ⋅ b n = s \cdot a = t \cdot b n=sa=tb ( s , t ∈ Z 且 a 、 b 、 s 、 t ≠ 0 s, t \in \mathbb{Z} 且 a 、b、s、t \neq 0 s,tZabst=0)

​ 又 ∵ \because a ⋅ x + b ⋅ y = 1 a \cdot x + b \cdot y = 1 ax+by=1

∴ \therefore x b + y a = 1 a ⋅ b \dfrac{x}{b} + \dfrac{y}{a} = \dfrac{1}{a \cdot b} bx+ay=ab1

∴ \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} abn=n(bx+ay)=bnx+any

​ 又 ∵ \because x 、 y 、 s 、 t ≠ 0 x 、y、s、t \neq 0 xyst=0

∴ \therefore n a ⋅ b ∈ Z \dfrac{n}{a \cdot b} \in \mathbb{Z} abnZ ∴ \therefore a ⋅ b ∣ n a \cdot b \mid n abn

⑤ ⑤ b = q ⋅ d + c ( q ∈ Z ) b = q \cdot d + c (q \in \mathbb{Z}) b=qd+c(qZ) ,那么 d ∣ b d \mid b db 的充要条件(充分必要条件)是 d ∣ c d \mid c dc

相当于证明:已知

第一组证明: ∵ \because d ∣ c d \mid c dc

∴ \therefore d ⋅ c ≡ c ( x ∈ Z , x ≠ 0 ) d \cdot c \equiv c(x \in \mathbb{Z},x \neq 0) dcc(xZ,x=0)

∴ \therefore b = q ⋅ d + x ⋅ d = ( q + x ) ⋅ d b = q \cdot d + x \cdot d = (q + x) \cdot d b=qd+xd=(q+x)d

∴ \therefore d ∣ b d \mid b db

第二组证明: ∵ \because d ∣ b d \mid b db

∴ \therefore d ⋅ y = b ( y ∈ Z , y ≠ 0 ) d \cdot y = b(y \in \mathbb{Z},y \neq 0) dy=b(yZ,y=0)

∴ \therefore d ⋅ y = q ⋅ d + c d \cdot y = q \cdot d + c dy=qd+c c = d ⋅ ( y − d ) c = d \cdot (y - d) c=d(yd)

∵ \because ( y − d ) ∈ Z (y - d) \in \mathbb{Z} (yd)Z

∴ \therefore d ∣ c d \mid c dc

二、模运算

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=q1c+r1,b=q2c+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 (q1c±q2c+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 (ab)%c=(a%cb%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

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值