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

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

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

注:

1.我们用 Z\mathbb{Z}Z 表示整数,∀\forall 表示任意,∈\in 表示属于,∃\exists 表示存在。

2.似乎 ∣\mid 的运算优先级特别低,所以注意打括号。

一、整除

1.定义

​ 若有 Z\mathbb{Z}Z a,ba,ba,ba≠0a \neq 0a=0 ,如果 ∃\exists 一个 Z\mathbb{Z}Z qqq ,使得 a⋅q=ba \cdot q = baq=b ,则 bbb 能被 aaa 整除( bbbaaa 的倍数),记作 a∣ba \mid bab,否则记为 a∤ba \nmid bab

2.性质

①① 传递性:如果 a∣ba \mid babb∣cb \mid cbc ,则 a∣ca \mid cac

证明:∵\because a∣ba \mid bab ∴\thereforea⋅x=ba \cdot x = bax=bx∈Zx \in \mathbb{Z}xZx≠0x \neq 0x=0

​ 又∵\because b∣cb \mid cbc ∴\thereforeb⋅y=cb \cdot y = cby=cy∈Zy \in \mathbb{Z}yZy≠0y \neq 0y=0

∴\therefore a⋅x⋅y=ca \cdot x \cdot y = caxy=c

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

∴\therefore a∣ca \mid cac

②② 如果 a∣ba \mid babb∣cb \mid cbc ,若有 ∀\forallZ\mathbb{Z}Z x,yx, yx,y ,有 a∣(b⋅x+c⋅y)a \mid (b \cdot x + c \cdot y)a(bx+cy)

证明:∵\because a∣ba \mid bab ∴\thereforea⋅s=ba \cdot s = bas=bs∈Zs \in \mathbb{Z}sZs≠0s \neq 0s=0

​ 又∵\because b∣cb \mid cbc ∴\thereforeb⋅t=cb \cdot t = cbt=ct∈Zt \in \mathbb{Z}tZt≠0t \neq 0t=0

​ 有 b⋅x+c⋅y=a⋅s⋅x+a⋅t⋅yb \cdot x + c \cdot y = a \cdot s \cdot x + a \cdot t \cdot ybx+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≠0m \neq 0m=0,则 a∣ba \mid bab 等价于 (m⋅a)∣(m⋅b)(m \cdot a) \mid (m \cdot b)(ma)(mb)

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

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

∴\therefore x⋅a⋅m=b⋅mx \cdot a \cdot m = b \cdot mxam=bm (a⋅ma \cdot mamxxx 倍为 b⋅mb \cdot mbm)

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

④④Z\mathbb{Z}Z x,yx, yx,y 满足下式:a⋅x+b⋅y=1a \cdot x + b \cdot y = 1ax+by=1,且 a∣na \mid nanb∣nb \mid nbn,那么 a⋅b∣na \cdot b \mid nabn

证明:∵\because a∣na \mid nanb∣nb \mid nbn

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

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

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

∴\therefore na⋅b=n⋅(xb+ya)=n⋅xb+n⋅ya\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≠0x 、y、s、t \neq 0xyst=0

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

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

相当于证明:已知

第一组证明:∵\because d∣cd \mid cdc

∴\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)⋅db = q \cdot d + x \cdot d = (q + x) \cdot db=qd+xd=(q+x)d

∴\therefore d∣bd \mid bdb

第二组证明:∵\because d∣bd \mid bdb

∴\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+cd \cdot y = q \cdot d + cdy=qd+cc=d⋅(y−d)c = d \cdot (y - d)c=d(yd)

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

∴\therefore d∣cd \mid cdc

二、模运算

1.定义

​ 对于 Z\mathbb{Z}Z a,ba, ba,b ,其中 b≠0b \neq 0b=0,求 aaa 除以 bbb 的余数,称为 aaabbb ,记作 aaa modmodmod bbba%ba \% ba%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

证明:令 r1=a%c,r2=b%cr_1 = a \% c, r_2 = b \% cr1=a%c,r2=b%c

∴\therefore a=q1⋅c+r1,b=q2⋅c+r2a = q_1 \cdot c + r_1, b = q_2 \cdot c + r_2a=q1c+r1,b=q2c+r2

∴\therefore (q1⋅c±q2⋅c+r1±r2)%c=(r1±r2)%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=ma,b%c=mb,ac=sa,bc=sb(ma,mb,sa,sb∈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,sa

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值