离散数学英文课件:DM_lecture3_8 Matrices
合集下载
离散数学课件(英文版)----Equivalence(II)
Ex. (x,y)R (y,z)R (x,z)R (x,x)R etc.
A1
A It is straight to prove that R is reflexible, symmetric and transitive, so, it is an equivalence relation.
Symmetry
Let A={1,2,3}, RAA {(1,1),(1,2),(1,3),(2,1),(3,1),(3,3)} symmetric. {(1,2),(2,3),(2,2),(3,1)} antisymmetric. {(1,2),(2,3),(3,1)} antisymmetric and asymmetric. {(11),(2,2)} symmetric and antisymmetric. symmetric and antisymmetric, and asymmetric!
• R is reflexive relation on A if and only if IAR
Visualized Reflexivity
A={a,b,c} a
1 0 0 1 1 1 MR 0 1 1
b
c
Symmetry
Relation R on A is Symmetric if whenever (a,b)R, then (b,a)R Antisymmetric if whenever (a,b)R and (b,a)R then a=b. Asymmetric if whenever (a,b)R then (b,a)R (Note: neither anti- nor a-symmetry is the negative of symmetry)
A1
A It is straight to prove that R is reflexible, symmetric and transitive, so, it is an equivalence relation.
Symmetry
Let A={1,2,3}, RAA {(1,1),(1,2),(1,3),(2,1),(3,1),(3,3)} symmetric. {(1,2),(2,3),(2,2),(3,1)} antisymmetric. {(1,2),(2,3),(3,1)} antisymmetric and asymmetric. {(11),(2,2)} symmetric and antisymmetric. symmetric and antisymmetric, and asymmetric!
• R is reflexive relation on A if and only if IAR
Visualized Reflexivity
A={a,b,c} a
1 0 0 1 1 1 MR 0 1 1
b
c
Symmetry
Relation R on A is Symmetric if whenever (a,b)R, then (b,a)R Antisymmetric if whenever (a,b)R and (b,a)R then a=b. Asymmetric if whenever (a,b)R then (b,a)R (Note: neither anti- nor a-symmetry is the negative of symmetry)
离散数学英文版PPT
g Policy
• • • • There is a midterm exam in week 7 or 8 There is a non-comprehensive final exam (week 15) There is a small programming in Visual Basic project Grading
Attendance Policy
• A student is expected to attend each class session on a regular and punctual basis • Students will be allowed to be late OR absent during the semester no more than three (3) times. Students who exceed these limits may be withdrawn from the course, or given an F grade
• Prerequisite: MATH 170 Calculus I and CSCI 185 Programming II • Description: An introduction to discrete structures with applications to computing problems. Topics include logic, sets, functions, relations, proof techniques and algorithmic analysis. Graph theory and trees may be studied as well
Homework Assignments or Exercises
• • • • There is a midterm exam in week 7 or 8 There is a non-comprehensive final exam (week 15) There is a small programming in Visual Basic project Grading
Attendance Policy
• A student is expected to attend each class session on a regular and punctual basis • Students will be allowed to be late OR absent during the semester no more than three (3) times. Students who exceed these limits may be withdrawn from the course, or given an F grade
• Prerequisite: MATH 170 Calculus I and CSCI 185 Programming II • Description: An introduction to discrete structures with applications to computing problems. Topics include logic, sets, functions, relations, proof techniques and algorithmic analysis. Graph theory and trees may be studied as well
Homework Assignments or Exercises
《离散数学概述》PPT课件
同 子代数 种
的 积代数 同
类 商代数 型
的 新代数系统
22
半群与群
广群 二元运算的封闭性
结合律
半群
交换律
交换半群
单位元 交换律
独异点
每个元素可逆 交换律
群
交换独异点 实例
Abel群
生成元
Klein群 循环群
有限个元素
有限群
编辑ppt
实例
n元置换群
23
图论
图论是离散数学的重要组成部分,是近代应用数学的重要分支。
由于在计算机内,机器字长总是有限的, 它代表离散的数或其
它离散对象,因此随着计算机科学和技术的迅猛发展,离散数
学就显得重要。
编辑ppt
5
离散数学的内容
数理逻辑: “证明”在计算科学的某些领域至关重要,构 造一个证明和写一个程序的思维过程在本质上是一样的。
组合分析:解决问题的一个重要方面就是计数或枚举对象。
编辑ppt
20
代数系统
近世代数,……,是关于运算的学说,是关于运算规则 的学说,但它不把自己局限在研究数的运算性质上,而 是企图研究一般性元素的运算性质。
——M.Klein
数学之所以重要,其中心原因在于它所提供的数学系统 的丰富多彩;此外的原因是,数学给出了一个系统,以 便于使用这些模型对物理现实和技术领域提出问题,回 答问题,并且也就探索了模型的行为。
1736年是图论历史元年,因为在这一年瑞士数学家欧拉(Euler) 发表了图论的首篇论文——《哥尼斯堡七桥问题无解》,所以人
们普遍认为欧拉是图论的创始人。
1936年,匈牙利数学家寇尼格(Konig)出版了图论的第一部专 著《有限图与无限图理论》,这是图论发展史上的重要的里程碑 ,它标志着图论将进入突飞猛进发展的新阶段。
离散数学英文课件:DM_lecture3_4_5 The Integers and Division
Hui Gao
Discrete Mathematics
2
Facts re: the Divides Relation
Theorem: a,b,c Z:
1. a|0 2. (a|b a|c) a | (b + c) 3. a|b a|bc 4. (a|b b|c) a|c
Proof of (2): a|b means there is an s such
1
Divides, Factor, Multiple
Let a,bZ with a0. Def.: a|b “a divides b” : (cZ: b=ac)
“There is an integer c such that c times a equals b.” Example: 312 True, but 37 False. Iff a divides b, then we say a is a factor or a divisor of b, and b is a multiple of a. Ex.: “b is even” :≡ 2|b.
So, the security of your day-to-day web transactions depends critically on the fact that all known factoring algorithms are intractable!
Hui Gao
Discrete Mathematics
Hui Gao
Discrete Mathematics
4
Fundamental Tpositive integer has a unique representation as the product of a nondecreasing series of zero or more primes.
离散数学(精选优秀)PPT
二、命题的表示法
1、命题标识符:表示命题的符号称为命题标识符。在数理逻辑中,使 用大写字母,或带下标的大写字母,或用方括号括起的数字表示命题。
例:P: 今天下雨。 “今天下雨”是一个命题,P是命题标识符。
它形成于七十年代初期,是一门新兴的工具性学科。
离散数学的应用
◆关系型数据库的设计(关系代数) ◆表达式解析(树) ◆编译技术、程序设计语言(代数结构) ◆人工智能、自动推理、机器证明(数理逻辑) ◆网络路由算法(图论) ◆游戏中的人工智能算法(图论、树、博弈论) ◆专家系统(集合论、数理逻辑—知识和推理规则的计算机表达) ◆软件工程—团队开发—时间和分工的优化(图论—网络、划分) ◆(各种)算法的构造、正确性的证明和效率的评估(离散数学的
第一章 命题逻辑
目标语言:就是表达判断的一些语言的汇集。 目标语言和一些符号公式构成了数理逻辑的形式 符号体系。
1-1 命题及其表示法
一、命题
1、定义 能表达判断的陈述句,称作命题(Proposition)。 例:判断下列语句是否为命题: (陈1)述地句球:外述存说在一智件事慧情生的物句。子,句末用句号。 (祈2)使1+句1:=要10求。或者希望别人做什么事或者不做什么事时用的 (句3)子今,天句下末雨用。句号或感叹号。 (疑4)问你句今:年提暑出假问去题的旅句行子吗,?句(末疑用问问号句。) (感5)叹克句里:特带岛有人浓说厚感:情“的克句里子特,岛句末人用是感说叹谎号话。者”。 悖(:相悖反论。)悖论:自相矛盾的陈述。
各分支)
教材
左孝凌,李为鉴,刘永才编著.离散数学.上海: 上海科学技术文献出版社,1982 主要参考教材: 孙吉贵,杨凤杰,欧阳丹彤,李占山编著.离散数 学.高等教育出版社,2002
离散数学lecture3
´q
Name Addition Simplification p qµ qµ p Conjunction Modus tollens
q p
´p
´p
qµ qµ qµ
´
´q
rµ q rµ
´p
r µ Hypothetical syllogism Disjunctive syllogism
´p
p p
´p
q
r
Resolution
批注本地保存成功开通会员云端永久保存去开通
Discrete Mathematics Thomas Honold Formal Proofs
Discrete Mathematics
Thomas Honold
Institute of Information and Communication Engineering Zhejiang University
Discrete Mathematics Thomas Honold Formal Proofs
Further Rules of Inference
Making the life a lot easier Rule p µ p q p q µ p p q µ p q q p q µ p p q q r µ p r p q p µ q p q p r µ q r Tautology p p p q p q
Discrete Mathematics Thomas Honold Formal Proofs
Introduction
Fermat’s Last Theorem (FLT)
There do not exist positive integers n x y z with n xn · yn zn 3 and
Name Addition Simplification p qµ qµ p Conjunction Modus tollens
q p
´p
´p
qµ qµ qµ
´
´q
rµ q rµ
´p
r µ Hypothetical syllogism Disjunctive syllogism
´p
p p
´p
q
r
Resolution
批注本地保存成功开通会员云端永久保存去开通
Discrete Mathematics Thomas Honold Formal Proofs
Discrete Mathematics
Thomas Honold
Institute of Information and Communication Engineering Zhejiang University
Discrete Mathematics Thomas Honold Formal Proofs
Further Rules of Inference
Making the life a lot easier Rule p µ p q p q µ p p q µ p q q p q µ p p q q r µ p r p q p µ q p q p r µ q r Tautology p p p q p q
Discrete Mathematics Thomas Honold Formal Proofs
Introduction
Fermat’s Last Theorem (FLT)
There do not exist positive integers n x y z with n xn · yn zn 3 and
离散数学课件(英文版)----Counting精选 课件
... <0,1> <1,1> <2,1> <3,1> ... <0,2> <1,2> <2,2> ... <0,3> <1,3>
Hale Waihona Puke <0,4><0,0>, <0,1>, <1,0>, <0,2>, <1,1>, <2,0>, <0,3>, ......
So, the set of rational numbers is countable.
as a sequence, { r1, r2, r3, ... } • (3) Assume, for example, that the decimal expansions of
the beginning of the sequence are as follows. r1 = 0 . 0 1 0 5 1 1 0 ... r2 = 0 . 4 1 3 2 0 4 3 ... r3 = 0 . 8 2 4 5 0 2 6 ... r4 = 0 . 2 3 3 0 1 2 6 ... r5 = 0 . 4 1 0 7 2 4 6 ... r6 = 0 . 9 9 3 7 8 3 8 ... r7 = 0 . 0 1 0 5 1 3 0 ...
– If the list goes on forever, it is infinite.
Proof of Countability
• The set of all integers is countable.
– We can arrange all integer in a linear list as follows: 0,-1,1,-2,2,-3,3,... that is: positive k is the (2k+1)th element, and negative k is the 2kth element in the list.
Hale Waihona Puke <0,4><0,0>, <0,1>, <1,0>, <0,2>, <1,1>, <2,0>, <0,3>, ......
So, the set of rational numbers is countable.
as a sequence, { r1, r2, r3, ... } • (3) Assume, for example, that the decimal expansions of
the beginning of the sequence are as follows. r1 = 0 . 0 1 0 5 1 1 0 ... r2 = 0 . 4 1 3 2 0 4 3 ... r3 = 0 . 8 2 4 5 0 2 6 ... r4 = 0 . 2 3 3 0 1 2 6 ... r5 = 0 . 4 1 0 7 2 4 6 ... r6 = 0 . 9 9 3 7 8 3 8 ... r7 = 0 . 0 1 0 5 1 3 0 ...
– If the list goes on forever, it is infinite.
Proof of Countability
• The set of all integers is countable.
– We can arrange all integer in a linear list as follows: 0,-1,1,-2,2,-3,3,... that is: positive k is the (2k+1)th element, and negative k is the 2kth element in the list.
精品课程《离散数学》PPT课件(全)
言1
为什么学习离散数学?
离散数学是现代数学的一个重要分支,是计算机科学与技术 的理论基础,所以又称为计算机数学,是计算机科学与技术 专业的核心、骨干课程。
它以研究离散量的结构和相互间的关系为主要目标,其研 究对象一般是有限个或可数个元素,因此它充分描述了计算 机科学离散性的特点。
离散数学是什么课?
真值为1
25
1.1 命题符号化及联结词
以下命题中出现的a是给定的一个正整数: (3) 只有 a能被2整除, a才能被4整除。
(4) 只有 a能被4整除, a才能被2整除。
解: 令r: a能被4整除, s: a能被2整除。 真值不确定 (3)符号化为 s r (4)符号化为 r s
真值为1
26
19
1.1 命题符号化及联结词
3.析取词 设p,q为二命题,复合命题“p或q” 称为p与q的析取式,记作p ∨ q,符号∨称 为析取联结词。 运算规则:
p 0 0 1 1 q 0 1 0 1 p∨q 0 1 1 1
20
1.1 命题符号化及联结词
析取运算特点:只有参与运算的二命题全为假时,运算结果才 为假,否则为真。 相容或:二者至少有一个发生,也可二者都发生 排斥或:二者只有一个发生,即非此即彼 例如: (1)小王爱打球或爱跑步。 设p:小王爱打球。 q:小王爱跑步。 则上述命题可符号化为:p ∨ q (2)张晓静是江西人或湖南人。 设p:江西人。 q:湖南人。 则上述命题就不可简单符号化为:p ∨ q 而应描述为(p∧ q) ∨( p∧q)(也可用异或联接词∨)
(1)星期天天气好,带儿子去了动物园; (2)星期天天气好,却没带儿子去动物园; (3)星期天天气不好,却带儿子去了动物园; (4)星期天天气不好,没带儿子去动物园。
离散数学课件(英文版)----Semigroup
离散数学课件英文版semigroup离散数学课件离散数学离散数学及其应用离散数学符号离散数学复习资料离散数学试题离散数学pdf离散数学吧离散数学知识点总结离散数学重点
ห้องสมุดไป่ตู้Algebraic Systems and Groups
Lecture 13 Discrete Mathematical Structures
If “” is associative, then x1x2x3… xn can be computed by any order of among the (n-1) operations, with the constraint that the order of all operands are not changed.
If S has a left identity and a right identity as well, then they must be equal, and this element is also an identity of the system: e l = e l e r= e r If existing, the identity of an algebraic system is unique: e 1= e 1e 2= e 2
Association
What a pity!
Semigroup
Axiom of semigroup
– Association
An example ({1,2},*), * defined as follows:
For any x,y∈{1,2}, x*y=y Proof: it should be proved that for any x,y,z in {1,2}, (x*y)*z = x* (y*z)
ห้องสมุดไป่ตู้Algebraic Systems and Groups
Lecture 13 Discrete Mathematical Structures
If “” is associative, then x1x2x3… xn can be computed by any order of among the (n-1) operations, with the constraint that the order of all operands are not changed.
If S has a left identity and a right identity as well, then they must be equal, and this element is also an identity of the system: e l = e l e r= e r If existing, the identity of an algebraic system is unique: e 1= e 1e 2= e 2
Association
What a pity!
Semigroup
Axiom of semigroup
– Association
An example ({1,2},*), * defined as follows:
For any x,y∈{1,2}, x*y=y Proof: it should be proved that for any x,y,z in {1,2}, (x*y)*z = x* (y*z)
离散数学课件(英文版)----Function
Try to prove it What is ({<x,y>|x,y∈R, y=x+1})? R×{-1}
x-y>,
:N×N→N, (<x,y>) = | x2-y2|
(N×{0}) ={ n2|n∈N}, -1({0}) ={<n,n>|n∈N}
Characteristic Function of Set
A’ B’ B A
f
Special Types of Functions
Surjection
:A→B is a surjection or “onto” iff. Ran()=B, iff. y∈B, x∈A, such that f(x)=y
Injection (one-to-one)
:A→B is one-to-one iff. y∈Ran(f), there is at most one x∈A, such that f(x)=y iff. x1,x2∈A, if x1≠x2, then (x1) ≠(x2) iff. x1,x2∈A, if (x1) =(x2),then x1=x2
Note: if <x,y>∈f, then <x,y>∈f and <x,x>∈1A if <x,y>∈ f °1A,则<t,y>∈ f , 且<x,t>∈1A, 则t=x, 所以<x,y>∈f .
Invertible Function
The inverse relation of f :A→B is not necessarily a function, even though f is.
If |A|>|B| then 0 else |A|!*|A|C|B|
x-y>,
:N×N→N, (<x,y>) = | x2-y2|
(N×{0}) ={ n2|n∈N}, -1({0}) ={<n,n>|n∈N}
Characteristic Function of Set
A’ B’ B A
f
Special Types of Functions
Surjection
:A→B is a surjection or “onto” iff. Ran()=B, iff. y∈B, x∈A, such that f(x)=y
Injection (one-to-one)
:A→B is one-to-one iff. y∈Ran(f), there is at most one x∈A, such that f(x)=y iff. x1,x2∈A, if x1≠x2, then (x1) ≠(x2) iff. x1,x2∈A, if (x1) =(x2),then x1=x2
Note: if <x,y>∈f, then <x,y>∈f and <x,x>∈1A if <x,y>∈ f °1A,则<t,y>∈ f , 且<x,t>∈1A, 则t=x, 所以<x,y>∈f .
Invertible Function
The inverse relation of f :A→B is not necessarily a function, even though f is.
If |A|>|B| then 0 else |A|!*|A|C|B|
离散数学课件(英文版)----Graph
A D C A D
C
B
B
Graph and Diagram
Graph G is a triple: G =〈VG, EG, 〉
VG and EG are sets,satisgying VGEG=φ, :EG {{vi, vj}| vi, vj∈VG} Note: {vi, vj}={vj, vi} A graph can be represented conveniently by some diagram: : each element of VG as a dot, the vertex, and each element of EG as a line segment, the edge, between vertices. So, VG is called the set of vertices, and EG, the set of edges.
i i =1
The number of vertices with odd degree must be even.
Complete Graph
A graph is a complete graph if and only if any two of its vertices are adjacent.
Subgraph
Let G=<V,E>, G’=<V’,E’>, if V’V, E’E, then G’is called a subgraph of G. If V’V, or E’E, then G’ is a proper subgraph. If V’=V, then G’ is a spanning subgraph.
Determination of Euler Graph
C
B
B
Graph and Diagram
Graph G is a triple: G =〈VG, EG, 〉
VG and EG are sets,satisgying VGEG=φ, :EG {{vi, vj}| vi, vj∈VG} Note: {vi, vj}={vj, vi} A graph can be represented conveniently by some diagram: : each element of VG as a dot, the vertex, and each element of EG as a line segment, the edge, between vertices. So, VG is called the set of vertices, and EG, the set of edges.
i i =1
The number of vertices with odd degree must be even.
Complete Graph
A graph is a complete graph if and only if any two of its vertices are adjacent.
Subgraph
Let G=<V,E>, G’=<V’,E’>, if V’V, E’E, then G’is called a subgraph of G. If V’V, or E’E, then G’ is a proper subgraph. If V’=V, then G’ is a spanning subgraph.
Determination of Euler Graph
离散数学课件ppt
随机性与概率
随机性表示试验结果的不 确定性,概率则表示随机 事件发生的可能性大小。
统计数据的收集和整理
数据来源
数据质量
数据可以来源于调查、实验、观测、 查阅文献等多种途径。
数据质量包括数据的准确性、可靠性 、完整性等方面,是数据分析的前提 和基础。
数据整理
数据整理包括数据的分类、排序、分 组、编码等步骤,以便更好地进行数 据分析。
必然事件
概率值为1的事件。
03
04
不可能事件
概率值为0的事件。
互斥事件
两个或多个事件不能同时发生 。
概率的加法原理和乘法原理
加法原理
对于任意两个互斥事件A和B,有 P(A∪B)=P(A)+P(B)。
乘法原理
对于任意两个事件A和B,有 P(A∩B)=P(A)×P(B|A)。
条件概率和独立性
要点一
条件概率
离散数学课件
目录 CONTENTS
• 离散数学简介 • 集合论基础 • 图论基础 • 离散概率论基础 • 离散统计学基础 • 离散数学中的问题求解方法
01
离散数学简介
离散数学的起源
19世纪初
集合论的提出为离散数学的起源 奠定了基础。
20世纪中叶
随着计算机科学的兴起,离散数 学逐渐受到重视和应用。
子集、超集和补集
总结词
子集、超集和补集是集合论中的重要概念,它们描述了集合之间的关系。
详细描述
子集是指一个集合中的所有元素都属于另一个集合,超集是指一个集合包含另一 个集合的所有元素,补集是指属于某个集合但不属于其子集的元素组成的集合。
集合的运算性质
总结词
集合的运算性质包括并集、交集、差集等,这些运算描述了 集合之间的组合关系。
离散数学引言ppt课件
离散数学
总学时: 56 理论学时:50
严格执行突发事件上报制度、校外活 动报批 制度等 相关规 章制度 。做到 及时发 现、制 止、汇 报并处 理各类 违纪行 为或突 发事件 。
绪论内容目录
• 离散数学概述 • 离散数学研究内容 • 教学内容 • 教材及参考书目
严格执行突发事件上报制度、校外活 动报批 制度等 相关规 章制度 。做到 及时发 现、制 止、汇 报并处 理各类 违纪行 为或突 发事件 。
– 耿素云,离散数学,高等教育出版社 – 参考书目 – 王遇科,离散数学,北京理工大学出版
社 – 离散数学,王孝喜等译,电子工业出版
社
– Discrete Mathematical Structures, Bernard Kolman, Robert C.Busby, Sharon Ross, Prentice Hall Inc.
严格执行突发事件上报制度、校外活 动报批 制度等 相关规 章制度 。做到 及时发 现、制 止、汇 报并处 理各类 违纪行 为或突 发事件 。
• 图论
___对于解决许多实际问题很有用处,对于 学习数据结构、编译原理课程也很有帮助。 要求掌握有关图、树的基本概念,以及如 何将图论用于实际问题的解决,并培养其 使用数学工具建立模型的思维方式。
数理逻辑 齐人固善盗乎?
___<<晏子春秋 内篇杂下第六>>
论辩中的复杂问语
___<<哲学演讲录>>(二)中曾叙述了一个 复杂问语:
梅内德谟:你已停止打你父亲,是吗?
严格执行突发事件上报制度、校外活 动报批 制度等 相关规 章制度 。做到 及时发 现、制 止、汇 报并处 理各类 违纪行 为或突 发事件 。
总学时: 56 理论学时:50
严格执行突发事件上报制度、校外活 动报批 制度等 相关规 章制度 。做到 及时发 现、制 止、汇 报并处 理各类 违纪行 为或突 发事件 。
绪论内容目录
• 离散数学概述 • 离散数学研究内容 • 教学内容 • 教材及参考书目
严格执行突发事件上报制度、校外活 动报批 制度等 相关规 章制度 。做到 及时发 现、制 止、汇 报并处 理各类 违纪行 为或突 发事件 。
– 耿素云,离散数学,高等教育出版社 – 参考书目 – 王遇科,离散数学,北京理工大学出版
社 – 离散数学,王孝喜等译,电子工业出版
社
– Discrete Mathematical Structures, Bernard Kolman, Robert C.Busby, Sharon Ross, Prentice Hall Inc.
严格执行突发事件上报制度、校外活 动报批 制度等 相关规 章制度 。做到 及时发 现、制 止、汇 报并处 理各类 违纪行 为或突 发事件 。
• 图论
___对于解决许多实际问题很有用处,对于 学习数据结构、编译原理课程也很有帮助。 要求掌握有关图、树的基本概念,以及如 何将图论用于实际问题的解决,并培养其 使用数学工具建立模型的思维方式。
数理逻辑 齐人固善盗乎?
___<<晏子春秋 内篇杂下第六>>
论辩中的复杂问语
___<<哲学演讲录>>(二)中曾叙述了一个 复杂问语:
梅内德谟:你已停止打你父亲,是吗?
严格执行突发事件上报制度、校外活 动报批 制度等 相关规 章制度 。做到 及时发 现、制 止、汇 报并处 理各类 违纪行 为或突 发事件 。
离散数学英文课件:DM_lecture3_3 Algorithmic Complexity
§3.3: Algorithmic Complexity
The algorithmic complexity of a computation is a measure of how difficult it is to perform the computation.
Some of the most common complexity measures: “Time” complexity: # of operations or steps required to solve a problem of size n. “Space” complexity: # of memory bits required to solve a problem of size n.
Hui Gao
Discrete Mathematics
2
Best、Worst and Average case
Efficiency may depend on the form of input: Best case: minimum over inputs of n Worst case: maximum over inputs of n
probability distribution of all possible inputs
Hui Gao
Discrete Mathematics
3
Complexity & Orders of Growth
Suppose algorithm A has worst-case time complexity f(n) for inputs of length n, while algorithm B (for the same task) takes time g(n).
The algorithmic complexity of a computation is a measure of how difficult it is to perform the computation.
Some of the most common complexity measures: “Time” complexity: # of operations or steps required to solve a problem of size n. “Space” complexity: # of memory bits required to solve a problem of size n.
Hui Gao
Discrete Mathematics
2
Best、Worst and Average case
Efficiency may depend on the form of input: Best case: minimum over inputs of n Worst case: maximum over inputs of n
probability distribution of all possible inputs
Hui Gao
Discrete Mathematics
3
Complexity & Orders of Growth
Suppose algorithm A has worst-case time complexity f(n) for inputs of length n, while algorithm B (for the same task) takes time g(n).
离散数学课件----Trees
Any ordered tree can be converted into a ordered binary tree.
1
1
2
5 9 6
3
7
4
2
3
4 7 11 8
8
5 9
6
10
11 12
10
12
Computer Representation
1
S
8
(3-(2x))+((x-2)-(3+x)) as a doubly linked list
No Edge Can Be Removed
Let T is an undirected tree, e is any edge in T, then T-{e} is no longer connected.
Proof: We have know that for any vertices v,w, there is a unique vw-path. Let e=(x,y), then e is the unique path between x and y. So, there is no xypath in T-{e}, which means that T-{e} is no longer connected.
12 14
3 arrays:
LEFT DATA RIGHT
2
+
-
+
x
13
3
5 3
6
7
9
x
11
2
4
3
2
10
x
Tree Searching
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
8
Matrix Inverses
For some (but not all) square matrices A, there exists a unique multiplicative inverse A−1 of A, a matrix such that A−1A = In.
If the inverse exists, it is unique, and A−1A = AA−1.
Computing Many, many more…
Hui Gao
Discrete Mathematics
2
Matrix Equality
Two matrices A and B are considered equal iff they have the same number of rows, the same number of columns, and all their corresponding elements are equal.
§3.8 Matrices
A matrix is a rectangular array of objects (usually numbers).
An mn (“m by n”) matrix has exactly m
horizontal rows, and n vertical columns.
upper-left to lower-right diagonal, and
0’s everywhere else. j ]
1 if 0 if
Kronecker Delta
i i
j j
0 0
1 0
0 1
n
n
Hui Gao
Discrete Mathematics
right. Elements are indexed by row, then
column.
a1,1 a1,2 a1,n
A
[ai,
j
]
a2,1
a2,2
a2,n
am,1
am,2
am,n
Hui Gao
Discrete Mathematics
4
Matrix Sums
The sum A+B of two matrices A, B (which must have the same number of rows, and the same number of columns) is the matrix (also with the same shape) given by adding corresponding elements of A and B.
Plural of matrix = matrices
2 3
5
1
a 32 matrix
7 0
An nn matrix is called a square matrix,
whose order or rank is n.
Hui Gao
Discrete Mathematics
1
Applications of Matrices
1
3
2 1
0 0
2 3
0 1
1 3
0 2
5 11
1
3
[ci,
j
]
k 1
ai,b,
j
Hui Gao
Discrete Mathematics
7
Identity Matrices
The identity matrix of order n, In, is the rank-n square matrix with 1’s along the
A+B = [ai,j+bi,j]
2 6 9 3 11 9 0 8 11 3 11 5
Hui Gao
Discrete Mathematics
5
Matrix Products
For an mk matrix A and a kn matrix B, the product AB is the mn matrix:
for i := 1 to m
(m)
for j := 1 to n begin (n)
What’s the of its time complexity?
Note: Matrix multiplication is not commutative!
Hui Gao
Discrete Mathematics
6
Matrix Product Example
An example of matrix multiplication:
0 1 1 0
0 1 2 0
3 1
2 6
3 1
2 6
0 0
Hui Gao
Discrete Mathematics
3
Row and Column Order
The rows in a matrix are usually indexed
1 to m from top to bottom. The columns
are usually indexed 1 to n from left to
k
AB C [ci, j ] ai,b, j
1
i.e., the element of AB indexed (i,j) is given by the vector dot product of the ith row of A and the jth column of B (considered as vectors).
Tons of applications, including: Solving systems of linear equations Computer Graphics, Image Processing Models within many areas of
Computational Science & Engineering Quantum Mechanics, Quantum
We won’t go into the algorithms for matrix inversion...
Hui Gao
Discrete Mathematics
9
Matrix Multiplication Algorithm
procedure matmul(matrices A: mk, B: kn)