离散数学英文试题A参考答案及评分标准

合集下载

最新离散数学题库及答案

最新离散数学题库及答案

数理逻辑部分选择、填空及判断✓下列语句不是命题的( A )。

(A) 你打算考硕士研究生吗? (B) 太阳系以外的星球上有生物。

(C) 离散数学是计算机系的一门必修课。

(D) 雪是黑色的。

✓命题公式P→(P∨⌝P)的类型是( A )(A) 永真式(B) 矛盾式(C) 非永真式的可满足式(D) 析取范式✓A是重言式,那么A的否定式是( A )A. 矛盾式B. 重言式C. 可满足式D.不能确定✓以下命题公式中,为永假式的是( C )A. p→(p∨q∨r)B. (p→┐p)→┐pC. ┐(q→q)∧pD. ┐(q∨┐p)→(p∧┐p)✓命题公式P→Q的成假赋值是( D )A. 00,11B. 00,01,11C.10,11D. 10✓谓词公式)xxP∧∀中,变元x是 ( B )R(,x)(yA. 自由变元B. 既是自由变元也是约束变元C. 约束变元D. 既不是自由变元也不是约束变元✓命题公式P→(Q∨⌝Q)的类型是( A )。

(A) 永真式 (B) 矛盾式(C) 非永真式的可满足式 (D) 析取范式✓设B不含变元x,)Ax→x∃等值于( A ))((BA. B( D. B∃)xA→x∃)((∃ C. Bx∧Ax( B. )∀)xA→xx∨)A(x(B✓下列语句中是真命题的是( D )。

A.你是杰克吗? B.凡石头都可练成金。

C.如果2+2=4,那么雪是黑的。

D.如果1+2=4,那么雪是黑的。

✓从集合分类的角度看,命题公式可分为( B )A. 永真式、矛盾式B. 永真式、可满足式、矛盾式C. 可满足式、矛盾式D. 永真式、可满足式✓命题公式﹁p∨﹁q等价于( D )。

A. ﹁p∨qB. ﹁(p∨q)C. ﹁p∧qD. p→﹁q✓一个公式在等价意义下,下面写法唯一的是( D )。

(A) 范式 (B) 析取范式 (C) 合取范式 (D) 主析取范式✓下列含有命题p,q,r的公式中,是主析取范式的是( D )。

离散数学试题(A卷答案)

离散数学试题(A卷答案)

离散数学试题(A 卷答案)一、(10分)求(P ↓Q )→(P ∧⌝(Q ∨⌝R ))的主析取范式 解:(P ↓Q )→(P ∧⌝(Q ∨⌝R ))⇔⌝(⌝( P ∨Q ))∨(P ∧⌝Q ∧R ))⇔(P ∨Q )∨(P ∧⌝Q ∧R ))⇔(P ∨Q ∨P )∧(P ∨Q ∨⌝Q )∧(P ∨Q ∨R ) ⇔(P ∨Q )∧(P ∨Q ∨R )⇔(P ∨Q ∨(R ∧⌝R ))∧(P ∨Q ∨R ) ⇔(P ∨Q ∨R )∧(P ∨Q ∨⌝R )∧(P ∨Q ∨R ) ⇔0M ∧1M⇔2m ∨3m ∨4m ∨5m ∨6m ∨7m二、(10分)在某次研讨会的休息时间,3名与会者根据王教授的口音分别作出下述判断: 甲说:王教授不是苏州人,是上海人。

乙说:王教授不是上海人,是苏州人。

丙说:王教授既不是上海人,也不是杭州人。

王教授听后说:你们3人中有一个全说对了,有一人全说错了,还有一个人对错各一半。

试判断王教授是哪里人?解 设设P :王教授是苏州人;Q :王教授是上海人;R :王教授是杭州人。

则根据题意应有: 甲:⌝P ∧Q 乙:⌝Q ∧P 丙:⌝Q ∧⌝R王教授只可能是其中一个城市的人或者3个城市都不是。

所以,丙至少说对了一半。

因此,可得甲或乙必有一人全错了。

又因为,若甲全错了,则有⌝Q ∧P ,因此,乙全对。

同理,乙全错则甲全对。

所以丙必是一对一错。

故王教授的话符号化为:((⌝P ∧Q )∧((Q ∧⌝R )∨(⌝Q ∧R )))∨((⌝Q ∧P )∧(⌝Q ∧R ))⇔(⌝P ∧Q ∧Q ∧⌝R )∨(⌝P ∧Q ∧⌝Q ∧R )∨(⌝Q ∧P ∧⌝Q ∧R ) ⇔(⌝P ∧Q ∧⌝R )∨(P ∧⌝Q ∧R ) ⇔⌝P ∧Q ∧⌝R ⇔T因此,王教授是上海人。

三、(10分)证明tsr (R )是包含R 的且具有自反性、对称性和传递性的最小关系。

证明 设R 是非空集合A 上的二元关系,则由定理4.19知,tsr (R )是包含R 的且具有自反性、对称性和传递性的关系。

离散数学期末试题A答案及评分标准

离散数学期末试题A答案及评分标准

--北京工商大学离散数学试卷(A)答案及评分标准题号 一 二三 四 五 六 七总分得分一、(30分)设A ={1,2,3,4},给定A 上二元关系R 如下:R ={<1,1>, <1,2>, <2,3>, <3,3>, <4,4>}请回答以下各问题:1.写出R 的关系矩阵. (3分)2.画出R 的关系图. (3分)3.求包含R 的最小的等价关系,并写出由其确定的划分. (6分)4.分别用关系矩阵表示出R 的自反闭包r (R )、对称闭包s (R ). (6分)5.求传递闭包t (R ).(写出计算步骤)(6分)6.求R 2的关系矩阵. (3分)7.集合A 上最多可以确定多少个不同的二元关系?说明理由。

(3分)[解] (1)⎪⎪⎪⎪⎪⎭⎫⎝⎛=1000010001000011R M 。

……(3分)(2) ……(3分)(3)法一:直接由等价关系与划分之间的一一对应可知,包含R 的最小等价关系为: {<1, 2>, <1, 3>, <2, 1>,<2, 3>, <3, 1> <3, 2>}∪I A , ……(3分) 对应的划分为{{1, 2, 3},{4}}. ……(6分) 法二:包含R 的最小的等价关系就是tsr (R ), 计算过程如下:⎪⎪⎪⎪⎪⎭⎫⎝⎛=⎪⎪⎪⎪⎪⎭⎫ ⎝⎛+⎪⎪⎪⎪⎪⎭⎫⎝⎛=+=100001000110001110000100001000011000010001000011)(E M M R R r,100001100111001110000110001100011000010001100011][)()()(⎪⎪⎪⎪⎪⎭⎫ ⎝⎛=⎪⎪⎪⎪⎪⎭⎫⎝⎛+⎪⎪⎪⎪⎪⎭⎫ ⎝⎛=+=T R r R r R sr M M M ,3,10001110111011110000110011100111000011001110011)]([)()()]([2≥=⎪⎪⎪⎪⎪⎭⎫ ⎝⎛=⎪⎪⎪⎪⎪⎭⎫⎝⎛⨯⎪⎪⎪⎪⎪⎭⎫ ⎝⎛=⨯=k M M M M k R sr R sr R sr R sr 从而,10000111011101111000011101110111100001110111011110000111011101111000011001110011432)]([)]([)]([)()(⎪⎪⎪⎪⎪⎭⎫ ⎝⎛=⎪⎪⎪⎪⎪⎭⎫ ⎝⎛+⎪⎪⎪⎪⎪⎭⎫ ⎝⎛+⎪⎪⎪⎪⎪⎭⎫ ⎝⎛+⎪⎪⎪⎪⎪⎭⎫ ⎝⎛=+++=R sr R sr R sr R sr R tsr M M M M M即}2,3,1,3,3,2,1,2,3,1,2,1{)(><><><><><><⋃=A I R tsr =包含R 的最小的等价关系, ……(3分) 故其对应的划分为{{1, 2, 3},{4}}. ……(6分) 法三:由于4=A ,包含R 的最小的等价关系就是4131211)()()()()()(----⋃⋃⋃⋃⋃⋃⋃⋃==R R R R R R R R I R rts R tsr A ,计算过程如下:⎪⎪⎪⎪⎪⎭⎫ ⎝⎛=⎪⎪⎪⎪⎪⎭⎫ ⎝⎛+⎪⎪⎪⎪⎪⎭⎫⎝⎛=+=-⋃100001100101001110000110000100011000010001000011][1TR R R R M M M ⎪⎪⎪⎪⎪⎭⎫⎝⎛=⎪⎪⎪⎪⎪⎭⎫⎝⎛=+=-⋃10000111011101111000011001010011)][(22)(21T R R R R M M M412131)()(33)(10000111011101111000011001010011)][(---⋃⋃⋃==⎪⎪⎪⎪⎪⎭⎫⎝⎛=⎪⎪⎪⎪⎪⎭⎫⎝⎛=+=R R R R T R R R R M M M M M 考试纪律承诺本人自愿遵守学校考试纪律,保证以诚信认真的态度作答试卷。

离散数学试题及答案

离散数学试题及答案

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).。

离散数学英文试题A

离散数学英文试题A

《离散数学》课程试题【A】卷阅卷须知:阅卷用红色墨水笔书写,得分用阿拉伯数字写在每小题题号前,用正分表示,不得分则在题号前写0;大题得分登录在对应的分数框内;统一命题的课程应集体阅卷,流水作业;阅卷后要进行复核,发现漏评、漏记或总分统计错误应及时更正;对评定分数或统分记录进行修改时,修改人必须签名。

特别提醒:学生必须遵守课程考核纪律,违规者将受到严肃处理。

PLEASE ANSWER IN CHINESE OR IN ENGLISH!!1. Fill the best answer in the blanks (3 points each,15 points in all)(1) If A, B, and C be sets, then (A–C) – (B–C) ___________ A–B.(2) A relation on a set A that is reflexive, symmetric, and transitive is called an (or a) ___________relation.(3) K n has ___________edges.(4) There are _______ __non-isomorphic rooted trees with four vertices.(5) Assume that P(x, y) means “x+ 2y= xy”, where x and y are integers. Then the truth value of thestatement ∀x∃y P(x, y) is _______ __.2. Choose the corresponding letter of the best answer that best completes the statements oranswers the questions among A, B, C, and D and fill the blanks (3 points each,15 pointsin all).(1) Suppose A = {1, 2, 3}. The following statement ( ) is not true. A .∅ ⊆(A )B .{∅} ⊆ (A )C .{2, 3} A AD .{{2}} ⊆(A )(2) Suppose that R and S are transitive relations on a set A . Then ( ) is transitive. A . S R ⋂ B .S R ⋃ C . S R - D .S R(3) There are ( ) strongly connected components of the following graph G .A. 1B. 2C. 3D. 4(4) There are ( ) nonisomorphic undirected trees with 5 vertices.A. 6B. 5.C. 4D. 3(5) Suppose P (x , y ) is a predicate and the universe for the variables x and y is {1,2,3}. Suppose P (1,3), P (2,1), P (2,2), P (2,3), P (3,1), P (3,2) are true, and P (x , y ) is false otherwise. The following statement ( ) is true.A. ∀y ∃x (P (x , y ) → P (y , x ))B. ¬∃x ∃y (P (x , y ) ∧ ¬P (y , x ))C. ∀x ∀y (x ≠ y → (P (x , y ) ∨ P (y , x ))D. ∀y ∃x (x ≤ y ∧ P (x , y ))3. Write “” for true, and “” for false in the blanks at end of each statement (3 pointseach ,15 points in all).(1) There is a set S such that its power set (S) has 12 elements. ( )(2) An irreflexive and transitive relation on a set A is antisymmetric. ( )(3) The largest value of n for which K n is planar is 6. ( )(4) Every full binary tree with 61 vertices has 31 leaves. ( )(5) Logical expressions ))(x)xB(∧∀are equivalent. ( )xA∀x∀and)(x∧((x)AxB4.For any function f: A B, define a new function g: (A) (B) as follows: for every S A, g(S) = {f(x)|x S}. Prove that g is surjective (or onto) if and only f is surjective(or onto). (10 points)5.Find the transitive closure t(R) of R on {a, b, c, d} and draw the graph of t(R) where R = {(a, a), (b, a), (b,c), (c, a), (c, c), (c, d), (d, a), (d, c)}. (10 points)6. Either give an example or prove that there is none: A graph with 7 vertices that has a Hamilton circuit but no Euler circuit. (10 points)7. Let G be an undirected tree with 3 vertices of degree 3, 1 vertex of degree 2, the other vertices of degree 1.(15 points)(1) How many vertices in G are there?(2) Draw two nonisomorphic undirected trees satisfying the above requirements.8. Show that p→ (q→ r) and p→ (q∧ r) are logically equivalent. (10 points)。

11级离散数学试题(A)参考答案

11级离散数学试题(A)参考答案

2011级离散数学(A)参考答案一、填空题(每小题2分,共30分)1. 设():M x x 为人, ():F x x 不吃饭。

将命题“没有不吃饭的人”符号化为:))()((x F x M x ⌝→∀ 或 ))()(((x F x m x ∧∃⌝ 。

2. 设A={1, 2, 3, 4} ,则 A 的全部2元子集共有 6 个。

3. 设p :明天是周一,q :明天是周三,r :我有课。

则命题“如果明天是周一或周三,我就有课”的符号化形式为 r q p →∨)( 。

4. 已知命题公式A 含有2个命题变项,其成真赋值为00、10、11,则其主析取范式为 320m m m ∨∨ 。

5. 设p :北京比大连人口多,q :2+2=4,r :乌鸦是白色的。

则命题公式)()(r p r q ⌝→→∨的真值为 1 。

6. 集合}3,2,1{=A 上的关系}3,2,3,1,2,1{><><><=R ,则=-1R { <2,1>,<3,1>,<3,2> }。

7. 画出下图的补图 。

8.设A={1,2,3},B={a,b,c},A 1={1},f={<1,a>,<2,a>,<3,b>},则=-))((11A f f { 1,2 }。

9. 设无向图的度数序列为:1,2,2,3,4。

则该无向图的边数m= 6 。

10. 3阶有向完全图的2条边的非同构的生成子图有 4 个。

11. 设〈≤,A 〉为偏序集,A B ⊆。

若y x B y x 与,,∈∀都是可比的,则称B是A 中的一条链,B 中的元素个数称为链的长度。

在偏序集〈{1,2,…,9},整除〉中,{1,2,4,8}是长为 4 的链。

12. 下面运算表中的单位元是 b 。

13. 写出模4加法群G=<Z 4,⊕ >的运算表14. 模4加法群中, 2-3= 2 。

离散数学期末考试试卷a答案及评分细则

离散数学期末考试试卷a答案及评分细则

………密………封………线………以………内………答………题………无………效……电子科技大学英才学院2022 -2022学年第 1学期期 末 考试 A 卷离散数学 课程考试题 A 卷 〔 120分钟〕 考试形式:闭卷 考试日期 2022 年 月 日课程成绩构成:平时 分, 期中 分, 实验 分, 期末 100 分I.Multiple Choice (15%, 1.5 points each)〔A 〕 1. (p ∧q)→(p ∨q) is logically equivalent toa) T b) p ∨q c) F d) p ∧q〔A 〕 2. If P(A) is the power set of A, and A = ∅, what is |P(P(P(A)))|?a) 4 b) 24 c) 28 d) 216〔C 〕 3. Which of these statements is NOT a proposition?a) Today is Monday. ` b) 1+1=2.c) Am I right? d) Go and play with me.〔C 〕 4. Which of these propositions is not logically equivalent to the other three?a) (p → q) ∧ (r → q) b) (p ∨ r) → qc) (p ∧r) → q d) The contrapositive of ¬q → (¬p ^ ¬r)〔B 〕 5. Suppose | A | = 3 and | B | = 8. The number of 1-1 functions f : A → B isa) 24 b) P (8,3). c) 38 d) 83〔B 〕 6. Let R be a relation on the positive integers where xRy if x is a factor of y . Whichof the following lists of properties best describes the relation R ? a) symmetric, transitiveb) antisymmetric, transitive, reflexive c) antisymmetric, symmetric, reflexive d) symmetric, transitive, reflexive〔C 〕 7. Which of the following are partitions of },,,,,,,{h g f e d c b a U =?a)},,,,,{},,,{},{h g f e d c c b a a . b) },,,,,{},,{},{h g f e d c c b a c) }{},,{},,{},,,{h f e c b g d a . d) },,,,{},,{},,{h g f e d c b b a〔C 〕 8. The function f(x)=x 2log(x 3+78) is big-O of which of the following functions?a) x 2 b) x(logx)3 c) x 2logx d) xlogx〔A 〕 9.If 1010110111101101R ⎡⎤⎢⎥⎢⎥=⎢⎥⎢⎥⎣⎦M , then R is: a) reflexive b) symmetric c) antisymmetric d) transitive.〔B 〕 10. Which of the followings is a function from Z to R ?………密………封………线………以………内………答………题………无………效……a) )1()(-±=n n f . ` b) 1)(2+=x x f . c) x x f =)( d) 21)(2-=n n fII. True or False (10%, 1 point each) 〔T 〕 1. If 1 < 0, then 5 = 6. 〔F 〕 2. (p ∧ q) ∨ r ≡ p ∧ (q ∨ r)〔F 〕 3. If A , B , and C are sets, then (A -C )-(B -C )=A -B . 〔T 〕 4. Suppose A = {a ,b ,c }, then {{a }} ⊆ P (A ).〔F 〕 5.()h x =is defined as a function with domain R and codomain R.〔T 〕 6. Suppose g : A → B and f : B → C , where f g is 1-1 and f is 1-1. g must be 1-1? 〔T 〕 7. If p and q are primes (> 2), then p + q is composite .〔F 〕 8.If the relation R is defined on the set Z where aRb means that ab > 0, then R is an equivalence relation on Z .〔T 〕 9. (A - B ) ⋃ (A - C ) = A - (B ⋂ C ).〔T 〕 10. The set{∅,{a },{∅},{a ,∅}} is the power set of some set III. Fill in the Blanks (20%, 2 points each)1. Let p and q be the propositions “I am a criminal 〞 and “I rob banks 〞. Express in simpleEnglish the proposition “if p then q 〞: If I am a criminal them I rob banks. 2. P (x ,y ) means “x + 2y = xy 〞, where x and y are integers. The truth value of ∃x ∀yP (x ,y )is False .3. T he negation of the statement “No tests are easy.〞 is some tests are easy.4. If 11{|}i A x x R x i i =∈∧-≤≤ then 1i i A +∞=is ∅.5. Suppose A = {x , y }. Then ()P A is {∅, {x}, {y},{x,y}}.6. Suppose g : A →A and f :A →A where A ={1,2,3,4},g = {(1, 4), (2,1), (3,1), (4,2)} andf ={(1,3),(2,2),(3,4),(4,2)}.Then fg ={(1,2),(2,3),(3,3),(4,2)}.7. The sum of 2 + 4 + 8 + 16 + 32 + ... + 210 is 211 - 2 .8. The expression of gcd(45, 12) as a linear combination of 12 and 45 is 12 ⋅ 4 + 45 ⋅ (1). 9.There are 5! permutations of the seven letters A,B ,C ,D ,E ,F have A immediately to the left of E .10. The two's complement of -13 is 1 0011 . IV. Answer the Questions (32%, 4points each):1. Determine whether the following argument is valid:………密………封………线………以………内………答………题………无………效……p→rq→rq∨⌝r________∴⌝pAns: Not valid: p true, q true, r true2.Suppose you wish to prove a theor em of the form “if p then q〞.(a) If you give a direct proof, what do you assume and what do you prove?(b) If you give an indirect proof, what do you assume and what do you prove?(c) If you give a proof by contradiction, what do you assume and what do you prove? Ans: (a) Assume p, prove q.(b) Assume ⌝q, prove ⌝p.(c) Assume p∧⌝q, show that this leads to a contradiction.3.Prove that A B A B⋂=⋃by giving a proof using logical equivalence.Ans:()()()() A B x x A Bx x A Bx x A Bx x A x Bx x A x Bx x A x Bx x A x Bx x A B A B ⋂={|∈⋂}={|∉⋂}={|⌝∈⋂}={|⌝∈∧∈}={|⌝∈∨⌝∈}={|∉∨∉}={|∈∨∈}={|∈⋃}=⋃4.Suppose f:R→R where f(x) =⎣x/2⎦.(a) If S={x| 1 ≤x≤ 6}, find f(S).(b) If T={3,4,5}, find f-1(T). Ans: (a) {0,1,2,3}(b) [6,12).e the definition of big-oh to prove that5264473n nn+--is O(n3).………密………封………线………以………内………答………题………无………效……Ans: 5555322226446410573763n n n n n n n n n n +-+≤==--, if n ≥ 2. 6. Solve the linear congruence 5x ≡ 3 (mod 11).Ans: 5 + 11k .7. Use the Principle of Mathematical Induction to prove that 1311392732n n+-++++...+= for alln ≥ 0.Ans: P (0):13112-= , which is true since 1 = 1. P (k ) → P (k + 1):111211313123311333222k k k k k k ++++++--+⋅-++...+=+==.8.Encrypt the message NEED HELP by translating the letters into numbers, applying the encryption function f(p ) = (3p + 7) mod 26, and then translating the numbers back into letters.Ans: Encrypted form: UTTQ CTOA.V. (6%) Without using the truth table, show that the following are tautologiesa) [⌝p ∧(p ∨q)]→q b) [p ∧(p →q)]→qAns:a) ⌝p ∧(p ∨q)≡(⌝p ∧p)∨(⌝p ∧ q)≡flase[⌝p ∧(p ∨q)]→q ≡ false →q ≡⌝false ∨q ≡true ∨q ≡true (3points)b)[p ∧(p →q)]→q ≡(⌝[p ∧(⌝p ∨q)])∨q ≡(⌝p ∨(p ∧⌝q))∨q ≡((⌝p ∨p)∧(⌝p ∨⌝q))∨q ≡⌝p ∨⌝q ∨q ≡true (3points)VI. (6%) Devise an algorithm which will find the minimum of n integers. What is the worst case time………密………封………线………以………内………答………题………无………效……complexity of this algorithm?a) procedure min(a1, a2, …, an: integers)(4points)v := a1 {largest element so far}for i := 2 to n {go thru rest of elems}if ai < v then v := ai {found smaller?}{at this poi nt v’s value is the same as the smallest integer in the list}return vb) the worst case time complexity of this algorithm is O(n). (2points)VII.(5%) Give the definition of a transitive relation, and Prove or disprove that the union of two transitive relations is transitive.Ans: A relation R on a set A is called transitive if only if (a,b)∈R and (b,c)∈R ,then (a,c) ∈R ,for a,b,c ∈A. (2points)The union of two transitive relations may be not transitive. A counter-example:A={1,2,3}, R1= {<1,1>, <2,3>}, R2={<1,2><3,3> }R1∪R2={<1.1>, <2,3><1,2><3,3>}, which is not transitive. (3points)VIII.(6%) Give an argument using rules of inference to show that the conclusion follows from the hypotheses. List all the steps in your argument.Hypotheses: All computer scientists like Star Trek. Sarah does not like Star Trek. Therefore, Sarah is not a computer scientist.Solution:Hypotheses: ∀x(ComputerScientist(x) →Likes(x, StarTrek))¬Likes(Sarah, StarTrek)Conclusion: ¬ComputerScientist(Sarah)Step 1: ∀x(ComputerScientist(x) →Likes(x, StarTrek)) (Hypothesis)Step 2: ComputerScientist(Sarah) →Likes(Sarah, StarTrek) (Univ. Inst. Step 1)Step 3: ¬Likes(Sarah, StarTrek) (Hypothesis)Step 4: ¬ComputerScientist(Sarah) (Modus Toll. St. 2+3)The argument is sound.Grading rubric: -3 points for making wrong assumptions.-2 points for not being able to complete the proof.-1 to -3 points for illegal usage of inference rules.。

机械工业出版社离散数学英文版部分答案3_4

机械工业出版社离散数学英文版部分答案3_4

Homework33.1: P177Ex4: set the answer to be . For i going from 1 through n-1, computer the value of the (i+1)st element in the list minus the i th element in the list. If this is larger than the answer, reset the answer to be this value.Ex27ternary(V, s, e)if s > ereturn -1elsem1 ←(e-s)/3 + sm2 ←2*(e-s)/3 + sif V = A[ m1 ]return m1else if V = A[ m2 ]return m2else if V < A[ m1 ]return ternary(V, s, m1-1)else if V < A[ m2 ]return ternary(V, m1+1, m2-1)elsereturn ternary(V, m2+1, e)3.2: P191Ex2 (a) Yes (c) Yes (e) NoEx20 The approach in these problems is to pick out the most rapidly growing term in each sum and discard the rest (including the multiplicative constants).a) O(n3log(n)) b) O(6n) c) O(n n n!)Ex28 (a) Choose C1=1 and C2=2, for all x>1, we have C1*3x2 <=3x2+x+1<=C2*3x2.Ex36 This does not follow. Let f(x)=2x and g(x)=x. then f(x) is O(g(x)). Now 2f(x)=4x, and 2g(x)=2x. The ratio 4x/2x=2x grows without bound as x grows—it is not bounded by a constant.3.3: P200Ex8a) Initially y:=3, for i=1 we set y to 7, for i=2 we set y to 15, and we are done.b) There is one multiplication and one addition for each of the n passes through the loop, so there are n multiplication and n additions in all.Ex10a) 1.224*10-6 seconds b) 1.05*10-3 seconds c) 1.13*106 seconds d) 1.27*1021 seconds3.4: P208Ex6 Under the hypotheses, we have c=as and d=bt for some s and t. Multiplying we obtain cd=ab(st), which means ab|cd, as desired.Ex24 Write n=2k+1 for some integer k. Then n 2=4k(k+1)+1. Since either k or k+1 is even, therefore n 2-1 is a multiple of 8, so n 2≡1 (mod 8).3.5: P217Ex10 These are 1,5,7,and 11.Ex32 From a ≡b (mod m) we know that b=a+sm for some integer s. Now if d is a common divisor of a and m, then it divides the right-hand side of this equation, so it dived b. We can rewrite the equation as a=b-sm, and then by similar reasoning, we see that every common divisor of b and m is also a divisor of a. This shows that the set of common divisors of a and m is equal to the set of common divisors of b and m, so certainly gcd(a,m)=gcd(b,m).3.6:P230Ex8 a) 1111 0111 becomes F7Ex28 d) 79=81-3+13.7: P244Ex4 Since 13*937-1=12180=2436*5, we have 13*937≡1(mod 2436).Ex12 We know from exercise 6 that 9 is an inverse of 2 modulo 17. Therefore if we multiply both sides of this equation by 9, we will get x ≡12 (mod 17)Ex18 x=2*20*2+1*15*3+3*12*3≡53 (mod 60).3.8: P255Ex16 The (i,j)th entry of (A t )t is the (j,i)th entry of (A t ), which is (i,j)th entry of A.Homework44.1: P279Ex6. The basis step is clear, since 1*1!=2!-1. Assuming the inductive hypothesis, we then have 1*1!+2*2!+….+k*k!+(k+1)*(k+1)!=(k+1)!-1++(k+1)*(k+1)!=(k+2)!-1.Ex38. The basis step is trivial, as usual: A 1⊆B 1. Assume the inductive hypothesis that if A j ⊆B j for j=1,2,…,k, then 11kkj j j j A B ==⊆U U . We want to show that if A j ⊆B j for j=1,2,…,k+1, then1111k kj j j j A B ++==⊆U U . To show that one set is a subset of another we show that an arbitraryelement of the first set must be an element of the second set. So letx ∈11k j j A +=U =11()kj j k A A =+U U . Either x ∈1kj j A =U or x ∈1k A +. In the first case we know bythe inductive hypothesis that x ∈1kj j B =U ; in the second case, we know from the given fact thatA k+1⊆B k+1 that x ∈1k B +. Therefore in either case x ∈11k j j B +=U .Ex49. In the inductive hypothesis, it assume x and y are positive integer. Therefore we can ’t conclude x-1=y-1 from max(x-1,y-1)=k since x-1 and y-1 can be not positive.4.2: P293Ex12. The basis step is to note that 1=20. Assume the inductive hypothesis, that every positive integer up to k can be written as a sum of distinct powers of 2. We must show that k+1 can be written as a sum of distinct powers of 2. if k+1 is odd, then k is even, so 20is not part of the sum for k. therefore the sum for k+1 is the same as the sum for k with the extra term 20added. If k+1 is even, then (k+1)/2 is a positive integer, so by the inductive hypothesis (k+1)/2 can be written as a sum of distinct powers of 2. Increasing each exponent by 1 doubles the value and give us the desired sum for k+1.4.3: P308Ex6. a) valid b) valid c) invalid d) invalid e) invalid.Ex28.a) basis step: (1,2)∈S, (2,1)∈S. recursive step: if (a,b) ∈S then (a+2,b)∈S, (a,b+2)∈S and (a+1,b+1)∈S.b) basis step: (1,1)∈S. recursive step: if (a,a) ∈S then (a+1,a+1)∈S; if (a,b) ∈S then (a,a+b)∈S.c) basis step: (1,2)∈S, (2,1)∈S. recursive step: if (a,b) ∈S then (a+3,b)∈S, (a,b+3)∈S, (a+1,b+2)∈S and (a+2,b+1)∈S.4.4: P321Ex12.Procedure power(x, n, m:positive intergers)If n=1 then power(x,n,m):=x mod mElse power(x,n,m):=(x*power(x,n-1,m)) mod m4.5: P327Ex2. There are two cases. If x>=0 initially, then nothing is executed, so x>=0 at the end. If x<0 initially, then x is set equal to 0, so x=0 at the end; hence again x>=0 at the end.。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Conversely, suppose thatp→ (q∧r) is true. We need to show thatp→qis true and thatp→ristrue, which means that ifpis true, then so areqandr. But this follows fromp→ (q∧r).
1(15 points).(1);(2)equivalence; (3) ; (4)4; (5)0 (False)
2(15 points). (1)—(5): CABDA
3(15 points)..(1)—(5):
4.Proof() Supposefis onto. LetT(B), and letS= {x|xA,f(x)T}. Theng(S) =T, andgis onto. (5 points)
6.Solution
(10points)
7.Solution(1) SupposeGhasxvertices of degree 1.
3∙3 + 1∙2 +x∙ 1 = 2((x+ 4) - 1)x= 5
Ghas 9 vertices.(10points)
(2)
(5 points)
8.ProofSuppose that (p→q)∧(p→r) is true. We want to show thatp→ (q∧r) is true, which means that wewant to show thatq∧ris true wheneverpis true. Ifpis true, since we know that bothp→qandp→rare true from our assumption, we can conclude thatqis true and thatris true. Thereforeq∧ris true, asdesired.
() Iffis not ontoB, letyB–f(A), then there is no subsetSofAsuch thatg(S) = {y}. (5 points)
5.Solutiont(R) ={(a,a),(b,a),(b,c),(c,a),(c,c),(c,d),(d,a),(d,c),(d,d), (b,d)}.(5 poin019学年第学期

考试时间
120分钟
考核方式
学生类别
人数
120
适用专业或科类
计信院软件专业
年级
2014级
题号
合计
得分
签名
阅卷须知:阅卷用红色墨水笔书写,得分用阿拉伯数字写在每小题题号前,用正分表示,不得分则在题号前写0;大题得分登录在对应的分数框内;统一命题的课程应集体阅卷,流水作业;阅卷后要进行复核,发现漏评、漏记或总分统计错误应及时更正;对评定分数或统分记录进行修改时,修改人必须签名。
相关文档
最新文档