一个算法,输入为整数 a1,a2,... 被称为 polynomial-time algorithm 如果它的时间复杂度为 lga1,lg12,...的多项式,也就是说, polynomial in the lengths of its binary encoded inputs。意思就是和 二进制编码 的长度 ,为多项式关系。

我们把 乘,除,mod,看作 one unit of time. 当输入非常大的时候,这些操作也会变的 更加费时,因此应该计算一个算法需要多少 bit operations

将两个β长度的数相乘,需要 θ(β2)

Divisibility and divisors

d | a :d divides a, 当 a = kd,k是整数,也说a是d的 multiple

number theory 基础数论

Prime and composite numbers

质数/素数:质数定义为在大于1的自然数中,除了1和它本身以外不再有其他因数,这样的数称为质数。

Theorem (Division theorem)
对于任意整数a和正整数n,存在唯一的整数 q 和 r, such that 0r<n 并且 a = qn + r 。
也就是说 对于每个数,都是 两个数的乘积 加上一个数

number theory 基础数论

因此我们可以把整数分为 n 类,根据它的余数。
number theory 基础数论

number theory 基础数论

Common divisors and greatest common divisors

公约数和最大公约数
number theory 基础数论

number theory 基础数论

number theory 基础数论

Relatively prime integers

整数a和b互质,如果它们公约数只有 1

Unique factorization

number theory 基础数论

number theory 基础数论

最大公约数

number theory 基础数论

Euclid’s 算法基于以下定理
number theory 基础数论
证明通过证明 两个数互相整除,得到两个数相等。

Euclid’s algorithm
number theory 基础数论

算法的时间复杂度。
number theory 基础数论

用数学归纳法证明

number theory 基础数论

Modular arithmetic

number theory 基础数论number theory 基础数论
一个集合和一个操作定义了一个 group 它满足 自闭,存在一个 identity, 结合性,存在逆(类似于 域 的概念)

如果它还附和 交换律 那么称为 abelian group

The groups defined by modular addition and multiplication

number theory 基础数论

x mod n代替原来的x
number theory 基础数论

number theory 基础数论

number theory 基础数论

相关文章: