export ALL_PROXY=http://localhost:abcd
, Q到达S:abcd
S:abcd
到C:efgh
, Q到达C:efgh
C:efgh
, Q到达代理服务器.bashrc
, 其他终端按需调整export ALL_PROXY=http://localhost:abcd
至.bashrc
sock5://localhost:abcd
abcd
为您选定的端口号, 尽量选择大一些但不超上限的值, 端口冲突将引发匪夷所思的故障查找.bashrc
, 但我强烈推荐这么做~/.ssh/config
文件中, 添加S的信息, 必须包括别名(Host), 主机名(HostName), 用户(User), 端口(Port)RemoteForward abcd localhost:efgh
abcd
, 转发至C端的efgh
~/.ssh/config
, 而是直接使用命令行工具ssh连接, 相应的参数为-R abcd:localhost:efgh
维护U盘中的Ubuntu
启动时连接
虚拟机设置>选项>高级>固件类型
, 设置为UEFI
Try Ubuntu
和Install Ubuntu
字样Try Ubuntu
, 直到进入LiveCD桌面Install Ubuntu xxxx
, 启动安装程序Installation Type
页面Something Else
, 即手动进行分区并安装/dev/sda
, 选择New partition table
Reserved BIOS boot area
EFI System Partition
Ext4 journaling file system
, 挂载点/boot
Ext4 journaling file system
, 挂载点/
/home
分区, 该大小推荐设置为20GB左右/home
, 占满磁盘剩余空间即可, 若有需要可以保留一些未分配空间Ext4 journaling file system
, 挂载点/home
Reserved BIOS boot area
EFI System Partition
Ext4 journaling file system
, 挂载点/
Continue trying
切换到root用户
1 | sudo su |
确定挂载各个位置, 以您创建分区的顺序为依据
1 | fdisk -l |
挂载/
的分区到当前系统 或 挂载/boot
的分区到当前系统
1 | mkdir /mnt/sda3 |
安装grub, 根据挂载的是否为/boot
挂载点的分区选择您待执行的命令
1 | # 如果您挂载的是'/'分区, 其为/dev/sda3, 则 |
检查分区情况
grub core.img
, 说明grub-pc安装完毕使用物理驱动器
, 选择目标U盘, 一般为最后一个启动时连接
1 | ls /sys/firmware/efi |
虚拟机设置>选项>高级>固件类型
, 设置为BIOS
Try Ubuntu
1 | # root |
boot.img
的内容, 该代码将加载一个硬编码地址的core.img
protective MBR
, 在GPT分区下依然可以安放这段代码, 而BIOS固件根本不在乎分区表类型, 因此可以启动core.img
存放在:bios_grub
的分区内core.img
执行时, 将根据配置文件加载操作系统esp
flag的分区, 加载其中的.efi
文件.efi
文件可用表达式分析
算法
||到达定值|活跃变量|可用表达式|
|-|-|-|-|
|方向|正向|反向|正向|
|传递函数|$gen_B\cup(x-kill_B)$|$use_B\cup(x-def_B)$|$e_gen_B\cup(x-e_kill_B)$|
|边界条件|$OUT[ENTRY]=\emptyset$|$IN[EXIT]=\emptyset$|$OUT[ENTRY]=\emptyset$|
|交汇运算$\wedge$|$\cup$|$\cup$|$\cap$|
|方程组|$OUT[B]=f_B(IN[B])\quad IN[B]=\bigwedge_{P,pred(B)}OUT[P]$|$IN[B]=f_B(OUT[B])\quad OUT[B]=\bigvee_{S,succ(B)}IN[S]$|$OUT[B] = f_B(IN[B])\quad IN[B]=\bigvee_{P,pred(B)}OUT[P]$|
|初始值|$OUT[B]=\emptyset$|$IN[B]=\emptyset$|$OUT[B]=U$|
x=a[i]
新类 <== 已有类的功能 + 新功能/已有功能重定义
原private都不可访问, 其余收紧(选继承方式和基类成员中, 修饰符严格的那个)
当创建派生类的对象时
1 | class A |
当析构派生类的对象时
A(A&& x)
右值引用类型: 不能作为赋值操作符的左操作符A& operator=(A&& x)
typedef void (*FuncPtr)(void *)
typedef FuncPtr *VtblPtr
vitrual int f()=0;
C c; c.A::f(); c.B::f();
class B: virtual public A {};
实现机制
一般格式
1 | template <class T> |
实例化
显式地实例化
1 | template <class T> |
带非类型参数的函数模板
1 | template <class T, int size> //size为一个int型的普通参数 |
类模板的格式为:
1 | template <class T1,class T2,...> |
实例化
类模板的实例化需要在程序中显式地指出
1 | Stack<int> st1; //实例化int型栈类并创建一个相应类的对象 |
不同类模板实例之间不共享类模板中的静态成员
1 | template <class T> class A; |
基本操作
1 | void push_front(const T& x); |
注意:如果容器的元素类型是一个类,则针对该类可能需要:
一个算法能接收的迭代器的类型是通过算法模板参数的名字来体现的。例如
1 | template <class InIt, class OutIt> |
算法的操作范围
用算法对容器中的元素进行操作时,大都需要用两个迭代器来指出要操作的元素的范围
1 | void sort(RanIt first, RanIt last); |
算法的自定义操作条件
自定义操作条件可分为:
Pred:一元“谓词”,需要一个元素作为参数
1 | size_t count_if(InIt first, InIt last, Pred cond); |
BinPred:二元“谓词”,需要两个元素作为参数
1 | void sort(RanIt first, RanIt last); //按“<”排序 |
算法的自定义操作
自定义操作可分为:
Op或Fun:一元操作,需要一个参数
1 | Fun for_each(InIt first, InIt last, Fun f); |
BinOp或BinFun:二元操作,需要两个参数
1 | T accumulate(InIt first, InIt last, T val); //按“+”操作 |
1 | OutIt transform(InIt src_first, InIt src_last, OutIt dst_first, Op f); |
输入/输出操作符“>>”和“<<”的重载
一般情况
1 | class A { |
派生类
1 | class A { |
抛掷的异常对象将由程序中能够处理这个异常的地方通过catch语句块来捕获并处理之。
1 | void f(char *filename) |
try语句
1 | try |
throw语句
1 | throw <表达式>; |
catch语句
catch语句块用于捕获throw抛掷的异常对象并处理相应的异常, catch语句块要紧接在某个try语句的后面
1 | catch (<类型> [<变量>]) |
一个try语句块的后面可以跟多个catch语句块,用于捕获不同类型的异常对象并进行处理。
1 | int g() |
如果在try语句块的<语句序列>执行中没有抛掷(throw)异常对象,则其后的catch语句不执行,而是继续执行try语句块之后的非catch语句。
宏assert是通过条件编译预处理命令来实现的,其实现细节大致如下:
1 | //cassert 或 assert.h |
宏assert只有在宏名NDEBUG没定义时才有效,这时,程序一般处于开发、测试阶段。程序开发结束提交时,应该让宏名NDEBUG有定义,然后重新编译程序,这样,assert就不再有效了。
cl <源文件1> <源文件2> ... -D NDEBUG ...
<单元名, [属性值]>
Dstate
: DFA状态集合Dstate
中仅有$\varepsilon-\mathrm{closure}(s_0)$while
Dstate
中有未加标记的状态$T$for
每个输入符号$a$U=
$\varepsilon-\mathrm{closure}(\mathrm{move}(T, a))$if
$U$不在Dstate
中, 则加入之, 不加标记Dtran[T,a]=U
, 为新的边和状态本文包括简单教程, 也有相关技术的介绍, 具体板块有
相关Python知识介绍
Python 3 REQUIRED (我使用3.8.1 64-bit)
pip install AdvancedHTMLParser
: 极其便利的HTML解析, JavaScript中用到的方法, 其中大部分均有类似实现pip install requests
: HTTP请求, 主要使用其cookiejar和opener1 | import urllib.request |
Ctrl+C
都没单独处理, 该网站的歌曲主要有以下几种
仅分析站内页面, dropbox存储这一类的获取流程
https://tobu.io/<track>/download
, 查看歌曲详情https://tobu.io/<track>/download/mp3
, 该请求处理时, 会重定向至dropbox这个网站为了防止直连下载, 做了如下对策
https://tobu.io/<track>/download
时, 将设置track_dl = <trackID>
的Cookiehttps://tobu.io/<track>/download#open-dl
时, 会进行一系列点击事件, 其中<btn class='unlock'>
按钮将设置accept = 1
的Cookiehttps://tobu.io/<track>/download/mp3
时, 将检查上述两个Cookietrack_dl
必须匹配于<track>
accept = 1
超烂代码再放送!
访问https://tobu.io
, 元素<div class='pg'>
得到歌曲列表全部页面
简单的爬虫, 其中getAllNodes
方法将返回包含根节点的列表, 需要扔掉根节点, 根据href
属性进行判断, 需要含有页面的url
1 | def getPageList(self): |
访问每个页面, https://tobu.io/page/<pg_no>
, 元素<div class='track>
为单曲
简单的爬虫, 对元素的解析交给Song
类实现parseTag
方法
1 | def getSongList(self): |
href
属性, 将得到歌曲详情页, 其余部分没用 1 | def parseTag(self, tag: AdvancedHTMLParser.AdvancedTag): |
访问每个歌曲<track>
, 其下载页面https://tobu.io/<track>/download/
, 得到需要的cookie
1 | response = opener.open(self.url + '/download') |
添加伪造的accept=1
, 绕过点击事件
这里需要注意, 将cookie的expires
搞久一点, 如果反复遇到不允许下载的情况, 可以调高expires
. 该cookie于2020.02.09未过期
1 | accept = http.cookiejar.Cookie(version=0, name='accept', value='1', port=None, port_specified=False, domain='.tobu.io', domain_specified=True, domain_initial_dot=False, path='/', path_specified=True, secure=False, expires=1681201372, discard=False, comment=None, comment_url=None, rest={}, rfc2109=False) |
携带上述cookie, 访问https://tobu.io/<track>/download/mp3
, 静候佳音
参考了chen~先生的cnblog
1 | with closing(requests.get(url = self.url + '/download/mp3', headers=headers, cookies = cookiejar, stream=True)) as response: |
写给自己的, 以备后用, 先留空吧
]]>1 | 数据库应用系统---+-[数据库系统]---+-[数据库] <------------+---------------+ |
E-R模型, EE-R模型; 面向对象模型; 谓词模型
层次, 网状模型; 关系, 面向对象, 谓词模型; 对象关系模型
1 | 现实世界 用户1 ... 用户n |
写在后面的大题部分
- 综合的关系代数应用表示,复杂查询的关系代数表达式
- 关系代数的应用
- 单个关系上的选择与投影
- 两个关系的并、交、差
- 两个关系的迪卡尔乘积、自然联接、θ-联接
- 两个关系的除法
- 难点
- 查询条件带有‘否定’语义:‘不等’比较 & 减法运算
- 使用表联接查询,还是使用除法?
- 正确使用自然连接运算 和 除法运算
- 表的自联接
啥也没有?怎么回事啊, 算了写一点乱七八糟的吧
- 创建基表
1
2
3
4 CREATE TABLE tabname {
colname datatype NOT NULL,
colname2 datatype2
}
修改基表
1 | ALTER TABLE tabname ADD colname datatype |
删除基表
1 | DROP TABLE tabname |
SELECT * | colname { , colname ... }
最后执行, 有排序时倒数第二执行
FROM tabname { , tabname ... }
在SQL中, 这些表相当于被笛卡尔乘积连接, 因此联结时需要在where中给出条件
[ WHERE search_condition ]
[ GROUP BY colname { , colname ... }
[ HAVING group_condition ]
[ ORDER BY colname [ ASC | DESC ] { , colname [ ASC | DESC ] ... } ]
最后执行
- 两个必须的子句:
select
/from
- having子句的前面必须有group by子句
DISTINCT colname
统计查询使用, 去重统计colname [NOT] LIKE val1 [ESCAPE val2]
val1
是模板, 其中_
匹配任意一个字符, %
匹配任意一个字符串val2
定义转义指示字符, 跟在其后的, val1
中的通配符和转义字符将表示原义colname IS [NOT] NULL
判断是否为NULLWHERE
当中, 通过属性的相等, 实现表与表之间的连接tabname [[AS] alias]
给表起别名expr [NOT] IN (subquery)
标量与集合量之间的属于比较expr θ SOME|ANY|ALL (subquery)
标量与集合中元素之间的量化比较[NOT] EXIST
是否为空集的判断谓词ALL
意为允许重复(subquery) UNION [ALL] (subquery)
并(subquery) INTERSECT [ALL] (subquery)
交(subquery) EXCEPT [ALL] (subquery)
减复杂数据查询
COUNT(colname)
: 计数, 空值忽略
COUNT(DISTINCT colname)
: 计数互不相同的值, 空值忽略
SUM(colname)
: 求和, 空值忽略AVG(colname)
: 求平均, 空值忽略MIN(colname)
: 求最小, 空值忽略MAX(colname)
: 求最大, 空值忽略GROUP BY colname {, colname}
按照colname
的取值不同, 分组统计
SELECT
当中必须包括GROUP BY
当中的属性
HAVING group_cond
必须先分组, 之后满足group_confd
的组才会被保留关系代数中的除法运算功能在SQL中的表示方法
待构造的除法: $\pi_{sno, cno}(SC)\div \pi_{cno}(C)$
语义: 对于符合要求的SC中sno, (对于任意的C中cno, 都有sno选修过cno的记录)
等价于: 对于符合要求的SC中元组S, 对于任意C中元组x, 都能找到元组y,使得y.sno=S.sno and y.cno=x.cno
任意->不存在不满足->不存在(不存在):
1
2
3 对SC中S, 不存在
对C中x, 不存在
SC中的S-x元组y, 即y.sno=S.sno and y.cno=x.cno
1 | SELECT DISTINCT SC.sno # |
FROM (subquery) [[AS] alias]
DELETE FROM tabname [WHERE cond]
元组插入:
1 | INSERT INTO tabname [(colname {,colname})] |
元组修改:
1 | UPDATE tabname |
CREATE VIEW <视图名> [(<列名>{, <列名>})] AS <映像语句> [WITH CHECK OPTION]
映像语句实际上就是子查询, CHECK OPTICON 不知道什么意思
DROP VIEW <视图名>
客体所有者(创建者)自动拥有全部权限, 有权限的可授予他人权限, 权限仅限这两种方法获得
登陆时检查: 是不是管理员->是不是所有者->有没有被授权
存储矩阵: 行标签: 客体; 列标签: 主体
时间, 内容, 用户名, 终端名, 操作类型, 操作结果; 给出报警信息
权限: SELECT INSERT DELETE UPDATE REFERENCE EXECUTE USAGE
对象: 表/视图 属性 域(数据类型) 存储过程/函数/触发器
GRANT <权限列表> ON <对象> TO <用户名列表> [WITH GRANT OPTION]
REVOKE <权限列表> ON <对象> FROM <用户名列表> [RESTRICT | CASCADE]
CASCADE连锁回收; RESTRICT不连锁才回收, 否则拒绝回收
1 | { NOT NULL | |
1 | FOREIGN KEY ( colname { , colname ... } ) |
1 | CREATE TRIGGER trigger_name { BEFORE | AFTER } |
SET AUTOCOMMIT ON|OFF
SET TRANSACTION READONLY|READWRITE
SET TRANSACTION ISOLATION LEVEL READUNCOMMITTED|READCOMMITTED| READREPEATABLE|SERIALIZABLE
READUNCOMMITTED无封锁; READCOMMITTED读加共享锁到读完; READREPEATABLE读加共享锁到事务结束; SERIALIZABLE串行化调度执行
冲突等价: 如果通过一系列相邻操作的非冲突交换能够将一个调度转换为另一个调度,则我们称这两个调度是冲突等价的
视图等价
[视图等价]相同的一组事务,两个不同的调度S与H。S和H被称为“视图等价”当且仅当满足下列三个条件:
对每一个数据项D
如果在调度S中事务Tk读到D的初始值,则在调度H中事务Tk也必须读到D的初始值;
如果在调度S中事务Tk执行了rk(D),并且读到的是由事务Tj写入的D的值,则在调度H中事务Tk的rk(D)读到的也必须是由事务Tj 所写入的D的值;
如果在调度S中是由事务Tk来执行最后一条关于D的写操作wk(D),则在调度H中也一定是事务Tk执行最后一条关于D的写操作wk(D)。
->事务优先图
优先: 给出的调度H中, 两个动作来自不同事务, 若其涉及同一个数据库对象且至少一个为写, 则这两个事务不可交换, 定义了优先关系
优先关系画出有向图
盲写: 没读就写
不一致现象 | 描述 | 原因 |
---|---|---|
丢失修改 | 一个修改破坏另一个修改结果 | 多个事务并发修改同一个数据 |
脏读 | 读到错误的数据 | 其他事务未提交的修改 |
不可重复读 | 前后两次读不一致 | 其他事务已提交的写操作 |
幻像读 | 一个事务中, 执行相同的查询多次, 结果不同 | 其他事务已提交的插入操作 |
自己可以读写, 别人啥也不行
全员只读
已经有的锁 | S | X | IS | IX | SIX | |
---|---|---|---|---|---|---|
已经持有S | ✔ | ✔ | S加了, 当前及其下层没有X | |||
已经持有X | X排他, 加了别的都没有 | |||||
已经持有IS | ✔ | ✔ | ✔ | ✔ | IS加了, 当前没X | |
已经持有IX | ✔ | ✔ | IX加了, 当前没S没X | |||
已经持有SIX | ✔ | SIX加了, 相当于同时S和IX |
需要结合日志恢复(记录转储开始和结束点, 事务更新的对象和前后值, 事务结束状态)
<CKPT>
就可以结束恢复过程<CKPT>
-> 刷新日志到磁盘<Start T>
<Commit T>
<Abort T>
<T, X, V>
事务T修改了X, 原值是V<T, X, V>
:<Commit T>
被扫到过, 则继续扫<Abort T>
, 刷新日志<T, X, V>
中记载的是更新后的值<Abort T>
, 刷新日志<T, X, V, W>
中记载前与后的值游标管理
定义: 查询结果为多个元组时, 必须使用游标获取每个元组
1 | EXEC SQL DECLARE cursor-name CURSOR FOR |
打开: EXEC SQL OPEN agent_dollars
使用
1 | while (TRUE) {/* loop to fetch rows */ |
关闭: exec sql whenever not found goto finish
定义结束, exec sql close agent_dollars
关闭游标
可滚动游标的定义
1 | EXEC SQL DECLARE cursor_name |
在数据更新命令中的使用
1 | EXEC SQL FETCH |
索引 (index)
接入链路与接入环境
家庭接入
DSL: 数字用户线
拓扑
1 | 家庭电话-----------(电话线)----分配器----(现有电话线)----DSLAM----电话网 |
DSLAM: 数字用户线接入复用器, 位于中心局, 许多端系统共享
HFC: 混合光纤同轴/电缆因特网接入
拓扑
1 | 家庭----(同轴电缆)----光纤节点----(光纤)----CMTS----因特网 |
CMTS: 电缆调制解调器端接系统, 位于电缆头端
FTTH: 光纤到户(PON: 被动光纤网络)
拓扑
1 | ONT----(光纤)----光纤分配器----(光纤)----OLT----因特网 |
ONT: 光纤网络端接器; OLT: 光纤线路端接器
源端口号 | 目的端口号 | 长度(首部+数据) | 检验和 | 应用数据(报文) |
---|---|---|---|---|
16bit | 16bit | 16bit | 16bit | … |
源端口号 | 目的端口号 | 序号 | 确认号 | (第一堆) | 接收窗口 | 因特网校验和-紧急数据指针 | 选项 | 数据 |
---|---|---|---|---|---|---|---|---|
16bit | 16bit | 32bit | 32bit | 16bit | 16bit | 16bit+16bit | 0bit+ | … |
单纯的ACK不包含数据字节, 因此不引发编号增加
一个报文可以同时有确认号和序号, 是捎带ACK
重传的报文不进行测量
指数移动加权平均
这意味着TCP不是单纯的GBN, 而含有一部分SN
也就是缓存余量
为了防止接收方无数据要发, 引发发送端阻塞. 这个一字节的报文总会被ACK, 有机会获得一个非0的rwnd值
通信 | SYN | ACK | ACK | SEQ | 数据 | 操作 |
---|---|---|---|---|---|---|
客户->服务 | + | client_isn | 客户端随机选择起始序号 | |||
服务->客户 | + | + | client_isn+1 | server_isn | 服务器分配资源, 随机选择起始序号 | |
客户->服务 | + | server_isn+1 | client_isn+1 | 可携带 | 客户端分配资源 |
通信 | FIN | SEQ | ACK | ACK | 操作 |
---|---|---|---|---|---|
客户->服务 | + | client_isn | (server_isn) | 客户发送FIN | |
服务->客户 | server_isn | + | client_isn + 1 | 服务器ACK这个FIN, 之后还可以发数据(len) | |
服务->客户 | + | server_isn + len | (client_isn + 1) | 服务器发送FIN, 收到客户端的ACK后关闭, 释放资源 | |
客户->服务 | client_isn + 1 | + | server_isn + len + 1 | 客户端ACK这个FIN, 定时等待之后关闭, 释放资源 |
加3根据协议不同, 看具体情况做
慢启动: 其实是收到的每个ACK都加1, 因为ACK数等于发送数, 相当于翻倍
数据报格式
1 | | $版本 4 | 首部长度 4 | 服务类型 8 | 数据报长度16 | |
数据报格式
1 | | 版本 4 | 流量类型 8 | 流量标签 20 | |
除了不同步, 跟时隙ALOHA一样
局域网 - 网桥 - 局域网
, 原样转发局域网 - 网桥 - [网络或链路] - 网桥 - 局域网
, 需要适当封装, 但原始MAC帧不修改IEEE 802
层次结构
1 | +--------------+---------------- |
帧结构
1 | | MAC帧 | LLC PDU | CRC | |
逻辑链路控制
局域网 - 网桥 - 局域网
, 原样转发局域网 - 网桥 - [网络或链路] - 网桥 - 局域网
, 需要适当封装, 但原始MAC帧不修改这个不是Jupyter Notebook的介绍啦, 默认本文的读者拥有使用Jupyter Notebook的经验
环境:
2019年10月9日, M$发布了Python插件的更新, 提供对*.ipynb
文件的支持, 即Jupyter支持. 于是就可以通过更新Python插件, 直接在VSCode里面使用Jupyter nb啦
点击插件信息页, 查看Extensions-Installed, 确认你的插件版本是2019.10.41019
, 若不是, 请检查自动更新插件设置, 应当为以下:1
"extensions.autoUpdate": true
或者手动点击Update
, 或者卸载插件重装
你可能会遇到以下问题:
python @sort:installs
, 列表顶端的即为所需的插件, 点击Install
安装 重启VSCode,请重启VSCode
这个重启可以解决:
如果你已经在用Jupyter NB, 这段不用看辣
按下组合键Ctrl+Shift+P
, 输入> Python: Create New Blank Jupyter Notebook
, 按Enter
, 可以建立一个*.ipynb
文件
在一个新的cell当中写1
print('anything')
点按钮执行cell, 如果未曾安装过Jupyter, 将会报错, 点击报错信息中的Install
按钮, VSCode会帮你搞定一切, 除非你网络不好
重启VSCode,请重启VSCode
这个重启可以解决:
*.ipynb
文件没有Intellisense这里主要说点废话
远程配置? 我不会, 用的local, url贴在这里, token应该包含在url里面
1 | "python.dataScience.jupyterServerURI": ">>>YOUR URL HERE<<<" |
BUG:
Run Cell
等按钮, 尽量别点, 有可能VSCode直接崩溃韩骏的知乎专栏
请给这篇文章点赞, 另外评论区有很多问题的解决方案, 遇到问题可以看下评论区
设$p:(x,y)$为一像素
空间域->变换域->处理->空间域
边界: 忽略外部, 填充
分段线性函数
折线: $(0,0)->(r_1,s_1)->(r_2,s_2)->(L-1, L-1)$
- 对比拉伸变换: 单调递增
- 线性函数: $s_1=r_1$, $s_2=r_2$
- 阈值处理函数: $r_1=r_2$, $s_1=0$, $s_2=L-1$
- 灰度级分层: 突出特定灰度范围的亮度
1
2
3 +---+
| |
---+ +---
比特平面分层
这里只考虑单调递增函数
像素对像素为基础, 在两幅或多幅图像之间进行
灰度变换: $s=T(z)$
空间滤波: $g(x,y)=\frac{1}{mn}\sum_{(r,c)\in S_{xy}}f(r,c)$
由样本恢复函数
$$\tilde{f}(t)=f(t)s_{\Delta T}(t)=\sum_{n=-\infty}^\infty f(t)\delta(t-n\Delta T)$$
$$h(t)=\frac{\sin(\pi t/\Delta T)}{\pi t/\Delta T}$$
函数内插
$$f(t)=\sum_{n=-\infty}^\infty f(n\Delta T)\text{sinc}((t-n\Delta T)/n\Delta T)$$
连续函数采样
采样是有限的
带限函数一定是$-\infty$到$\infty$的
有限长度的采样, 混淆是不可避免的
平滑输入函数, 减少高频分量(图像散焦)
combinatorial $\sim$ discrete & finite
Enumeration: How many solutions satisfying the constraints
Construction: construct a solution
Enumeration(Counting)
Name | Description | Notation | Number | Repetition | Ordered | ||
---|---|---|---|---|---|---|---|
Tuple | $n$-tuples of $[m]$ | $[m]^n$ | $m^n$ | Y | Y | ||
Nultiset | $k$-multiset of $n$-set | - | ${n+k-1\choose k}$ | Y | N | ||
Subset | $k$-uniform of $n$-set, $\ | S\ | =n$ | - | $\binom{n}{k}$ | N | N |
Partition | $k$-partition of $n$-set | - | $\{ {n\atop k} \}$ | N | N |
Proof: $f:[n]\to[m]\Leftrightarrow v_f\in[m]^n$
Proof: $(1+x)^n=(1+x)(1+x)\cdots(1+x)$, $#$ of $x^k$ is $n\choose k$
proof: let $x=-1$
$n$ balls | $m$ bins | unrestricted | $\leq 1$ for all bin | $\geq 1$ for all bin |
---|---|---|---|---|
distinct | distinct | $m^n$ | $(m)_n=n!\binom{m}{n}$ | $m!\{ {n\atop m} \}$ |
identical | distinct | $(\binom{m}{n})$ | $m\choose n$ | $\binom{m-1}{n-1}$ |
distinct | identical | $\sum_{k=1}^m\{ {n\atop k} \}$ | $1$ | $\{ {n\atop m} \}$ |
identical | identical | $-$ | $-$ | $-$ |
[Textbook] 1.x, 2.7
Com.Dev. —>Phys.NtWk—>Internet
Delay: 延迟; Throughput: 吞吐量/网速
Intranet: 内部网
End systems <-------->-------->Router
———= Modem =—-= Router/Firewall =—-= Wireless AP - - - - Wireless Device
———= Modem =—-= Router/Firewall =—-= Device
Dedicated: 专用的
Non-text data
Simple text mail
Mail retrieval from server, including authorization and download
Manipulation of stored mails on server
Proprietary: 专有的
1 | ServiceUserA ServiceUserB |
Used by global Internet
FTP, SMTP, HTTP
TCP, UDP
IP, routing protocols
PPP, Ethernet
1 | SERVER CLIENT |
1 | SERVER CLIENT |
$\alpha$: average packet arrival rate
- $\rho\sim 0$: average queuing delay small
- $\rho\to 1$: delays become large
- $\rho\geq 1$: delays infinite
[Textbook] 5.x, 6.x
除了不同步, 跟时隙ALOHA一样
<<< TODO >>>
MSS最大报文段长度(其实是应用层数据的最大长度): 根据 MTU(链路层)最大传输单元 确定, 典型值1460字节
| 源端口号 | 目的端口号 | 序号 | 确认号 | (第一堆) | 接收窗口 | 因特网校验和-紧急数据指针 | 选项 | 数据 |
|-|-|-|-|-|-|-|-|-|
| 16bit | 16bit | 32bit | 32bit | 16bit | 16bit | 16bit+16bit | 0bit+ | … |
第一堆里面有: 首部长度4bit(以字为单位, 1=4字节) + 保留未用6bit + (URG ACK PSHRST SYN FIN)标志字段6bit
重传的报文不进行测量
指数移动加权平均
也就是缓存余量
建立: 三次握手
| 通信 | SYN | ACK | SEQ | 操作 |
|-|-|-|-|-|
| 客户->服务 | + | | client_isn | 客户端随机选择起始序号 |
| 服务->客户 | | client_isn+1 | server_isn | 服务器分配资源, 随机选择起始序号 |
| 客户->服务 | | server_isn+1 | client_isn+1 | 客户端分配资源 |
[Textbook] 4.3, 5.3, 5.4, 5.5, 5.6
[Textbook] 3.1, 3.2, 3.3, 3.4, 3.5, 9.x
[Textbook] 3.6, 3.7
[Textbook] 8.x
]]>[Textbook] 2.x
关系代数:
- 确定查询目标
- 明确查询条件
- 选择查找路径, 确定操作对象
- 关系的合并: 据3, 联结
- 元组的选择: 据2, 条件
- 属性的指定: 据1, 投影
Header or Body, use <script> ... </script>
1 | <script> |
External File or URL, use <script src="..."></script>
1 | <script src="/js/myScript.js"></script> |
document.write("...")
document.getElementById("elementName").innerHTML = ...
window.alert(...);
alert(...)
console.log(...)
I know C, so nothing new
function
as code blocksbreak
, continue
, do ... while
, for
, if ... else
, return
, switch
similar to Ctry ... catch
similar to javadebugger
: Stops the execution of JavaScript, and calls (if available) the debugging functionfunction
, var
explained aboveNothing new here
数据的特性
数据特性的变化
数据库应用系统DBAS: 利用数据库系统作应用开发所构成的集成化的独立运行系统
数据库应用系统层次结构(9)
硬件平台->操作系统->数据->数据库管理系统->数据交换与中间件->开发工具->应用软件->应用界面->用户
人工管理->文件系统管理->数据库系统管理
数据模型应该能比较真实地模拟现实世界, 易于人理解, 便于在计算机上实现
- 数据结构: 数据的类型, 内容, 性质, 数据间联系
- 数据操作: 操作类型, 操作方式
- 数据约束: 数据结构内数据间的相互关系: 语法语义联系, 制约与依存, 动态变化规则
数据模型的核心是数据结构, 现实中数据及其关系到数据库, 有逐步转化的过程, 以数据模型表示其转化结果
概念数据模型–>逻辑数据模型–>物理数据模型(可实现)
- 概念数据模型: 面向客观世界, 面向用户, 无关于数据库管理系统和计算机平台
种类: E-R模型, EE-R模型; 面向对象模型; 谓词模型
描述客观对象的数据特征及相互关系- 逻辑数据模型: 面向数据库系统, 着重于DBMS实现, 承上启下
种类: 层次, 网状模型; 关系, 面向对象, 谓词模型; 对象关系模型
描述事物及关系在选定的DBMS中的实现结构, 即据DBMS定义事物及关系的实现结构- 物理数据模型: 面向计算机物理表示, 给出数据模型在计算机上的物理表示
向用户提供与物理存储结构与存取方法相关的定义: 索引, 集簇, 存储区域的选择
1
2
3
4
5
6
7
8
9
10
11
12
13 客观世界 用户1 ... 用户n
| | |
| | |
| | |
概念模型 +----------->外模式1 ... 外模式n
| / | |
| / | |
| / | |
逻辑模型--------------->概念模式---------+
| |
| |
| |
物理模型--------------->内模式
用户需求: 数据需求, 处理要求
提供转换过程的: 客观基础, 启动环境
基本术语: (实体, 属性, 联系)E-R模型, (对象, 类, 方法, 继承)OO模型
无关于具体的DBMS和计算机
用特定的DBMS所提供的工具来定义逻辑数据模型, 侧重于概念数据模型的细化和在数据库系统一级的实现
有关于具体的DBMS
侧重于数据库物理存储结构的描述: 存储结构设计, 存取路径设计, 存储空间分配
DB的最终实现结构
客观事物的抽象, 概念世界中的基本单位
属性有值, 取值集合为值域
共性实体有相同的属性组成
不同实体在其属性取值上有区别
描述实体的组成结构信息
所有属性值的集合称为实体值, 又称元组
关键字: 是可用于区分同一个实体集中不同实体的 ‘最小属性集合’
由一个‘联系名’ + 与该联系相关的‘实体集的名称’, 以及联系上的属性, 从而构成联系及其与实体集之间的连接关系的描述
每个属性只能隶属于一个实体集, 哪怕同名
实体集与联系的连线旁边, 用数字标明涉及的实体数量
考虑取值, 若某一性质仅有一个重要的信息, 则作为属性, 如仅使用身份证号码的身份证; 若有多个重要信息, 则作为实体, 这些信息作为属性, 如身份证与其号码, 有效期, 签发机关等
与多个对象有关, 往往是联系; 一些事件有相关的物品, 例如交易与其合同, 交易可作为关系, 也可用合同表示为实体
只需考虑两两关系且无歧义时, 多元可转化为多个二元
实体的属性: 内在特征, 与联系无关; 联系的属性: 联系消失则消失的属性
用子集到超集的有向箭头表示, 书中箭头带圈
- 继承性: 子集继承超集中的所有属性, 亦可有自己专有的属性; 超集关键字也是子集关键字
- 传递性
- 优点: 更好地映射到面向对象方法; 统一共性, 又能体现差异, 更好地模拟现实世界
- 覆盖约束: 所有子集的并集等价于超集, 一个实体至少属于一个子集
- 不相交约束: 子集互不相交, 一个实体至多属于一个子集
用从弱实体集到联系的有向箭头表示
标注在属性到实体集的连线上
- (0,?): 可取空值, 不加限制
- (1,?): 不可空值
- (?,1): 单值属性
- (?,N): 可取空值, 至多N值
标注在联系到实体集的连线上
- card(E,R) = (min-card(E,R), max-card(E,R)), 实体集E中一个实体, 通过联系R连接到实体集F中, 所能连接的实体数量范围
- 单值参与: max = 1; 否则多值参与
- 可选参与: min = 0; 否则强制参与
- 用“参与方式”代替函数对应关系, 描述实体在联系中的数量对应关系
- [解题技巧] 观察每个实体连了几根线, 这个数值的范围就是参与基数
提供高度的数据独立性
提供严格的数据视图
减轻DBA的工作
建立理论基础
事务管理与文件管理相结合: 为商业及其它行业的服务作准备
操作对象是记录集合, 而不是单个记录
“笛卡尔积/θ-连接/自然连接”的使用方法
除
关系->谓词
关系操作->关系演算公式
1 | int exgcd (int a, int b, int &x, int &y) { |
$$\frac{\bar{X}{}$$
]]>自上一次替换后双极性 | 脉冲(比特1)数 | |
---|---|---|
前面脉冲的极性 | 奇数 | 偶数 |
- | 000- | +00+ |
+ | 000+ | -00- |
名称 | 描述 | 详述 |
---|---|---|
传输时延 | 数据量 ÷ 数据率 | emit all bits into medium |
传播时延 | 介质一段到另一端 | a bit to traverse the link |
处理时延 | 单节点时延 × 途径节点数 | the recipient or intermediate node processing |
排队时延 | Σ此前耗时 | waiting time at the queue |
流程
数据切分成小数据块传输
计算题
流程
接收端缓存大小 W
发送端在没有收到ACK前可以发送W个帧
每个帧通过序号来标识, 序号大小受字段长度限制(k bits)帧以 2 k 为模编号($0\to 2^{k}-1$)
ACK(RRx)包含下一个期望收到的帧编号x
优化
计算题
ARQ | 最大窗口大小(n bit 序号) | 发送端缓存大小 | 接收端缓存大小 |
---|---|---|---|
Stop-Wait | 无窗口, 无序号 | 无 | 无 |
Go-Back-N | $2^n-1$ | 窗口大小 | 无 |
Sel-Rej | $2^{n-1}$ | 窗口大小 | 窗口大小 |
数据传送方式 | 链路设置 | 传输发起 |
---|---|---|
正常相应方式NRM | 非平衡设置 | 主站发起, 从站收到主站命令才能传输 |
异步平衡方式ABM | 平衡设置 | 混合站均可发起, 应用最广泛 |
Flag | Address | Control | Information | FCS | Flag |
---|---|---|---|---|---|
8 bit | 8 bit extendable | 8 or 16 bit | variable | 16 or 32 bit | 8 bit |
复用类型 | 关键设备 | 复用原理 | 介质 |
---|---|---|---|
FDM 频分复用 | 调制解调器 | 载波频率 | |
WDM 波分复用 | 棱镜 | 光波长 | 光纤 |
用户到网络数据 | 电视节目 | 网络到用户数据 |
---|---|---|
5-40MHz | 50-550MHz | 550-750MHz |
话音POTS | 上行流 | 下行流 |
---|---|---|
0-20kHz | 25-200kHz | 250-1000kHz |
第一级 | 第二级 | 第三级 |
---|---|---|
$\frac{N}{n}$个$n\times m$单元 | $m$个$n\times n$单元 | $\frac{N}{n}$个$N\times m$单元 |
$m\geq 2n - 1$时非阻塞, 否则阻塞
Banyan Switch
交换方式 | 建立时间$t_{build}$ | 实际传输的数据$L’$ | 传输时间$t_{trans}$ | 节点延迟$t_{delay}$ | 总时间$t$ |
---|---|---|---|---|---|
电路交换 | $S$ | $L$ | $\frac{L}{B}$ | $DN$ | $S + DN + \frac{L}{B}$ |
数据报交换 | $0$ | $P\lceil\frac{L}{P-H}\rceil$ | $P\lceil\frac{L}{P-H}\rceil/B$ | $DN$ | $DN + P\lceil\frac{L}{P-H}\rceil/B$ |
虚电路交换 | $S$ | $P\lceil\frac{L}{P-H}\rceil$ | $P\lceil\frac{L}{P-H}\rceil/B$ | $DN$ | $S + DN + P\lceil\frac{L}{P-H}\rceil/B$ |
功能 | 描述 |
---|---|
移动单元初始化 | 定期扫描, 选择使用最强的基站建立控制信道, 并与控制该蜂窝的MTSO握手, 之后监听是否有寻呼 |
移动台发起的呼叫 | 移动单元通过在已选的建立信道上, 若信道空闲, 发送被叫单元的号码来发起呼叫 |
寻呼 | MTSO根据被叫号码, 向某些基站发送寻呼信息 |
呼叫接收 | 被叫单元识别寻呼, 向基站发通知 -> 基站向MTSO发通知 -> MTSO建立电路, 选两个业务信道, 通知两个基站 -> 基站通知单元 |
呼叫进行中 | 话音或数据信号: 单元 <-> 基站 <-> MTSO <-> 基站 <-> 单元->->->-> |
切换 | 移动单元跨蜂窝移动, 业务信道切换到指派给新蜂窝的业务信道, 不警告用户 |
呼叫阻塞 | 没有空闲业务信道, 将重试数次, 耗尽次数返回忙音 |
呼叫终止 | 用户挂机, MTSO得到通知, 释放业务信道 |
呼叫掉线 | 信号强度低于最小信号强度, MTSO将得到通知, 释放信道 |
连接固定用户 | MTSO与公用电话交换网络连接 |
连接远程用户 | MTSO通过电话网或专用线路, 与远程MTSO连接, 并为二者用户建立连接 |
类型 | 描述 |
---|---|
快衰落 | 振幅的变化也高达20一30dB这种类型的迅速衰落变化 |
慢衰落 | 接收功率除了出现快速波动之外, 接收到的平均功率水平也会变化 |
平坦衰落 | 接收信号的所有频率成分的波动是同时的且成相同比例的 |
选择性衰落 | 对一个无线电信号的不同頻谱成分的影响是不同的 |
技术 | 最初设计时间 | 应用时间 | 服务 | 数据率 | 复用技术 | 核心网络 | 更多 |
---|---|---|---|---|---|---|---|
1G | 1970 | 1984 | 模拟话音 | 1.9kbps | FDMA | PSTN | |
2G | 1980 | 1991 | 数字话音 | 9.6kbps-14.4kbps | (GSM)TDMA, CDMA | PSTN | EDGE, 均衡, 交织, RAKE接收, 功率控制 |
2.5G | 1985 | 1999 | 大容量分组化数据 | 384kbps-2Mbps | TDMA,CDMA | PSTN, 分组网络 | 多用户检测, 智能天线, Turbo 编码, 多媒体数据 |
4G | 2000 | 2012 | 完全基于IP | 20~100Mbps-1Gbps | OFDMA, SC-FDMA | IP干线网 | 自适应调制编码, 混合自动重传, MIMO |
基本概念与枢纽变量法
正态总体$N(\mu, \sigma^2)$中均值$\mu$的置信区间
定义6.1
设$(X_1,X_2,\cdots,X_n)$为总体$X$的一个样本, $T(x_1,x_2,\cdots,x_n)$为不含任何未知参数的函数, 则称$T(x_1,x_2,\cdots,x_n)$为一个统计量
样本均值
$$\bar{X}=\frac{1}{n}\sum_{i-1}^nX_i$$
样本方差
$$S^2=\frac{1}{n-1}\sum_{i=1}^n(X_i-\bar{X})^2$$
$$S^{*2}=\frac{1}{n}\sum_{i=1}^n(X_i-\bar{X})^2=\frac{1}{n}\sum_{i=1}^nX_i^2-\bar{X}^2$$
样本标准差
$$S=\sqrt{S^2}$$
自上一次替换后双极性 | 脉冲(比特1)数 | |
---|---|---|
前面脉冲的极性 | 奇数 | 偶数 |
- | 000- | +00+ |
+ | 000+ | -00- |
For every word $w\in\Sigma^*$, and every symbol $a\in\Sigma$, $#_a (w)$ is the number of occurrences of the symbol $a$ in the word $w$.
More to be added
Canonical Ordering: We define the canonical ordering on $\Sigma^$ as follows. For all $u, v\in\Sigma^$, $u < v$ if $|u| < |v|$ or $|u| = |v|$, $u = xs_iu’$, and $v = xs_jv’$ for some $x,u’,v’ \in\Sigma^*$, and $i < j$.
$d_{min}=2n+1$ means correcting $n$ or fewer errors or detecting $2n$ or fewer errors.
Group Code
A code that is a subgroup of $\mathbb{Z}_2^n$
Lemma 8.17
$w(\mathbf{x}+\mathbf{y})=d(\mathbf{x},\mathbf{y})$
Theorem 8.18
$d_{min}=\min\{w(\mathbf{x}):\mathbf{x}\ne 0\}$
Theorem 8.21
$H\in\mathbb{M}_{m\times n}(\mathbb{Z}_2)$, then $\mathrm{null}(H)$ is a group code
Canonical Parity-Check Matrix
$H=(A|I_m)$, $A\in\mathbb{M}_{m\times (n-m)}(\mathbb{Z}_2)$
Generator Matrix
$G=(\frac{I_{n-m}}{A})$
Theorem 8.25
Theorem 8.26
Theorem 8.31
Then the null space of $H$ is a single error-detecting code if and only if no column of $H$ consists entirely of zeros.
Theorem 8.34
Let H be a binary matrix. The null space of $H$ is a single error-correcting code if and only if $H$ does not contain any zero columns and no two columns of $H$ are identical.
Syndrome
$H\mathbf{x}$, where $H$ is an $n\times m$-matrix, and $\mathbf{x}\in\mathbb{Z}_2^k$
Proposition 8.36
$\mathbf{x}=\mathbf{c}+\mathbf{e}$, $\mathbf{x}$ is the code received, $\mathbf{c}$ is the codeword, $\mathbf{e}$ is the transmission error. Then $H\mathbf{x}=H\mathbf{e}$
Theorem 8.37
Coset Decoding
Coset or standard decoding uses the cosets of $C$ in $\mathbb{Z}_2^n$ to implement maximum-likelihood decoding.
Proposition 8.43
协方差性质
定理4.3 Cauchy-Schowarz不等式
$$[\mathrm{cov}(X,Y)]^2\leq D(X)D(Y)$$
名称 | 参数 | 分布律或概率密度 | 数学期望 | 方差 |
---|---|---|---|---|
0-1分布 | $B(x,p)$ | $P(X=k)=p^k(1-p)^{1-k}$ | $p$ | $p(1-p)$ |
二项分布 | $B(n,p)$ | $P(X=k)=C_n^kp^k(1-p)^{n-k}$ | $np$ | $np(1-p)$ |
负二项分布 | $NB(r,p)$ | $P(X=k)=C_{k-1}^{r-1}p^r(1-p)^{k-r}$ | $\frac{r}{p}$ | $\frac{r(1-p)}{p^2}$ |
几何分布 | $G(p)$ | $P(X=k)=p(1-p)^{k-1}$ | $\frac{1}{p}$ | $\frac{(1-p)}{p^2}$ |
超几何分布 | $H(n,M,N)$ | $P(X=k)=\frac{C_M^kC_{N-M}^{n-m}}{C_N^n}$ | $\frac{nM}{N}$ | $\frac{nM}{N}(1-\frac{M}{N})(\frac{N-n}{N-1})$ |
泊松分布 | $P(\lambda)$ | $P(X=k)=\frac{\lambda^k}{k!}e^{-\lambda}$ | $\lambda$ | $\lambda$ |
均匀分布 | $U[a,b]$ | $P_{[a,b]}\equiv\frac{1}{b-a}$ | $\frac{a+b}{2}$ | $\frac{(b-a)^2}{12}$ |
正态分布 | $N(\mu,\sigma^2)$ | $p(x)=\frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{(x-\mu)^2}{2\sigma^2}}$ | $\mu$ | $\sigma^2$ |
$G(\lambda,r)$ | $p(x)_{x>0}=\frac{\lambda^r}{\Gamma(r)}x^{r-1}e^{-\lambda x}$ | $\frac{r}{\lambda}$ | $\frac{r}{\lambda^2}$ | |
指数分布 | $e(\theta)$ | $p(x)_{x>0}=\frac{1}{\theta}e^{-\frac{x}{\theta}}$ | $\theta$ | $\theta^2$ |
柯西分布 | $C(\lambda, \alpha)$ | $p(x)=\frac{1}{\pi}\frac{1}{\lambda^2+(x-\alpha)^2}$ | $\nexists$ | $\nexists$ |
$$ | $$ | $$ | $$ | |
$$ | $$ | $$ | $$ | |
$$ | $$ | $$ | $$ |
Private Key Cryptography (单钥/私钥加密)
The same key is used for both encrypting and decrypting messages
Monoalphabetic Cryptosystems (单字母密码系统/移位码)
A character in the enciphered message represents exactly one character in the original message.
Simple Shift Code (简单移位码)
$$f(p)=p+b\textrm{ mod } 26$$
Affine Cryptosystem (仿射密码系统)
$\textrm{gcd}(a,26)=1$:
$$f(p) = ap+b\textrm{ mod } 26$$
A ciphertext letter could represent more than one plaintext letter
$\mathrm{A}\in\mathrm{M}_{2\times 2}$:
$$f(\vec{p})=\mathrm{A}\vec{p}+\vec{b}$$
RSA Cryptosystem
RSA Encryption & Decryption
下载地址在官网,有Windows,Mac,Linux,iPhone/Android等版本
中文官网
英文官网
Anki是日语“暗記”的罗马音,意为背诵,是目前世界最流行的记忆软件之一。这个软件在形式上类似“百词斩”等卡片式背单词软件,但功能却多出一个数量级。
我在使用Anki的时候,对这一软件的以下功能有所尝试:
这个软件提供了及其详细的手册!大家自己看吧。入门请不要使用移动版(iPhone/Android),因为功能不全
中文手册(翻译中)
英文手册
官方网站
网站亦包含详细使用说明,不过主要是针对旧版本,以下使用说明主要面向新版本变化较大的功能进行
新版本加入的多标签功能,允许一个PanDownload客户端登陆多个网盘账号,或是打开多个连接。由于百度网盘单个账号的容量偏小,多个账号可以让你存更多资♂源。已登录的账号会在每次开启时自动打开一个标签页,显示此账号下的文件。
新建标签页,请点击标签页栏的+
号
更多功能-新番下载
按照更新日分类,正在播出的新番基本都有,比B站,爱奇艺的会员慢10分钟
左右
选择相应的番剧,会打开一个分享目录,右键你想要的那一集,点击下载即可享用
如果显示出来源为AGE动漫
,却没有下载链接显示,多数情况下是来源站正在维护或GG了,请尝试直接前往来源站(ping一下也行):
AGE动漫
PS:我记得以前还有嘀哩嘀哩的来源的,好像D站被B站干了,就剩AGE独苗一根
PPS:这里的资源大多数是720P AVC(x264)格式,动作一多就是马赛克,对画质有要求的还是老老实实大会员吧(上次看刀剑神域一段UGO变剑,搞得满屏马赛克,最高祭司都不用打码了
更多功能-资源搜索
绝对的找资源神器,大量的百度盘资源随你选,除了黄赌毒基本上都能搜到
所有下载的资源建议24小时内删除,资源本身与软件作者和本介绍作者无关
看番还是建议正版,除了画质,其实弹幕才是本体
我不保证你用了就会快到吃满带宽,因为我也不能钦点的
,但是你问我支不支持那我肯定是支持的
定义3.3
设随机向量$(X,Y)$的所有可能取值为$(x_i,y_i)$, $i,j=1,2,\cdots$, 假设当$i\ne k, j\ne l$时, $x_i\ne x_k, y_j\ne y_l$, 则$P(X=x_i, Y=y_i)=p_{ij}$, $i=1,2,\cdots$称为随机向量$(X,Y)$的联合分布率或$X$和$Y$的联合概率分布
由分布律的定义可以得到联合分布率$\{p_{ij}\}$具有下列性质:
多项分布
在$n$次独立重复实验中, 已知每次试验由三种不同的可能结果$A_1,A_2,A_3$, 且$P(A_i)=p_i$, $i=1,2,3$, $p_1+p_2+p_3=1$. 若以$X_1, X_2$分别记结果$A_1,A_2,A_3$出现的次数, 则任意的$k_i\in[0,n]\cap\mathbb{N}$, $i=1,2$
$$P(X_1=k_1,X_2=k_2)=\frac{n!}{k_1!k_2!(n-k_1-k_2)!}p_1^{k_1}p_2^{k_2}(1-p_1-p_2)^{n-k_1-k_2}$$
记为
$$(X_1,X_2)\sim M(n;p_1,p_2,p_3)$$
多元超几何分布
设一个袋中分别标有1, 2或3的球, 设$i$号球有$N_i$只, $i=1,2,3$, 且$N_1+N_2+N_3=N$. 从中不放回地随机摸出$n$只, $n\leq N$, 若以$X_1$, $X_2$分别记1, 2号球的出现次数, 则$(X_1,X_2)$的联合概率分布为
$$P(X_1=n_1,X_2=n_2)=\frac{C_{N_1}^{n_1}C_{N_2}^{n_2}C_{N_3}^{n_3}}{C_N^n}$$
定义3.4
对任意的实数$x,y$, 称二元函数$F(x,y)=P(X\leq x, Y\leq y)$为随机向量$(X,Y)$的 (联合)分布函数, 记为$(X,Y)\sim F(x,y)$
若$(X,Y)$的分布律为$\{p_{ij}\}$, 则它的分布函数可由它的分布律表示:
$$F(x,y)=\sum_{x_i\leq x, y_i\leq y}p_{ij}$$
边缘分布函数
$$F_X(x)=P(X\leq x)=P(X\leq x, y\leq +\infty)=\lim_{y\to+\infty}P(X\leq x,Y\leq y)\eqqcolon F(x,+\infty)$$
$$F_Y(y)=F(+\infty, y)=\lim_{x\to +\infty}F(x,y)$$
定义3.5
设二维随机向量$(X,Y)$的分布函数为$F(x,y)$, 若存在非负可积二元函数$p(X,Y)$, 对任意的$x,y\in \mathbb{R}$, 有
$$F(x,y)=\int_{-\infty}^x\int_{-\infty}^{y}p(u,v)dudv$$
则称$(X,Y)$为二维连续型随机向量, 而称$p(X,Y)$为$(X,Y)$的一个联合概率密度函数, 简称为联合密度
由分布律的定义可以得到联合概率密度函数$\{p(x,y)\}$具有下列性质:
边缘密度函数
$$p_X(x)=\int_{-\infty}^{+\infty}p(x,v)dv$$
$$p_Y(y)=\int_{-\infty}^{+\infty}p(v,y)dv$$
在$X=x_i$下, $Y$的条件分布律
$$P(Y=y_i|X=x_i)=\frac{P(Y=y_i,X=x_i)}{P(X=x_i)}=\frac{p_{ij}}{p_i}$$
$Y$的边际分布
$$P(Y=y_i)=\sum_{i=1}^{+\infty}P(Y=y_i,X=x_i)=\sum_{i=1}^{+\infty}P(Y=y_i|X=x_i)P(X=x_i)$$
在$X=x$的条件下, $Y$的条件分布函数
$$F_{Y|X=x}(y)=P(Y\leq y|X=x)=\int_{-\infty}^{y}\frac{p(x,v)}{p_X(x)}dv$$
在$X=x$的条件下, $Y$的条件密度函数
$$p_{Y|X=x}(y)=\frac{p(x,v)}{p_X(x)}$$
定义3.9
设$X$和$Y$是两个离散型随机变量, 若对任意的一组$(x_i,y_j)$,
$$P(X=x_i,Y=y_j)=P(X=x_i)P(Y=y_j)$$
即对任意的$i,j$, $p_{ij}=p_i\cdot p_j$, 则称随机变量$X$和$Y$相互独立
定义3.10
设$X_1,X_2,\cdots,X_n$都是离散型随机变量, 若对任意的$x_1,x_2,\cdots x_n$,
$$P(X=x_1,X=x_2,\cdots,X=x_n)=P(X=x_1)P(X=x_2)\cdots P(X=x_n)$$
即对任意的$i,j$, $p_{ij}=p_i\cdot p_j$, 则称随机变量$X$和$Y$相互独立
定理3.1
设$X_1,X_2,\cdots,X_n$相互独立, 若函数$Y_1=g_1(X_1,X_2,\cdots,X_m)$和$Y_2=g_2(X_{m+1},X_{m+2},\cdots,X_n)$仍然是随机变量, 则$Y_1$和$Y_2$独立
定义3.11
设$n$维随机向量$(X_1,X_2,\cdots,X_n)$的联合密度函数为$p(x_1,x_2,\cdots,x_n)$, 而$X_i$的边缘密度函数为$p_i(x_i)$. 如果
$$p(x_1,\cdots,x_n)=p_1(x_1)p_2(x_2)\cdots p_n(x_n)$$
就称随机变量$X_1,X_2,\cdots,X_n$相互独立, 或者简称独立
定理3.2
独立的充要条件:
$$F(x,y)=F_X(x)F_Y(y)$$
定理3.3
联合密度函数为$f(x,y)$时, 二者独立的充要条件:
$$\exists g_1,g_2,\quad f(x,y)=g_1(x)g_2(y)$$
和的分布$Z=X+Y$
$$p_Z(z)=\int_{-\infty}^{+\infty}p(x,z-x)dx$$
商的分布$Z+X/Y$
$$p_Z(z)=\int_{-\infty}^{+\infty}|y|p(zy,y)dy$$
最大(小)值的分布$M=\max, N=\min$
$$F_M(z)=F_X(z)F_Y(z)$$
$$F_N(z)=1-(1-F_X(z))(1-F_Y(z))$$
求导可得密度函数
Isomorphic (同构)
Two groups $(G, \cdot)$ and $(H, \circ)$ are isomorphic if there exists a one-to-one and onto map $\phi: G\to H$ such that the group operation is preserved; that is,
$$\phi(a \cdot b) = \phi(a) \circ \phi(b)$$
for all $a$ and $b$ in $G$. If $G$ is isomorphic to $H$, we write $G\cong H$.
Isomorphism
The map $\phi$ is called an isomorphism.
Theorem 9.6
Let $\phi: G\to H$ be an isomorphism of two groups. Then the following statements are true.
- $\phi^{-1}: H\to G$ is an isomorphism
- $|G|=|H|$
- If $G$ is abelian, then $H$ is abelian
- If $G$ is cyclic, then $H$ is cyclic
- If $G$ is a subgroup of order $n$, then $H$ is a subgroup of order $n$
Theorem 9.7
All cyclic groups of infinite order are isomorphic to $\mathbb{Z}$
Theorem 9.8
If $G$ is a cyclic group of order $n$, then G is isomorphic to $\mathbb{Z}_n$.
Corollary 9.9
If $G$ is a group of order $p$, where $p$ is a prime number, then $G$ is isomorphic to $\mathbb{Z}_p$
Theorem 9.10
The isomorphism of groups determines an equivalence relation on the class of all groups.
Classifying all groups up to isomorphism; two groups are the same if they are isomorphic.
Theorem 9.12 Cayley
Every group is isomorphic to a group of permutations.
Left Regular Representation of $G$.
The isomorphism $g\to \lambda_g$
where $g\in G$, $\lambda_g(a)=ga$, $\bar{G}=\{\lambda_g:g\in G\}$ is the permutation group that is isomorphic with $G$
Proposition 9.13
Let $G$ and $H$ be groups. The set $G\times H$ is a group under the operation $(g_1, h_1)(g_2, h_2) = (g_1g_2, h_1h_2)$ where $g1, g2 \in G$ and $h_1, h_2 \in H$.
External Direct Product of $G$ and $H$ (外直积)
The group $G\times H$
Theorem 9.17
Let $(g, h) \in G\times H$. If $g$ and $h$ have finite orders $r$ and $s$ respectively, then the order of $(g, h)$ in $G\times H$ is the least common multiple of $r$ and $s$.
Corollary 9.18
Let $(g_1, . . . , g_n) \in \prod G_i$. If $g_i$ has finite order $r_i$ in $G_i$, then the order of $G_i$ is the least common multiple of $r_1,\cdots, r_n$.
Theorem 9.21
The group $\mathbb{Z}_m\times \mathbb{Z}n$ is isomorphic to $\mathbb{Z}{mn}$ if and only if $gcd(m,n) = 1$.
Corollary 9.22
Let $n_1, \cdots,n_k$ be positive integers. Then
$$\prod_{i=1}^k\mathbb{Z}_{n_i}\cong\mathbb{Z}_{n_1\cdots n_k}$$
if and only if $gcd(n_i,n_j)=1$ for $i\ne j$
Corollary 9.23
If
$$m=p_1^{e_1}\cdots p_k^{e_k}$$
where the $p_i$s are distinct primes, then
$$\mathbb{Z}m\cong\mathbb{Z}{p_1^{e_1}}\times\cdots\times\mathbb{Z}_{p_k^{e_k}}$$
Internal Direct Product (内直积)
Let $G$ be a group with subgroups $H$ and $K$ satisfying the following conditions.
- $G=HK=\{hk:h\in H,k\in K\}$
- $H\cap K={e}$
- $hk=kh$ for all $k\in K$ and $h\in H$
Then G is the internal direct product of H and K.
Theorem 9.27
Let $G$ be the internal direct product of subgroups $H$ and $K$. Then $G$ is isomorphic to $H\times K$.
Theorem 9.29
Let $G$ be the internal direct product of subgroups $H_i$, where $i = 1, 2, \cdots, n$. Then $G$ is isomorphic to $\prod_iH_i$
Normal Subgroup of a group $G$ (正规子群)
A subgroup $H$ of a group $G$ is normal in $G$ if $gH = Hg$ for all $g \in G$.
A normal subgroup of a group $G$ is one in which the right and left cosets are precisely the same.
Theorem 10.3
Let $G$ be a group and $N$ be a subgroup of $G$. Then the following statements are equivalent.
- The subgroup $N$ is normal in $G$
- For all $g\in G$, $gNg^{-1}\subset N$
- For all $g\in G$, $gNg^{-1}=N$
Factor Group (因子群) or Quotient Group (商群) of $G$
If $N$ is a normal subgroup of a group $G$, then the cosets of $N$ in $G$ form a group $G/N$ under the operation $(aN)(bN) = abN$.
This group is called the factor or quotient group of $G$ and $N$.
Theorem 10.4
Let $N$ be a normal subgroup of a group $G$. The cosets of $N$ in $G$ form a group $G/N$ of order $[G : N]$.
Simple Groups (简单群)
Groups with no nontrivial normal subgroups.
Lemma 10.8
The alternating group $A_n$ is generated by 3-cycles for $n \geq 3$.
Lemma 10.9
Let $N$ be a normal subgroup of $A_n$, where n ≥ 3. If $N$ contains a 3-cycle, then $N = A_n$
Lemma 10.10
For $n \geq 5$, every nontrivial normal subgroup $N$ of $A_n$ contains a 3-cycle.
Theorem 10.11
The alternating group, $A_n$, is simple for $n \geq 5$.
Homomorphism (同态) between groups $(G, \cdot)$ and $(H, \circ)$
A map $\phi: G\to H$ such that $\phi(g_1\cdot g_2)=\phi(g_1)\circ\phi(g_2)$ for $g_1, g_2 \in G$.
Homomorphic Image of $\phi$
The range of $\phi$ in $H$.
Proposition 11.4
Let $\phi: G_1\to G_2$ be a homomorphism of groups.
- If $e$ is the identity of $G_1$, then $\phi(e)$ is the identity of $G_2$;
- For any element $g \in G_1$, $\phi(g^{-1}) = [\phi(g)]^{−1}$;
- If $H_1$ is a subgroup of $G_1$, then $\phi(H_1)$ is a subgroup of $G_2$;
- If $H_2$ is a subgroup of $G_2$, then $\phi^{-1}(H_2) = \{g \in G_1 : \phi(g) \in H_2\}$ is a subgroup of $G_1$.
Furthermore, if $H_2$ is normal in $G_2$, then $\phi^{-1}(H_2)$ is normal in $G_1$.
Theorem 11.5
Let $\phi: G\to H$ be a group homomorphism. Then the kernel of $\phi$ is a normal subgroup of $G$.
The Natural or Canonical Homomorphism
Let $H$ be a normal subgroup of $G$. $\phi:G\to G/H$, $\phi(g)=gH$
is the natural or canonical homomorphism.
Theorem 11.10 First Isomorphism Theorem
If $\psi : G \to H$ is a group homomorphism with $K = \textrm{ker} \psi$, then $K$ is normal in $G$. Let $\phi : G \to G/K$ be the canonical homomorphism. Then there exists a unique isomorphism $\eta : G/K \to \psi(G)$ such that $\psi = \eta\phi$.
Theorem 11.12 Second Isomorphism Theorem
Let $H$ be a subgroup of a group $G$ (not necessarily normal in $G$) and $N$ a normal subgroup of $G$. Then $HN$ is a subgroup of $G$, $H \cap N$ is a normal subgroup of $H$, and
$$H/H \cap N \cong HN/N$$
Theorem 11.13 Correspondence Theorem
Let $N$ be a normal subgroup of a group $G$. Then $H \mapsto H/N$ is a one-to-one correspondence between the set of subgroups $H$ containing $N$ and the set of subgroups of $G/N$.
Furthermore, the normal subgroups of $G$ containing $N$ correspond to normal subgroups of $G/N$.
Theorem 11.14 Third Isomorphism Theorem
Let $G$ be a group and $N$ and $H$ be normal subgroups of $G$ with $N \subset H$. Then
$$G/H\cong\frac{G/N}{H/N}$$
$S_X=S_n$ is the permutation of a set $X=\{1,2,\cdots,n\}$
Theorem 5.1
The symmetric group on n letters, $S_n$, is a group with $n!$ elements, where the binary operation is the composition of maps.
It is not necessarily commutative
Proof:
- Identity: $\forall x\in X, x\to x$
- Associative: map composition is associative
- Inverse: $f^{-1}$ exists since $f$ is one-to-one and onto
- Size: number of permutations is $n!$
A subgroup of $S_n$
A permutation $\sigma\in S_X$
There exists elements $a_1$, $a_2$, $\cdots$, $a_k\in X$ such that
$\sigma(a_1)=a_2$, $\sigma(a_2)=a_3$, $\cdots$, $\sigma(a_k)=a_1$
$\{a_1,a_2,\cdots,a_k\}$ denotes the cycle $\sigma$
Not every permutation is a cycle.
$\forall i,j,\ a_i\ne b_j$
Proposition 5.8
Let $\sigma$ and $\tau$ be two disjoint cycles in $S_X$. Then $\sigma\tau=\tau\sigma$
Proof:
- $x$ is neither in $\{a_1,a_2,\cdots,a_k\}$ nor $\{b_1,b_2,\cdots,b_l\}$
$\sigma(x)=\tau(x)=x\Rightarrow\sigma\tau(x)=\tau\sigma(x)=x$- $x$ in $\{a_1,a_2,\cdots,a_k\}$
Then $x$ is not in $\{b_1,b_2,\cdots,b_l\}$
Because they are disjoint, $\sigma(x)\notin\{b_1,b_2,\cdots,b_l\}$
Then $\sigma\tau(x) = \sigma(x)$, and $\tau\sigma(x) = \tau(\sigma(x))=\sigma(x)$- $\sigma\tau=\tau\sigma$
Theorem 5.9
Every permutation in $S_n$ can be written as the product of disjoint cycles.
Proof: 咕咕咕
Permutation which is a cycle of length 2
Any permutation of a finite set containing at least two elements can be written as the product of transpositions.
Lemma 5.14
If the identity is written as the product of r transpositions, $id=\tau_1\tau_2\cdots \tau_r$ then r is an even number.
Proof: 咕咕咕
Theorem 5.15
If a permutation $\tau$ can be expressed as the product of an even number of transpositions, then any other product of transpositions equaling $\tau$ must also contain an even number of transpositions.
Similarly, if $\tau$ can be expressed as the product of an odd number of transpositions, then any other product of transpositions equaling $\tau$ must also contain an odd number of transpositions.
Proof:
$\sigma=\sigma_1\sigma_2\cdots\sigma_m=\tau_1\tau_2\cdots\tau_n$
$id=\sigma\sigma^{-1}=\sigma_1\sigma_2\cdots\sigma_m(\tau_1\tau_2\cdots\tau_n)^{-1}=\sigma_1\sigma_2\cdots\sigma_m\tau_1\tau_2\cdots\tau_n$
Then $m+n$ must be even.
So even+even or odd+odd
The set of all even permutations $A_n$
Theorem 5.16
The set $A_n$ is a subgroup of $S_n$
Proof
- The product of 2 even permutations is even
- The identity is even
- The inverse is even
Proposition 5.17
The number of even permutations in $S_n$, $n\geq2$, is equal to the number of odd permutations.
Hence, the order of $A_n$ is $n!/2$.
Proof:
Prove a bijection $\lambda_\sigma(\tau)=\sigma\tau$
The group of rigid motions of a regular $n-gon$
The dihedral group, $D_n$, is a subgroup of $S_n$ of order $2n$
Theorem 5.23
The group $D_n$, $n\geq 3$, consists of all products of the two elements $r$ and $s$, satisfying the relations
$$r^n=1$$
$$s^2=1$$
$$srs = r^{-1}$$
Proof:
$r$ is the rotation $r^k=k\frac{360\degree}{n}$, $1,r,r^2\cdots r^{n-1}$
$s_i$ is the mirror. If $n$ is even, then there are $n/2$ $s_i$ for each pair of across vertices, and $n/2$ $s_i$ for each pair of across edges. If $n$ is odd, then there are $n$ $s_i$ for each vertex.
The group of rigid motions of a cube contains 24 elements.
The group of rigid motions of a cube is $S_4$.
$gH=\{gh:h\in H\}$
$Hg=\{hg:h\in H\}$
Let $H$ be a subgroup of a group $G$ and suppose that $g_1, g_2 \in G$. The following conditions are equivalent.
- $g_1H=g_2H$
- $Hg_1^{-1}=Hg_2^{-1}$
- $g_1H\subset g_2H$
- $g_2\in g_1H$
- $g_1^{-1}g_2\in H$
Theorem 6.4
Let $H$ be a subgroup of a group $G$. Then the left cosets ofH in $G$ partition $G$. That is, the group $G$ is the disjoint union of the left cosets of $H$ in $G$.
Proof:
$g_1H\cap g_2H\ne\emptyset\Rightarrow\exists a=g_1h_1=g_2h_2\Rightarrow g_1=g_2h_2h_1^{-1}\Rightarrow g_1\subset g_2H$
By Lemma 6.3, $g_1H=g_2H$
$[G:H]$ the number of left cosets of $H$ in $G$
Theorem 6.8
Let $H$ be a subgroup of a group $G$. The number of left cosets of $H$ in $G$ is the same as the number of right cosets of $H$ in $G$.
Proof:
Find a bijective map $\phi:\mathcal {L}_H\to\mathcal {R}_H$, $\phi(gH)=Hg^{-1}$
$Hg_1^{-1}=\phi(g_1H)=\phi(g_2H)=Hg_2^{-1}$
By Lemma 6.3
Proposition 6.9
Let $H$ be a subgroup of $G$ with $g \in G$ and define a map $\phi :H \to gH$ by $\phi(h) = gh$. The map $\phi$ is bijective; hence, the number of elements in $H$ is the same as the number of elements in $gH$.
Proof: 咕咕咕
Theorem 6.10 Lagrange
Let $G$ be a finite group and let $H$ be a subgroup of $G$. Then $|G|/|H| = [G : H]$ is the number of distinct left cosets of $H$ in $G$. In particular, the number of elements in $H$ must divide the number of elements in $G$.
The converse is false.
Proof:
The group $G$ is partitioned into $[G : H]$ distinct left cosets. Each left coset has $|H|$ elements; therefore, $|G| = [G : H]|H|$.
Suppose that $G$ is a finite group and $g \in G$. Then the order of $g$ must divide the number of elements in $G$.
Corollary 6.12
Let $|G| = p$ with $p$ a prime number. Then $G$ is cyclic and any $g \in G$ such that $g \ne e$ is a generator.
Proof: 咕咕咕
Corollary 6.13
Let $H$ and $K$ be subgroups of a finite group $G$ such that $G\supset H\supset K$. Then
$$[G:K]=[G:H][H:K]$$
Proof:
$$[G:K]=\frac{|G|}{|K|}=\frac{|G|}{|H|}\frac{|H|}{|K|}=[G:H][H:K]$$
Proposition 6.15
The group $A_4$ has no subgroup of order 6.
Proof: 咕咕咕
Theorem 6.16
Two cycles $\tau$ and $\mu$ in $S_n$ have the same length if and only if there exists a $\sigma\in S_n$ such that $\mu = \sigma\tau\sigma^{-1}$.
Proof: 咕咕咕
the map $\phi: \mathbb{N}\to\mathbb{N}$ defined by $\phi(n)=1$ for $n = 1$, and, for $n > 1$, $\phi(n)$ is the number of positive integers $m$ with $1 ≤ m < n$ and $gcd(m,n) = 1$.
$$\phi(n)=n\prod_{p|n\textrm{ and }p\textrm{ is prime}}(1-\frac{1}{p})$$
一个因子一次,例如$8$只需计算一次$p=2$
Let $U(n)$ be the group of units in $\mathbb{Z}_n$. Then $|U(n)| = \phi(n)$.
Theorem 6.18 Euler’s Theorem
Let $a$ and $n$ be integers such that $n > 0$ and $gcd(a, n) = 1$. Then $a^{\phi(n)} \equiv 1 (mod\ n)$.
Proof:
$|U(n)|=\phi(n)$ by Theorem 6.17
$\forall a\in U(n), a^{\phi(n)}=1$
$a^{\phi(n)} \equiv 1 (mod\ n)$
Let $p$ be any prime number and suppose that $p \nmid a$ ($p$ does not divide $a$). Then
$$a^{p-1}\equiv 1(mod\ p)$$
For any integer $b$, $b^p\equiv b(mod\ p)$
0-1分布
若随机变量的可能取值只有0, 1, 且
$$P(X=1)=p, P(X=0)=q, (0<p<1, q=1-p)$$
则称$X$服从0-1分布
二项分布
若随机变量的分布律为
$$p_k=P(X=k)=C_n^kp^kq^{n-k}, k=0,1,\cdots, n$$
其中$0<p<1,q=1-p$, 则称$X$服从参数为$n,p$的二项分布, 记为$X\sim B(n,p)$
泊松分布
如果随机变量$X$的分布律为
$$p_k=P(X=k)=\frac{\lambda^k}{k!}e^{-\lambda}, k=0,1,2,\cdots$$
其中$\lambda>0$为常数, 则称$X$服从参数为$\lambda$的泊松分布, 记为$X\sim P(\lambda)$
是用于表示大量试验中稀有事件出现的频数的概率模型
然后$p_Y=(y)=F’_Y(y)$
定理
若随机变量$X$的分布函数$F(x)$严格单调递增, 则随机变量$Y=F(X)$服从$[0,1]$上的均匀分布
定理2.2
设随机变量$X$的可能取值范围为$(a,b)$, $X$的概率密度为$p(x)$,$a<x<b$(其中$a$可为$-\infty$, $b$可为$+\infty$), 设函数$y=(x)$处处可导, 且恒有$g’(x)>0$(或恒有$g’(x)<0$), 则$Y=g(X)$为连续型随机变量,其概率密度为
$$p_Y(y)=\begin{cases}
p_X[g^{-1}(y)]\cdot|[g^{-1}(y)]’| &\alpha<y<\beta\\
0 &其他
\end{cases}$$
其中$\alpha=\min\{g(a),g(b)\}$, $\beta=\max\{g(a),g(b)\}$, $g^{-1}(y)$为$y=g(x)$的反函数
定义1.1(字母表)
定义1.2(命题)
定义1.3(命题集)
所有命题的集合$PROP$是满足以下条件的最小集合:
引理1.4(括号引理)
若$A$为命题, 则$A$中所有左括号的个数等于右括号的个数
引理1.5
$A\in PROP$等价于存在有穷序列$A_0,A_1,\cdots,A_n$使$A$为$A_n$且对任何$i\leq n$,
结构归纳
什么是命题的语义
对于任意的赋值, $v:PS\rightarrow\{T,F\}$, 定义一个解释
$$\hat{v}:PROP\rightarrow\{T,F\}$$
定义1.6
令真值集$B=\{T,F\}$
定义1.7(命题的语义)
对于任何赋值$v$, 定义$\hat{v}:PROP\rightarrow B$如下:
确实应该是$H_*(\hat{v}(A),\hat{v}(B))$
引理1.8
设$A$为命题, $v_1$, $v_2$为赋值, 若$v_1\upharpoonright FV(A)=v_2\upharpoonright FV(A)$, 即对于$P\in FV(A)$, $v_1(P)=v_2(P)$, 则$\hat{v_1}(A)=\hat{v_2}(A)$
定义1.9
设$A$为命题, $v$为赋值
定义1.10
设$A$为命题, $FV(A)=\{Q_1, \cdots, Q_n\}$. $n$元函数$H_A:B^n\to B$定义如下: 对于任何$(a_1,\cdots,a_n)\in B^n$, $H_A(a_1,\cdots, a_n)=\hat{v}(A)$, 这里赋值$v$满足$v(Q_i)=a_i(1\leq i\leq n)$. 下面称$f:B^n\to B$为$n$元真值函数, 称$H_A$为$A$定义的真值函数
定义1.11
定理1.12
定义1.13
命题1.14
命题1.15
设$FV(A\wedge B)=\{Q_1, \cdots, Q_n\}$且$H_A:B^n\rightarrow B$, $H_B:B^n\rightarrow B$. 我们有$A\simeq B\textrm{ iff }H_A=H_B$
命题1.16
若$A$为命题,则存在$\wedge\vee$-nf$B$和$\vee\wedge$-nf$B’$使$A\simeq B$且$A\simeq B’$, 这时称$B$和$B’$分别为$A$的$\wedge\vee$-nf和$\vee\wedge$-nf
定义1.17
一个矢列是一个二元组$(\Gamma, \Delta)$, 记为$\Gamma\vdash\Delta$, 这里$\Gamma, \Delta$为命题的有穷集合(可以为空), 称$\Gamma$为前件, $\Delta$为后件. 命题逻辑的自然推理系统$G’$由以下公里和规则组成, $\Gamma, \Delta, \Lambda, \Theta$表示任何命题有穷集合, $A, B$表示任何命题, $\Lambda, A, \Delta$为集合$\Lambda\cup\{A\}\cup\Delta$的缩写
定义1.18
设$\Lambda$为$\{A_1,A_2,\cdots, A_m\}$, $\Delta$为$\{B_1,B_2,\cdots, B_n\}$
命题1.19
$\Gamma\vdash\Delta$有效$\textrm{ iff }$$\Gamma\vdash\Delta$无反例
引理1.20
对于$G’$系统中的每条异于$\textrm{Cut}$的规则:
定义1.21
设$\Gamma\vdash\Lambda$为矢列, 树$T$为$\Gamma\vdash\Lambda$的证明树指: (见书本图片)
定义1.22
设$\Gamma\vdash\Lambda$为矢列, $\Gamma\vdash\Lambda$可证(provable)指存在$\Gamma\vdash\Lambda$的证明树
定理1.23($G’$的soundness)
若$\Gamma\vdash\Delta$在$G’$中可证, 则$\Gamma\vdash\Delta$有效
定理1.24($G’$的completeness)
若$\Gamma\vdash\Delta$有效, 则$\Gamma\vdash\Delta$在$G’$中可证. 这就是$G’$的完全性
系1.25
$\Gamma\vdash\Delta$可证$\textrm{ iff }$$\Gamma\vdash\Delta$有效
系1.26
若$\Gamma\vdash\Delta$在$G’$中可证, 则$\Gamma\vdash\Delta$在$G’$中由一个无$\textrm{Cut}$证明
定理1.27(compactness)
设$\Gamma$为命题的集合, 若$\Gamma$的任何有穷子集可满足, 则$\Gamma$可满足
定义1.3
设$A$, $B$为两个随机事件, 且$P(B)>0$, 称
$$P(A|B)=\frac{P(AB)}{P(B)}$$
为在事件$B$发生的条件下, 事件$A$发生的概率, 概率的性质仍适用
乘法公式
由条件概率公式可以得到, 当$P(B)>0$时,
$P(AB)=P(B)P(A|B)$
$P(AB)=P(A)P(B|A)$
推广:设$A_1,A_2,\cdots,A_n$为$n$个随机事件, 当$P(A_1,A_2,\cdots,A_n)>0$时,
$P(A_1A_2\cdots A_n)=P(A_1)P(A_2|A_1)P(A_3|A_1A_2)\cdots P(A_n|A_1A_2\cdots A_{n-1})$
$n$个事件独立性
对$n$个事件$A_1,A_2,\cdots,A_n$, 如果下列等式成立
$$\begin{cases}
P(A_iA_j)=P(A_i)P(A_j) \\
P(A_iA_jA_k)=P(A_i)P(A_j)P(A_k) \\
\cdots \cdots \\
P(A_{i_1}A_{i_2}\cdots A_{i_m})=P(A_{i_1})P(A_{i_2})\cdots P(A_{i_m})\\
\cdots \cdots \\
P(A_1A_2\cdots A_n) = P(A_1)P(A_2)\cdots P(A_n)
\end{cases}$$
则称事件$A_1,A_2,\cdots,A_n$相互独立
小概率事件原理
设随机试验中某事件$A$发生的概率为$p$, 无论$p$多么小, 只要不断重复独立地做$n$次实验, $A$迟早会发生的概率为1
$$P(A_1\cup A_2 \cup\cdots A_n)=1-(1-p)^n\to 1$$
设有$n$个独立工作的原件构成的系统, 第$i$个原件正常工作的事件记为$A_i$, 正常工作的概率$P(A_i)=p_i$, 系统正常工作的概率记为$B$
模n积: multiplication modulo n: $(ab)\%n$
Proposition 3.4
Let $\mathbb{Z}_n$ be the set of equivalence classes of the integers mod $n$ and $a$, $b$, $c$ $\in$ $\mathbb{Z}_n$.
$a+b \equiv b+a\quad(mod\ n)$
$a\times b \equiv b\times a\quad(mod\ n)$
$(a+b)+c \equiv a+(b+c)\quad(mod\ n)$
$(a\times b)\times c \equiv a\times (b\times c)\quad(mod\ n)$
$a+0 \equiv a\quad(mod\ n)$
$a\times1\equiv a\quad(mod\ n)$
$a\times(b+c)\equiv ab+ac\quad(mod\ n)$
$a+(-a)\equiv0\quad(mod\ n)$
$a\ne 0$ required.
$gcd(a,n)=1\Leftrightarrow \exists b$, $a\times b \equiv 1\quad (mod\ n)$
a one-to-one and onto map $\pi:S\to S$
a rearrangement of the figure preserving the arrangement of its sides and vertices as well as its distances and angles.
边布局、点布局、长度和角度均不变, [布局] 不考虑顶点标号的 [排列]
a map from the plane to itself preserving the symmetry.
不造成形变,到自身的映射,相当于重新分配点的标号
$A\to B, B\to C, A\to A$ is denoted as:
$$\begin{pmatrix}A & B & C \\ B & C & A\end{pmatrix}$$
similar to composing functions/maps
$f:G\times G\to G$
every $(a,b)\in G\times G$ is mapped to a unique element denoted as $a\circ b$ or $ab$
双射
$a\circ b$ or $ab$
a set $G$ together with a law of composition $(a,b)\mapsto a\circ b$ that satisfies the following 3 axioms:
- Associative
$\forall a,b,c\in G$, $(a\circ b)\circ c=a\circ(b\circ c)$- Identity Element
$\forall a\in G$, $\exists e\in G$, $e\circ a=a\circ e=a$- Inverse Element
$\forall a\in G$, $\exists a^{-1}$ that $a\circ a^{-1}=a^{-1}\circ a=e$
a group $(G,\circ )$ that $\forall a,b\in G$, $a\circ b=b\circ a$
describe a group in terms of an addition or multiplication table
类似乘法表的形式,将每对元素映射的结果记录在表中
A group is finite, or has finite order, if it contains a finite number of elements.
The order is $|G|=n$
Otherwise, the group is said to be infinite or to have infinite order.
The order is $|G|=\infty$
The set of all elements in $\mathbb{Z}_n$ that is relatively prime to $n$
Described in Section 3.1
The set of invertible matrices forms a group
只有可逆阵满足,群定义 [公理3]
$Q_8=\{\pm 1,\pm I,\pm J,\pm K\}$
$1=\begin{pmatrix}1 & 0 \\ 0 & 1\end{pmatrix}$, $I=\begin{pmatrix}0 & 1 \\ -1 & 0\end{pmatrix}$, $J=\begin{pmatrix}0 & i \\ i & 0\end{pmatrix}$, $K=\begin{pmatrix}i & 0 \\ 0 & -i\end{pmatrix}$
$I^2=J^2=K^2=-1$
$IJ=K$, $JK=I$, $KI=J$, $JI=-K$, $KJ=-I$, $IK=-J$
$$z^{-1}=\frac{a-bi}{a^2+b^2}$$
Proof:
$e=e’e=e’$
Proof:
$(g^{-1})=e(g^{-1})=(g^{-1})’g(g^{-1})=(g^{-1})’e=(g^{-1})’$
Proof:
$abb^{-1}a^{-1}=aea^{-1}=aa^{-1}=e$
$b^{-1}a^{-1}ab=b^{-1}eb=b^{-1}b=e$
Inverse is unique
Proof:
$(a^{-1})^{-1}=e(a^{-1})^{-1}=aa^{-1}(a^{-1})^{-1}=ae=a$
Proof:
$x_1=a^{-1}ax_1=a^{-1}ax_2=x_2$
$x_1=x_1aa^{-1}=x_2aa^{-1}=x_2$
Proof:
$ba=ca\Rightarrow baa^{-1}=caa^{-1}\Rightarrow b=c$
$ab=ac\Rightarrow a^{-1}ab=a^{-1}ac\Rightarrow b=c$
$g^0=e$
$g^n=g\cdot g\cdots g$(n times)
$g^{-n}=g^{-1}\cdot g^{-1}\cdots g^{-1}$(n times)
- $g^mg^n=g^{m+n}$, $\forall m,n\in\mathbb{Z}$
- $(g^m)^n=g^{mn}$, $\forall m,n\in\mathbb{Z}$
- $(gh)^n=(h^{-1}g^{-1})^{-n}$, $\forall n\in\mathbb{Z}$
- Only for abelian groups, $(gh)^n=g^nh^n$, $\forall n\in\mathbb{Z}$
A subset H of G such that when the group operation of G is restricted to H, H is a group in its own right.
元素为子集,二元操作不变,仍满足群公理
$H=\{e\}$
$H\ne G$
Proof:
- 1 is the identity element
- $(p/q)^{-1}=q/p$
- Multiplication is associative in both $\mathbb{Q}^$ and $\mathbb{R}^$
$SL_2(\mathbb{R})$ is a subgroup of $GL_2(\mathbb{R})$
$GL_2(\mathbb{R})$: general linear group.
$SL_2(\mathbb{R})$: special linear group, matrices of determinant 1.
Proof:
- $I_2$ is the identity element.
- $A=\begin{pmatrix}a & b \\ c & d\end{pmatrix}$, $A^{-1}=\begin{pmatrix}d & -b \\ -c & a\end{pmatrix}$
- Multiplication is associative.
- The product also has determinant 1, by $|AB|=|A||B|$.
$(\mathbb{M}{2\times 2},+)$ is a subset of but not a subgroup of $GL{2}$.
此处二元操作不同,因而不是子群
判断群是否同构,可判断子群的数量及各自的大小是否相同
Proposition 3.30 子群充要条件1
A subset H of G is a subgroup if and only if it satisfies the following conditions:
- The identity $e$ of $G$ is in $H$.
- If $h_1$, $h_2\in H$, then $h_1h_2\in H$.
- If $h\in H$, then $h^{-1}\in H$.
Proof:
$\Rightarrow$:
- $ee_H=e_H=e_He_H\Rightarrow e=e_H$
- $H$ is a group
- $H$ is a group, then $h(h^{-1})’=e$, $(h^{-1})’\in H$, also (h^{-1})’\in G$. By uniqueness of inverse, $(h^{-1})’=h^{-1}$.
$\Leftarrow$:
These conditions plus the associativity of the binary operation will prove that $H$ is a group.
Proposition 3.31 子群充要条件2
Let $H$ be a subset of a group $G$. Then $H$ is a subgroup of $G$ if and only if $H\ne \emptyset$, and whenever $g$, $h\in H$ then $gh^{−1}$ is in $H$.
Proof:
$\Rightarrow$:
$h\in H\Rightarrow h^{-1}\in H\Rightarrow gh^{-1}\in H$$\Leftarrow$:
- Let $g=h$, we have $e\in H$
- Let $g=h_1$, $h=h_2^{-1}$, we have $gh^{-1}=h_1(h_2^{-1})^{-1}=h_1h_2\in H$
- Let $g=e$, we have $h^{-1}\in H$
- By Proposition 3.30
$\langle a\rangle=\{a^k:k\in\mathbb{Z}\}$, $a\in G$
Theorem 4.3
$\langle a\rangle$ is a subgroup of $G$.
$\langle a\rangle$ is the smallest subgroup of $G$ that contains a.
Proof:
- $e=a^0\in \langle a\rangle$
- $g=a^m\in \langle a\rangle$,$h=a^n\in \langle a\rangle$, then $gh=a^{m+n}\in \langle a\rangle$
- $g=a^n\in \langle a\rangle$,then $g^{-1}=a^{-n}\in \langle a\rangle$
- Any subgroup $H$ containing $a$ must contain all powers of $a$, then $\langle a\rangle\subset H$, $\langle a\rangle$ is the smallest
$\exists a\in G$, $G=\langle a\rangle$
$a$ in $\langle a\rangle$
$a\in G$, the smallest positive integer $n$ that $a^n=e$
$|a|=n$
If there is no such $n$, $|a|=\infty$
Theorem 4.9
Every cyclic group is abelian.
Proof:
$g=a^r\in \langle a\rangle$,$h=a^s\in \langle a\rangle$, $gh=a^ra^s=a^{r+s}=a^{s+r}=a^sa^r=hg$
Theorem 4.10
Every subgroup of a cyclic group is cyclic.
Proof: (Brief Version)
Let $m$ be the smallest natural number such that $a^m\in H$. Such an $m$ exists by the Principle of Well-Ordering.
$h=a^m\in H$, we must show that every $h’\in H$ can be written as a power of $h$
$h’=a^k=a^{mq+r}=(a^m)^qa^r=h^qa^r\in H$, where $0\leq r<m$
$a^r=a^kh^{-q}$, then $a^r\in H$
$r=0$, because $m$ is the smallest positive integer that $a^m\in H$
$h’=h^q$
$H=\langle h\rangle$ is a cyclic group
The The subgroups of $\mathbb{Z}$ are exactly $n\mathbb{Z}$ for $n=1,2,\cdots$.
Proposition 4.12
Let $G$ be a cyclic group of order $n$ and suppose that $a$ is a generator for $G$. Then $a^k = e$ if and only if $n$ divides $k$.
Proof:
$\Rightarrow$:
$e=a^k=a^{nq+r}=a^{nq}a^r=ea^r=a^r$
$r=0$, $n$ divides $k$$\Leftarrow$:
$a^k=a^{ns}=(a^n)^s=e^s=e$
Theorem 4.13
Let G be a cyclic group of order n and suppose that $a\in G$ is a generator of the group. If $b=a^k$, then the order of $b$ is $n/d$, where $d = gcd(k,n)$.
Proof:
Suppose $e=b^m=a^{km}$
The order $m$ is the smallest integer $n$ that $n$ divides $km$
The smallest $km$ is $lcm(k,m)$, which is $kn/d$
Then $m=n/d$
The generators of $\mathbb{Z}_n$ are the integers r such that $1\leq r<n$ and $gcd(r,n) = 1$.
See the Group of Units of $\mathbb{Z}_n$
$\mathbb{C}=\{a+bi:a,b\in\mathbb{R}\}$
$a$ is Real Part 实部
$b$ is Imaginary Part 虚部
$z=a+bi$
$z^*=a-bi$
$|z|=\sqrt{a^2+b^2}$
$z=r(\cos\theta+i\sin\theta)=r\textrm{cis}(\theta)$
$r=|z|$
$z=r\textrm{cis}\theta$, $w=s\textrm{cis}\phi$
$zw=rs\textrm{cis}(\theta+\phi)$
Theorem 4.22 DeMoivre
$[r\textrm{cis}\theta]^n=r^n\textrm{cis}(n\theta)$
Proof:
Induction on n.
$\mathbb{T}=\{z\in\mathbb{C}:|z|=1\}$
The circle group is a subgroup of $\mathbb{C}$
The $z$ satisfying $z^n=1$
Theorem 4.25
The $n$-th roots of unity is $z=\textrm{cis}(\frac{2k\pi}{n})$
Proof:
$z^n=\textrm{cis}(2k\pi)=1$
A generator for the group of the nth roots of unity.
一直以来,总幻想着自已会时不时写点什么,让许多一闪而过的念头留下些许痕迹。然而,懒惰是强大的,一次次在键盘上打出的,只有WASD。
今天也许会变得不一样。