离散数学试题及答案

合集下载

离散数学试题及答案

离散数学试题及答案

离散数学试题及答案一、选择题1. 设A、B、C为三个集合,下列哪个式子是成立的?A) \(A \cup (B \cap C) = (A \cup B) \cap (A \cup C)\)B) \(A \cap (B \cup C) = (A \cap B) \cup (A \cap C)\)C) \(A \cup (B \cup C) = (A \cup B) \cup (A \cup C)\)答案:B2. 对于一个有n个元素的集合S,S的幂集中包含多少个元素?A) \(n\)B) \(2^n\)C) \(2 \times n\)答案:B二、判断题1. 对于两个关系R和S,若S是自反的,则R ∩ S也是自反的。

答案:错误2. 若一个关系R是反对称的,则R一定是反自反的。

答案:正确三、填空题1. 有一个集合A,其中包含元素1、2、3、4和5,求集合A的幂集的大小。

答案:322. 设a和b是实数,若a \(\neq\) b,则a和b之间的关系是\(\__\_\)关系。

答案:不等四、解答题1. 证明:如果关系R是自反且传递的,则R一定是反自反的。

解答:假设关系R是自反的且传递的,即对于集合A中的任意元素x,都有(x, x) ∈ R,并且当(x, y) ∈ R和(y, z) ∈ R时,(x, z) ∈ R。

反证法:假设R不是反自反的,即存在一个元素a∈A,使得(a, a) ∉ R。

由于R是自反的,所以(a, a) ∈ R,与假设矛盾。

因此,R一定是反自反的。

答案完整证明了该结论。

2. 已知集合A={1, 2, 3},集合B={2, 3, 4},求集合A和B的笛卡尔积。

解答:集合A和B的笛卡尔积定义为{(a, b) | a∈A,b∈B}。

所以,集合A和B的笛卡尔积为{(1, 2), (1, 3), (1, 4), (2, 2), (2, 3), (2, 4), (3, 2), (3, 3), (3, 4)}。

离散数学试题与参考答案

离散数学试题与参考答案

离散数学试题与参考答案(总4页)--本页仅作为文档封面,使用时请直接删除即可----内页可以根据需求调整合适字体及大小--《离散数学》试题及答案一、选择题:本题共5小题,每小题3分,共15分,在每小题给出的四个选项中,只有一项是符合题目要求的。

1. 命题公式Q Q P →∨)(为 ( )(A) 矛盾式 (B) 可满足式 (C) 重言式 (D) 合取范式2.设P 表示“天下大雨”, Q 表示“他在室内运动”,则命题“除非天下大雨,否则他不在室内运动”符号化为( )。

(A). P Q →; (B).P Q ∧; (C).P Q ⌝→⌝; (D).P Q ⌝∨.3.设集合A ={{1,2,3}, {4,5}, {6,7,8}},则下式为真的是( ) (A) 1A (B) {1,2, 3}A (C) {{4,5}}A (D) A4. 设A ={1,2},B ={a ,b ,c },C ={c ,d }, 则A ×(B C )= ( )(A) {<1,c >,<2,c >} (B) {<c ,1>,<2,c >} (C) {<c ,1><c ,2>,} (D) {<1,c >,<c ,2>} 5. 设G 如右图:那么G 不是( ). (A)哈密顿图; (B)完全图;(C)欧拉图; (D) 平面图.二、填空题:本大题共5小题,每小题4分,共20分。

把答案填在对应题号后的横线上。

6. 设集合A ={,{a }},则A 的幂集P (A )=7. 设集合A ={1,2,3,4 }, B ={6,8,12}, A 到B 的关系R =},,2,{B y A x x y y x ∈∈=><, 那么R -1=8. 在“同学,老乡,亲戚,朋友”四个关系中_______是等价关系. 9. 写出一个不含“→”的逻辑联结词的完备集 . 10.设X ={a ,b ,c },R 是X 上的二元关系,其关系矩阵为M R =⎥⎥⎥⎦⎤⎢⎢⎢⎣⎡001001101,那么R 的关系图为三、证明题(共30分)11. (10分)已知A 、B 、C 是三个集合,证明A ∩(B ∪C)=(A ∩B)∪(A ∩C) 12. (10分)构造证明:(P (Q S))∧(R ∨P)∧Q R S13.(10分)证明(0,1)与[0,1),[0,1)与[0,1]等势。

离散数学练习题(含答案)

离散数学练习题(含答案)

离散数学试题第一部分选择题一、单项选择题1.下列是两个命题变元p,q的小项是( C )A.p∧┐p∧q B.┐p∨qC.┐p∧q D.┐p∨p∨q2.令p:今天下雪了,q:路滑,则命题“虽然今天下雪了,但是路不滑”可符号化为( D )A.p→┐q B.p∨┐qC.p∧q D.p∧┐q3.下列语句中是命题的只有( A )A.1+1=10 B.x+y=10C.sinx+siny<0 D.x mod 3=24.下列等值式不正确的是( C )A.┐(∀x)A⇔(∃x)┐AB.(∀x)(B→A(x))⇔B→(∀x)A(x)C.(∃x)(A(x)∧B(x))⇔(∃x)A(x)∧(∃x)B(x)D.(∀x)(∀y)(A(x)→B(y))⇔(∀x)A(x)→(∀y)B(y)5.谓词公式(∃x)P(x,y)∧(∀x)(Q(x,z)→(∃x)(∀y)R(x,y,z)中量词∀x的辖域是( C )A.(∀x)Q(x,z)→(∃x)(∀y)R(x,y,z))B.Q(x,z)→(∀y)R(x,y,z)C.Q(x,z)→(∃x)(∀y)R(x,y,z)D.Q(x,z)6.设A={a,b,c,d},A上的等价关系R={<a,b>,<b,a>,<c,d>,<d,c>}∪I A,则对应于R的A的划分是( D )A.{{a},{b,c},{d}} B.{{a,b},{c},{d}}C.{{a},{b},{c},{d}} D.{{a,b},{c,d}}7.设A={Ø},B=P(P(A)),以下正确的式子是( A )A.{Ø,{Ø}}∈B B.{{Ø,Ø}}∈BC.{{Ø},{{Ø}}}∈B D.{Ø,{{Ø}}}∈B8.设X,Y,Z是集合,一是集合相对补运算,下列等式不正确的是( A )A.(X-Y)-Z=X-(Y∩Z)B.(X-Y)-Z=(X-Z)-YC.(X-Y)-Z=(X-Z)-(Y-Z)D.(X-Y)-Z=X-(Y∪Z)9.在自然数集N上,下列定义的运算中不可结合的只有( D )A.a*b=min(a,b)B.a*b=a+bC.a*b=GCD(a,b)(a,b的最大公约数)02324# 离散数学试题第1 页共4页02324# 离散数学试题 第 2 页 共4页D .a*b=a(mod b)10.设R 和S 是集合A 上的关系,R ∩S 必为反对称关系的是( A ) A .当R 是偏序关系,S 是等价关系; B .当R 和S 都是自反关系; C .当R 和S 都是等价关系; D .当R 和S 都是传递关系11.设R 是A 上的二元关系,且R ·R ⊆R,可以肯定R 应是( D ) A .对称关系; B .全序关系; C .自反关系; D .传递关系 12.设R 为实数集,函数f :R →R ,f(x)=2x ,则f 是( B ) A .满射函数 B .单射函数 C .双射函数 D .非单射非满射第二部分 非选择题二、填空题1.设论域是{a,b,c},则(∀x)S(x)等价于命题公式 S(a)∧S(b)∧S(c) ;(x ∃)S(x)等价于命题公式 S(a)∨S(b) ∨S(c) 。

(完整版)离散数学试题及答案,推荐文档

(完整版)离散数学试题及答案,推荐文档

11 设 A,B,R 是三个集合,其中 R 是实数集,A = {x | -1≤x≤1, xR}, B = {x | 0≤x < 2, xR},则
A-B = __________________________ , B-A = __________________________ ,
A∩B = __________________________ , . 13. 设集合 A={2, 3, 4, 5, 6},R 是 A 上的整除,则 R 以集合形式(列举法)记为___________ _______________________________________________________. 14. 设一阶逻辑公式 G = xP(x)xQ(x),则 G 的前束范式是__________________________
二、选择题
1. C. 2. D. 3. B. 4. B.
5. D. 6. C. 7. C.
8. A. 9. D. 10. B. 11. B.
第 5 页 共 18 页
13. {(2, 2),(2, 4),(2, 6),(3, 3),(3, 6),(4, 4),(5, 5),(6, 6)}.
14. x(P(x)∨Q(x)). 15. 21.
16. (R(a)∧R(b))→(S(a)∨S(b)). 17. {(1, 3),(2, 2)}; {(1, 1),(1, 2),(1, 3)}.
8. 设命题公式 G=(P(QR)),则使公式 G 为真的解释有
__________________________,_____________________________,
__________________________.

离散数学习题集(十五套) - 答案

离散数学习题集(十五套) - 答案

离散数学试题与答案试卷一一、填空 20% (每小题2分)1.设 }7|{)},5()(|{<∈=<∈=+x E x x B x N x x A 且且(N :自然数集,E + 正偶数) 则 =⋃B A 。

2.A ,B ,C 表示三个集合,文图中阴影部分的集合表达式为 。

3.设P ,Q 的真值为0,R ,S 的真值为1,则 )()))(((S R P R Q P ⌝∨→⌝∧→∨⌝的真值= 。

4.公式P R S R P ⌝∨∧∨∧)()(的主合取范式为。

5.若解释I 的论域D 仅包含一个元素,则 )()(x xP x xP ∀→∃ 在I 下真值为。

6.设A={1,2,3,4},A 上关系图为则 R 2 = 。

7.设A={a ,b ,c ,d},其上偏序关系R 的哈斯图为则 R= 。

8.图的补图为 。

9.设A={a ,b ,c ,d} ,A 上二元运算如下:* a b c dA BCa b cda b c db c d ac d a bd a b c那么代数系统<A,*>的幺元是,有逆元的元素为,它们的逆元分别为。

10.下图所示的偏序集中,是格的为。

二、选择20% (每小题2分)1、下列是真命题的有()A.}}{{}{aa⊆;B.}}{,{}}{{ΦΦ∈Φ;C.}},{{ΦΦ∈Φ;D.}}{{}{Φ∈Φ。

2、下列集合中相等的有()A.{4,3}Φ⋃;B.{Φ,3,4};C.{4,Φ,3,3};D.{3,4}。

3、设A={1,2,3},则A上的二元关系有()个。

A.23 ;B.32 ;C.332⨯;D.223⨯。

4、设R,S是集合A上的关系,则下列说法正确的是()A.若R,S 是自反的,则SR 是自反的;B.若R,S 是反自反的,则SR 是反自反的;C.若R,S 是对称的,则SR 是对称的;D.若R,S 是传递的,则SR 是传递的。

5、设A={1,2,3,4},P(A)(A的幂集)上规定二元系如下|}||(|)(,|,{tsApt st sR=∧∈><=则P(A)/ R=()A.A ;B.P(A) ;C.{{{1}},{{1,2}},{{1,2,3}},{{1,2,3,4}}};D.{{Φ},{2},{2,3},{{2,3,4}},{A}}6、设A={Φ,{1},{1,3},{1,2,3}}则A上包含关系“⊆”的哈斯图为()7、下列函数是双射的为()A.f : I→E , f (x) = 2x ;B.f : N→N⨯N, f (n) = <n , n+1> ;C.f : R→I , f (x) = [x] ;D.f :I→N, f (x) = | x | 。

离散数学练习题(含答案)

离散数学练习题(含答案)

离散数学练习题(含答案)离散数学试题第一部分选择题1.下列命题变元p,q的小项是(C)。

A。

p∧┐p∧qB。

┐p∨qC。

┐p∧qD。

┐p∨p∨q2.命题“虽然今天下雪了,但是路不滑”可符号化为(D)。

A。

p→┐qB。

p∨┐qC。

p∧qD。

p∧┐q3.只有语句“1+1=10”是命题(A)。

A。

1+1=10B。

x+y=10___<0D。

x mod 3=24.下列等值式不正确的是(C)。

A。

┐(x)A(x)┐AB。

(x)(B→A(x))B→(x)A(x)C。

(x)(A(x)∧B(x))(x)A(x)∧(x)B(x)D。

(x)(y)(A(x)→B(y))(x)A(x)→(y)B(y) 5.量词x的辖域是“Q(x,z)→(x)(y)R(x,y,z)”(C)。

A。

(x)Q(x,z)→(x)(y)R(x,y,z))B。

Q(x,z)→(y)R(x,y,z)C。

Q(x,z)→(x)(y)R(x,y,z)D。

Q(x,z)6.设A={a,b,c,d},A上的等价关系R={。

}∪IA则对应于R的A的划分是(D)。

A。

{{a},{b,c},{d}}B。

{{a,b},{c},{d}}C。

{{a},{b},{c},{d}}D。

{{a,b},{c,d}}7.设A={Ø},B=P(P(A)),以下正确的式子是(A)。

A。

{Ø,{Ø}}∈BB。

{{Ø,Ø}}∈BC。

{{Ø},{{Ø}}}∈BD。

{Ø,{{Ø}}}∈B8.集合相对补运算中,不正确的等式是(A)。

A。

(X-Y)-Z=X-(Y∩Z)B。

(X-Y)-Z=(X-Z)-YC。

(X-Y)-Z=(X-Z)-(Y-Z)D。

(X-Y)-Z=X-(Y∪Z)9.在自然数集N上,不可结合的定义的运算是(D)。

A。

a*b=min(a,b)B。

a*b=a+bC。

a*b=GCD(a,b) (a,b的最大公约数)D。

电大离散数学本科试题及答案

电大离散数学本科试题及答案

电大离散数学本科试题及答案一、选择题(每题3分,共30分)1. 在离散数学中,下列哪个概念是用来描述两个集合之间元素的一一对应关系?A. 并集B. 交集C. 笛卡尔积D. 子集答案:D2. 命题逻辑中,德摩根定律描述的是哪种命题的否定形式?A. 合取命题B. 析取命题C. 条件命题D. 生成命题答案:B3. 在图论中,一个没有自环且任意两个顶点之间至多只有一条边的图被称为:A. 有向图B. 无向图C. 完全图D. 树答案:B4. 以下哪个算法用于判断一个命题逻辑表达式的真值表是否存在矛盾?A. 归并排序B. 快速排序C. 归约子句法D. 拓扑排序答案:C5. 集合{1, 2, 3}的幂集含有多少个元素?A. 4B. 6C. 8D. 16答案:C6. 在关系数据库中,一个关系模式的候选键是:A. 能唯一标识元组的属性集合B. 可以为空的属性C. 必须包含所有属性的超键D. 必须包含所有属性的候选键答案:A7. 以下哪个是离散数学中归纳证明的步骤?A. 基础步骤B. 归纳假设C. 归纳步骤D. 所有以上答案:D8. 在命题逻辑中,一个命题函数是:A. 仅包含逻辑运算符的表达式B. 可以取真假值的表达式C. 包含变量和逻辑运算符的表达式D. 仅包含逻辑运算符和变量的表达式答案:C9. 一个布尔代数中的幺元是指:A. 恒等元B. 恒真元C. 恒假元D. 单位元答案:D10. 在有限自动机中,状态的转移是由:A. 输入符号决定B. 当前状态和输入符号决定C. 输出符号决定D. 状态本身决定答案:B二、填空题(每题2分,共20分)11. 在离散数学中,一个集合的子集的总数是2的该集合元素数量的______次方。

答案:对数12. 如果一个命题逻辑表达式中只包含两个命题变量,那么它的真值表有______行。

答案:413. 在图论中,一个图的度序列是指该图所有顶点的______之和的非增序列。

答案:度数14. 一个关系R在域D上的闭包是指R通过______和______运算后得到的关系。

自考离散数学试题及答案

自考离散数学试题及答案

自考离散数学试题及答案一、选择题(每题2分,共20分)1. 在集合论中,下列哪个符号表示“属于”关系?A. ∈B. ∉C. ⊆D. ⊂答案:A2. 命题逻辑中,下列哪个表达式表示“非”操作?A. ∧B. ∨C. ¬D. →答案:C3. 在下列哪个图论的术语中,表示图中任意两个顶点都相连?A. 无向图B. 有向图C. 完全图D. 二分图答案:C4. 布尔代数中,下列哪个操作是“或”?A. ∧C. ¬D. →答案:B5. 以下哪个是等价关系的属性?A. 自反性B. 对称性C. 反对称性D. 传递性答案:A6. 有限自动机中,状态可以被分为哪两种类型?A. 初始状态和终止状态B. 接受状态和拒绝状态C. 确定状态和非确定状态D. 静态状态和动态状态答案:B7. 在关系数据库中,下列哪个操作用于删除表中的行?A. INSERTB. DELETEC. UPDATED. SELECT答案:B8. 以下哪个是谓词逻辑中的量词?B. ∃C. ∧D. ∨答案:A9. 在命题逻辑中,德摩根定律描述了哪些逻辑运算的对偶性?A. ∧ 和∨B. ¬和→C. ¬和↔D. → 和↔答案:A10. 树的深度优先搜索(DFS)算法通常使用哪种数据结构来实现?A. 队列B. 栈C. 链表D. 哈希表答案:B二、填空题(每题3分,共30分)11. 在集合{1, 2, 3, 4, 5}中,子集的总数是_________。

答案:3212. 如果命题P为真,则命题P → Q的真值表中,Q的值必须为_________。

答案:真13. 在有向图中,一个顶点的入度是指_________。

答案:指向该顶点的边的数量14. 一个关系R(A, B, C)中,如果对于任意两个元组,当它们在属性A上的值相等时,它们在属性B和C上的值也相等,则称R具有_________。

答案:候选键15. 在布尔代数中,表达式(A ∧ B) ∨ (A ∧ ¬B)的结果是_________。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Mock ExamNotes___________________________________________________________________________________ 1. There are 38 questions in this mock exam. The real exam will consist of about 25 questions that will be relatively similar to those here... that does not mean “identical” to those...2. If you do these well, you should have no big difficulties in the final exam.3. I encourage you to work these questions first on your own, without help, to see what you do or do not understand. You may seek help after that. Remember that no one will help you or give you hints during the exam. We will clarify the questions if something is not clear but not more than that.#01 - Page 13 #8Let p and q be the propositionsp : I bought a lottery ticket this week.q : I won the million dollar jackpot.Express each of these propositions as an English sentence.a) ¬p I did not buy a lottery ticket this week.b) p ∨q I bought a lottery ticket this week or I won the million dollar jackpot.c) p → q If I bought a lottery ticket this week then I won the million dollar jackpot.d) p ∧q I bought a lottery ticket this week and I won the million dollar jackpot.e) p ↔ q I bought a lottery ticket this week if, and only if, I won the million dollar jackpot.#02 - Page 15 #36Construct a truth table for each of these compound propositions.a) (p ∨q) ∨rp q r p ∨q(p ∨q) ∨rT T T T TT T F T TT F T T TT F F T TF T T T TF T F T TF F T F TF F F F Fc) (p ∧q) ∨r∧(p q)∧∨rp q r p qT T T T TT T F T TT F T F TT F F F FF T T F TF T F F FF F T F TF F F F Fe) (p ∨q)∧¬r∨∧¬rp q r p ∨q¬r(p q)T T T T F FT T F T T TT F T T F FT F F T T TF T T T F FF T F T T TF F T F F FF F F F T F#03 - Page 35 #9Show that each of these conditional statements is a tautology by using truth tables.c) ¬p → (p → q)p q¬p p → q¬p → (p → q)T T F T TT F F F TF T T T TF F T T Td) (p ∧q) → (p → q)∧p → q(p q) → (p → q)∧p q p qT T T T TT F F F TF T T T TF F T T Te) ¬(p → q) → pp q p → q¬(p → q)¬(p → q) → p T T T F TT F F T TF T T F TF F T F T#04 - DNFWrite the following proposition in disjunctive normal form:s = (r → p) → (p∧q)p q r r → p p∧q sT T T T T TT T F T T TT F T T F FT F F T F FF T T F F TF T F T F FF F T F F TF F F T F Fs=(p∧q∧r)∨(p∧q∧¬r)∨(¬p∧q∧r)∨(¬p∧¬q∧r)=(p∧q)∨(¬p∧r)#05 - Page 53 #8Let I (x) be the statement “x has an Internet connection” and C(x, y) be the statement “x and y have chatted over the Internet,” where the domain for the variables x and y consists of all students in your class. Use quantifiers to express each of these statements.b) Rachel has not chatted over the Internet with Chelsea.C(Rachel, Charles)e) Sanjay has chatted with everyone except Joseph.∀x(x ≠ Joseph → C(Sanjay, x))f ) Someone in your class does not have an Internet connection.∃x(¬I(x))i) Everyone except one student in your class has an Internet connection.!∃y[¬I(y) ∧∀x(x ≠ y → I(x))]j) Everyone in your class with an Internet connection has chatted over the Internet with at least one other student in your class.∃∀x yC(x, y)m) There is a student in your class who has chatted with everyone in your class over the Internet.∃x∀yC(x, y)#07 – Page 67 #27Determine the truth value of each of these statements if the domain for all variables consists of all real numbers.a) ∀x∃y(x2 = y) Truec) ∃x∀y(xy = 0)Truee) ∀x(x = 0 → ∃y(xy = 1))False∧x − y = 1)Falsei) ∀x∃y(x + y = 2 2j) ∀x∀y∃z(z = (x + y)/2)TrueUse rules of inference to show that the hypotheses “If it does not rain or if it is not foggy, then the sailing race will be held and the lifesaving demonstration will go on,” “If the sailing race is held, then the trophy will be awarded,” and “The trophy was not awarded” imply the conclusion “It rained.”Define the following literals:r It rainsf It is foggys The sailing race will be heldd The lifesaving demonstration will go ont The trophy will be awardedThe premises are then∧P1(¬r ∨ ¬f) → (s d)P2s → tP3¬tand the conclusion isrThe proof proceeds as follows:1¬t P32s → t P23¬s Modus tollens with 1 and 2'∨Addition to 34¬s ¬d∧De Morgan's law5¬(s d)∨) → (s d)∧P16(¬r ¬f∨)Modus tollens with 5 and 67¬(¬r ¬f∧De Morgan's law8r f9r Simplification of 8#09 – Page 80 #27Use rules of inference to show that if ∀x(P(x) → (Q(x) ∧S(x))) and ∀x(P(x) ∧R(x)) are true, then∀x(R(x) ∧S(x)) is true.∀∧Premise1x(P(x) R(x))∧Universal instantiation2P(c) R(c)3P(c)Simplification from 24x(P(x) →∧Premise∀(Q(x) S(x)))∧Universal instantiation5P(c) → (Q(c) S(c))∧Modus ponens with 3 and 56Q(c) S(c)7S(c)Simplification from 68R(c)Simplification from 2∧Conjunction of 7 and 89R(c) S(c)∀∧Universal generalization10x(R(x) S(x))Prove that if n is a positive integer, then n is odd if and only if 5n + 6 is odd.First, assume that n is odd, so that n = 2k+1 for some integer k. Then 5n+6 = 5(2k+1)+6 = 10k + 11 = 2(5k + 5) + 1. Hence, 5n + 6 is odd. To prove the converse, suppose that n is even, so that n = 2k for some integer k. Then 5n + 6 = 10k + 6 = 2(5k + 3), so 5n + 6 is even. Hence, n is odd if and only if 5n + 6 is odd.#11 – Page 126 #19What is the cardinality of each of these sets?a) {a}1b) {{a}}1c) {a, {a}}2d) {a, {a}, {a, {a}}}3#12 – Page 126 #40Explain why (A × B) × (C × D) and A × (B × C) × D are not the same.The tuples in those sets do not have the same composition. The tuplets in (A × B) × (C × D) are pairs of pairs: ((x,y),(u,v)). However, the tuplets in A × (B × C) × D are ordered triplets with two singletons and a pair: (u, (x,y), v).#13 – Page 136 #27Draw the Venn diagrams for each of these combinations of the sets A, B, and C.b) (A ∩ B) ∪(A ∩ C)c) (A ∩ B) ∪(A ∩ C)#14 – Page 153 #22Determine whether each of these functions is a bijection from R to R.a) f (x) = −3x + 4Yesb) f (x) = −3x2 + 7No: elements greater than 7 have no preimages.c) f (x) = (x + 1)/(x + 2)No: -2 has no imaged) f (x) = x5 + 1YesFor each of these sequences find a recurrence relation satisfied by this sequence. (The answers are not unique because there are infinitely many different recurrence relations satisfied by any sequence.)a) a n= 3a n= a n-1c) a n= 2n + 3a n-1= 2(n - 1)+ 3 = 2n + 3 – 2 = a n – 2. This implies that a n= a n-1+ 2.f ) a n= n2 + n(e1)Here we have two independent terms with n. We will need two additional formulas:a n-1= (n-1)2 + n – 1 = n2 – 2n + 1 + n – 1 = n2 – n(e2)a n-2= (n-2)2 + n – 2 = n2 – 4n + 4 + n – 2 = n2 – 3n + 2(e3)From (e1) and (e2), we have a n – a n-1 = 2n(e4)From (e2) and (e3), we have a n-1 – a n-2 = 2n – 2(e5)From (e4) and (e5), we have a n – a n-1 – (a n-1 – a n-2) = a n – 2a n-1+ a n-2 = 2, or a n = 2a n-1– a n-2+ 2 g) a n= n + (−1)n(e1)a n-1 = n – 1 + (−1)n-1 = n – 1 – (−1)n(e2)From (e1) and (e2), we have a n – a n-1 = 1 + 2(−1)nor a n = a n-1 + 1 + 2(−1)nWe can split this into the odd an even n's:a2k = a2k-1 + 1a2k+1 = a2k− 1h) a n= n!a n = n a n-1#16 – Page 583 #30 (+ additional questions)Let R1 = {(1, 2), (2, 3), (3, 4)} and R2 = {(1, 1), (1, 2), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3), (3, 4)} be relations from {1, 2, 3, 4} to {1, 2, 3, 4}. Finda) R1∪R2 = {(1, 1), (1, 2), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3), (3, 4)} = R2b) R1 ∩ R2 = {(1, 2), (2, 3), (3, 4)} = R1c) R1 − R2 = ∅d) R2 − R1 = {(1, 1), (2, 1), (2, 2), (3, 1), (3, 2), (3, 3)}e) R1 ◦ R2 = {(1, 2), (1, 3), (2, 2), (2, 3), (2, 4), (3, 2), (3, 3), (3, 4)}f ) R2 ◦ R1 =g) Draw the graph of R1 ◦ R2.h) Find the reflexive, symmetric and transitive closures ofReflexive closure = {(1, 1), (1, 2), (2, 2), (2, 3), (3, 4), (3, 4), (4, 4)}Symmetric closure = {(1, 2), (2, 1), (2, 3), (3, 2), (3, 3), (4, 3)}Transitive closure = {(1, 2), (1, 3), (2, 3), (2, 4), (3, 1), (3, 4), (4, 1), (4, 2)}Let R be the relation consisting of all pairs (x, y) such that x and y are strings of uppercase and lowercase English letters with the property that for every positive integer n, the n th characters in x and y are the same letter, either uppercase or lowercase. Show that R is an equivalence relation.That definition basically means that two strings are equivalent if, and only if, they have the same length and every corresponding characters x i and y i are the same letter, either lower or upper case.Let c and C stand for the lower and upper cases of a same letter in the English alphabet.Clearly k, x∀k = x k. So (x, x) ∈ R.So R is reflexive.If (x,y)∈ R, then k, x∀k∈ {c, C} and y k∈ {c, C}. So (y, x) ∈ R also. So R is symmetric.If (x,y)∈ R and (y,z)∈ R, then [x k∈ {c, C}, y k∈ {c, C}] and [y k∈ {c, C}, z k∈ {c, C}], which implies that [x k∈ {c, C},z k∈ {c, C}]. So (x, z) ∈ R. So R is transitive.Therefore R is an equivalence relation.#18 – Page 631 #34Answer these questions for the poset ({2, 4, 6, 9, 12, 18, 27, 36, 48, 60, 72}, |).a) Find the maximal elements.27, 48, 60, 72b) Find the minimal elements.2, 9c) Is there a greatest element?Nod) Is there a least element?Noe) Find all upper bounds of {2, 9}.18,36 72f ) Find the least upper bound of {2, 9}, if it exists.18g) Find all lower bounds of {60, 72}.2, 4, 6, 12h) Find the greatest lower bound of {60, 72},if it exists.12#19 – Group TheoryConsider the set G={a1+a2√3 | a1,a2∈ℚ∧a1a2≠0}with the usual multiplication operation.a) Show that G is a group by verifying the axioms of closure, associativity, existence of an identity element, and existence of an inverse element for every element. Specify what the identity element is and the form an an inverse element.1. Closure: Let a,b∈G. Then ab=(a1+a2√3)(b1+b2√3)=(a1b1+3a2b2)+(a1b2+a2b1)√(3)∈G2 Associativity: Let a ,b ,c ∈G . Then (ab )c =[(a 1+a 2√3)(b 1+b 2√3)]c=[(a 1b 1+3a 2b 2)+(a 1b 2+a 2b 1)√(3)](c 1+c 2√3)=[(a 1b 1+3a 2b 2)c 1+3(a 1b 2+a 2b 1)c 2]+[(a 1b 1+3a 2b 2)c 2+(a 1b 2+a 2b 1)c 1]√(3)=a 1b 1c 1+3a 2b 2c 1+3a 1b 2c 2+3a 2b 1c 2+[a 1b 1c 2+3a 2b 2c 2+a 1b 2c 1+a 2b 1c 1]√(3)=[a 1(b 1c 1+3b 2c 2)+3a 2(b 1c 2+b 2c 1)]+[a 2(b 1c 1+3b 2c 2)+a 1(b 1c 2+b 2c 1)]√(3)=(a 1+a 2√3)[(b 1c 1+3b 2c 2)+(b 1c 2+b 2c 1)√(3)]=a [(b 1+b 2√3)(c 1+c 2√3)]=a (bc )3. Identity element. Let this element be e =e 1+e 2√. Thenea =(e 1+e 2√3)(a 1+a 2√3)=(e 1a 1+3e 2a 2)+(e 1a 2+e 2a 1)√(3)=(a 1+a 2√3).This implies that for every a 1 and a 2:e 1a 1+3e 2a 2=a 1e 1a 2+e 2a 1=a 2That implies e 1=1and e 2=0. Thus e =1.4. Inverse element. Consider a =a 1+a 2√3∈G and let its inverse be a −1=x 1+x 2√3if it exists. Then we must havea −1a =(x 1+x 2√3)(a 1+a 2√3)=(x 1a 1+3x 2a 2)+(x 1a 2+x 2a 1)√(3)=1=e This impliesx 1a 1+3x 2a 2=1x 1a 2+x 2a 1=0The solution isa −1=a 1−a 2√3a 12−3a 22.Thus G forms a group.b) Is G Abelian?Yes: ab =(a 1+a 2√3)(b 1+b 2√3)=(a 1b 1+3a 2b 2)+(a 1b 2+a 2b 1)√(3)=ba because this expression is symmetric.#20 – Page 665 #9Determine the number of vertices and edges and find the in-degree and out-degree of each vertex for the shown directed multigraph:5 vertices 13 edgesdeg+(a) = 1, deg+(b) = 1, deg+(c) = 5, deg+(d) = 4, deg+(e) = 0deg−(a) = 6, deg−(b) = 5, deg−(c) = 2, deg−(d) = 2, deg−(2) = 0#21 – Page 666 #28Suppose that a newcompany has five employees: Zamora, Agraharam, Smith, Chou, and Macintyre. Each employee will assume one of six responsiblities: planning, publicity, sales, marketing,development, and industry relations. Each employee is capable of doing one or more of these jobs: Zamora could do planning, sales, marketing, or industry relations; Agraharam could do planning or development; Smith could do publicity, sales, or industry relations; Chou could do planning, sales, or industry relations; and Macintyre could do planning, publicity, sales, or industry relations.a) Model the capabilities of these employees using a bipartite graph.b) Find an assignment of responsibilites such that each employee is assigned one responsibility.Note: the assignment is not unique. The only forced choices are (Z, ma) and (A, de). There is a variety of possibilities for the other 3.c) Is the matching of responsibilities you found in part (b) a complete matching? Is it a maximum matching?The matching (from {Z, A, S, C, M} to {ma, de, sa, pl, pu, ir}) is complete because every employee is matched with a job. It is a maximum because |M| = 5 = |{Z, A, S, C, M}|#22 – Page 676 #21 (+ additional questions)Consider the following grapha) Find the adjacency matrix A of the graph A =(1110100220111210)b) Find how many paths of length 3 there are from c to b A 3=A (1110100220111210)(1110100220111210)=(1110100220111210)(4123353054415125)=(12109414361318710121512124)So there are 6 paths from c to b.#23 – Page 676 #38Determine whether the following two graphs are isomorphic. If so, construct an isomorphism.Notice the second graph can be deformed like this (by moving v 2 all the way down and rotating the other vertices by about a quarter of a turn):It has 2 circuits of length 4 whereas the graph on the left has only 1. That immediately implies that these graphs are not isomorphic.#24 – Page 692 #31-32Consider the following graphs#31#31a) List the cut vertices c c, db) List the cut edges none(c,d)c) What is the vertex connectivity κ(G)?11d) What is the edge connectivity λ(G)?21#25 – Page 704 #22Determine whether the directed graph shown has an Euler circuit. Construct an Euler circuit if one exists. If no Euler circuit exists, determine whether the directed graph has an Euler path. Construct an Euler path if one exists.The vertices' total degrees are all even except for vertices b and c. So it has no Euler circuit but there might be an Euler path, although this is not guaranteed because the graph is directed. However every vertex with an even total degree has equal in and out degrees. Beccause the out-degree of c is larger than its in-degree, then the starting point has to be c. In fact, we o find an Euler path:c → e → b → c → b → f → a → f → e → f →d →e → a → b → d → c → b#26 – Page 716 #8Find a shortest path (in mileage) between each of the following pairs of cities in the airline system shown in Figure 1.Note: You must show every steps of the algorithmB N M ACD S L-0------N 191/N-1090/N760/N722/N-2534/N2451/N B --1090/N760/N722/N-2534/N2451/N C --1090/N760/N-1630/C2534/N2451/N A --1090/N--1630/C2534/N2451/N D --1090/N---2534/N2451/N M ------2534/N2451/N LPath = N → L Distance = 2451b) Boston and San FranciscoB N M ACD S L0-------B -191/B--860/B---N --1281/N951N860/B-2725/N2642/N C --1281/N951N-1768/C2715/C2642/N A --1281/N--1768/C2715/C2642/N M -----1768/C2715/C2642/N D ------2715/C2602/D L ------2715/C-SPath = B → C → S Distance = 2715c) Miami and DenverB N M ACD S L--0-----M -1090/M-595/M----A -1090/M--1201/A---N 1281/N---1201/A-3624/N3541/N C 1281/N----2109/C3056/C3541/N B -----2109/C3056/C3541/N DPath = M → A → C → D Distance = 2109B N M ACD S L--0-----M-1090/M-595/M----A-1090/M--1201/A---N1281/N---1201/A-3624/N3541/N C1281/N----2109/C3056/C3541/N B-----2109/C3056/C3541/N D------3056/C2943/D LPath = M → A → C → D → L Distance = 2943#27 – Page 726 #12Suppose that a connected planar graph has eight vertices, each of degree three. Into how many regions is the plane divided by a planar representation of this graph?We have V = 8. Each node has a degree equal to 3. The sum of all the degrees is therefore 24 and we know it is equal to twice the number of edges; thus E = 12. Recall Euler's formula: V – E + F = 2. So we have 8 – 12 + F = 2, which implies that F = 6.#28 – Page 732 #4Construct the dual graph for the map shown. Then find the number of colors needed to color the map so that no two adjacent regions have the same color.#29 – Page 733 #17Schedule the final exams for Math 115, Math 116, Math 185, Math 195, CS 101, CS 102, CS 273, and CS 473, using the fewest number of different time slots, if there are no students taking both Math 115and CS 473, both Math 116 and CS 473, both Math 195 and CS 101, both Math 195 and CS 102, both Math 115 and Math 116, both Math 115 and Math 185, and both Math 185 and Math 195, but there are students in every other pair of courses.The best way to obtain a graph for this is to draw a complete graph and then remove edges according to the description in the above paragraph.{MAT115, MAT116, CS473}{MAT185, MAT195}{CS101}{CS102}{CS273}The scheduling is not unique.#30 – Page 755 #4Consider the following rooted tree:a) Which vertex is the root?ab) Which vertices are internal?b, d, e, g, h, i, oc) Which vertices are leaves?c, f, j, k, l, m, n, p, q, r, sd) Which vertices are children of n?nonee) Which vertex is the parent of g?bf ) Which vertices are siblings of k?jg) Which vertices are ancestors of o?a, d, ih) Which vertices are descendants of d?h, i, n, o, p, q, r, s#31 – Page 756 #20How many leaves does a full 3-ary tree with 100 vertices have?L=(m−1)n+1n =(3−1)×100+13=2013=67MATMATMAT185MAT195CS473CS273CS101CS102#32 – Page 769 #2Build a binary search tree for the words oenology, phrenology, campanology, ornithology, ichthyology , limnology, alchemy , and astrology using alphabetical order.#33 – Page 770 #24Use Huffman coding to encode these symbols with given frequencies: A: 0.10, B: 0.25, C: 0.05, D: 0.15, E: 0.30, F: 0.07, G: 0.08. What is the average number of bits required to encode a symbol?0.050.070.080.100.150.250.30 C F G A D B E0.080.100.120.150.250.30 GADBE0.120.150.180.250.30 DB E0.180.250.270.30 BE0.270.300.43Eoenologyphrenologycampanology ichthyology alchemy astrologylimnologyornithology0.430.571.00Codes:A = 110B = 10C = 0111D = 010E = 00F = 0110G = 111Average nuber of bits = (3 + 2 + 4 + 3 + 2 + 4 + 3) / 7 = 21/7 = 3#34 – Page 783 #10-11Consider the following rooted tree:In which order are the vertices visited using a preorder traversal?a, b, d, e, i, j, m, n, o, c, f, g, h, k, p, l#35 – Page 784 #23What is the value of the following prefix expression?a) − 2 / 8 4 3∗− 2 ∗/ 8 4 3=− 2 2∗ 3=− 4 3=1GACFCFb) ↑ − 3 3 4 2 5∗∗∗ 5=↑ − 3 3∗ 8 5∗ 4 2↑ − 3 3=↑ − 9 8 5=↑ 1 5=1c) + − ↑ 3 2 ↑ 2 3 / 6 − 4 2+ − ↑ 3 2 ↑ 2 3 / 6 − 4 2=+ − ↑ 3 2 ↑ 2 3 / 6 2=+ − ↑ 3 2 ↑ 2 3 3=+ − ↑ 3 2 8 3=+ − 9 8 3=+ 1 3=4∗d) + 3 + 3 ↑ 3 + 3 3 3+ 3 + 3 ↑ 3∗↑ 3 6 3∗+ 3 3 3= + 3 + 3∗+ 3 729 3= + 3=∗+ 3 732 3∗= 735 3=2205#36 – Page 795 #13Use depth-first search to produce a spanning tree for the following simple graph. Choose vertex 'a' as the root of this spanning tree and assume that the vertices are ordered alphabetically.a →b →c →d →e →f →g →h → Ig → j#37 – Page 802 #3Use Prim's algorithm to find a minimum spanning tree (and its total weight) for the following weighted graph:(ef)1(cf)3(eh)3(hi)2(gh)4(bc)4(bd)3(ad)2Total weight = 22#38 – Page 802 #8Use Kruskal’s algorithm to find a minimum spanning tree for the weighted graph in Exercise 4 (#37). (ef)1(ad)2(hi)2(bd)3(cf)3(eh)3(bc)4(gh)4Total weight = 22The spanning tree is identical to that in Exercise 4 (#37).。

相关文档
最新文档