!!!Chapter 1 Introduction

本文涵盖指数、对数、等差及等比数列等基础知识,并介绍了模运算的概念。此外还讲解了归纳法和反证法两种证明方法,以及递归函数的基本原理与实现。
部署运行你感兴趣的模型镜像

1.2 Mathematics Review

Exponents

http://baike.baidu.com/view/5711140.htm

Logarithms

http://en.wikipedia.org/wiki/Logarithm

Series

arithmetic series 等差数列:

Sn=n(a1+an)/2

geometric series 等比数列:

Sn=a1(1-q^n)/(1-q)=(a1-an*q)/(1-q)

http://baike.baidu.com/view/39749.htm

Modular Arithmatic

A is congruent to B modulo N, written A ≡ B (mod N), if N divides A - B.

e.g.

81 ≡ 61 ≡ 1 (mod 10)

The P Word

The two most common ways of proving statements in data structure analysis are proof by induction(归纳) and proof by contradiction(反证).

Induction

1. proving a base case

2. assume k works and prove k + 1 will work

Contradiction

Assuming that the theorem is false and showing that this assumption implies that some known property is false.

1.3 Recursion

A function defined in terms of itself is called recursive.

F(x) = 2F(x-1) + X

C allows functions to be recursive:

int F(int X)
{
// handle base case
    if(X == 0)
        return 0;
    else
        return 2*F(x - 1) + X;
} 
Recursive calls will keep on being made until a base case is reached.

Fundamental rules of recursion:

1. Base case. You must always have some base cases, which can be solved without recursion.

2. Making progress. For the cases that are to be solved recursively, the recursive call must always be to a case that makes progress toward a base case.

3. Design rule. Assume that all the recursive calls work.

4. Compound interest rule. Never duplicate work by solving the same instance of a problem in separate recursive calls.

您可能感兴趣的与本文相关的镜像

Stable-Diffusion-3.5

Stable-Diffusion-3.5

图片生成
Stable-Diffusion

Stable Diffusion 3.5 (SD 3.5) 是由 Stability AI 推出的新一代文本到图像生成模型,相比 3.0 版本,它提升了图像质量、运行速度和硬件效率

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值