Discrete Mathematics Recitation Course 2tiger.ee.nctu.edu.tw/course/Discrete2015/Practice...

Preview:

Citation preview

Discrete MathematicsRecitation Course 2

2013.03.14ๅผต็ŽŸ็ฟ”

Acknowledge ้„ญๅฎ‰ๅ“ฒTA 2012

2-1

Sets

2-1 Ex.8

โ€ข Determine whether these statements are true or false.โ€“ a) โˆ… โˆˆ {โˆ…}โ€“ b) โˆ… โˆˆ {โˆ…, {โˆ…}}โ€“ c) โˆ… โˆˆ {โˆ…}โ€“ d) โˆ… โˆˆ {{โˆ…}}โ€“ e) โˆ… โŠ‚ {โˆ…, {โˆ…}}โ€“ f) {โˆ…} โŠ‚ {โˆ…, {โˆ…}}โ€“ g) {โˆ…} โŠ‚ {{โˆ…}, {โˆ…}}

truetruefalsetruetruetruefalse, 2 sets are equal

Cardinality

โ€ข 2-1 Ex.18What is the cardinality of each of these sets?โ€“ a) ร˜โ€“ b) {ร˜} โ€“ c) {ร˜, {ร˜} } โ€“ d) {ร˜, {ร˜} ,{ร˜,{ร˜}}}

01

23

Power Set

โ€ข 2-1 Ex.22Determine whether each of these sets is the power set of a set, where ๐‘Ž๐‘Ž and ๐‘๐‘ are distinct elementsโ€“ a) ร˜โ€“ b) {ร˜, {a}}โ€“ c) {ร˜, {a}, {ร˜, a}}โ€“ d) {ร˜, {a}, {b}, {a, b}} {๐‘Ž๐‘Ž, ๐‘๐‘}

{๐‘Ž๐‘Ž}x

x

Cartesian Products

โ€ข 2-1 Ex.32Explain why (๐ด๐ด ร— ๐ต๐ต) ร— (๐ถ๐ถ ร— ๐ท๐ท)and ๐ด๐ด ร— (๐ต๐ต ร—๐ถ๐ถ) ร— ๐ท๐ท are not the sameโ€“ The first is a pair, and the second is a triple

โ€ข What about ๐ด๐ด ร— โˆ…?โ€ข The Cartesian products ๐ด๐ด ร— ๐ต๐ต and ๐ต๐ต ร— ๐ด๐ด are

not equal, unless ๐ด๐ด = โˆ… or ๐ต๐ต = โˆ… (so that ๐ด๐ด ร—๐ต๐ต = โˆ… ) or ๐ด๐ด = ๐ต๐ต

Cartesian Products (contโ€™d)

โ€ข 2-1 Ex.36Suppose that ๐ด๐ด ร— ๐ต๐ต = โˆ… , where ๐ด๐ด and ๐ต๐ต are sets, what can you conclude?โ€“ We conclude that ๐ด๐ด = โˆ… or ๐ต๐ต = โˆ…โ€“ To prove this, suppose that neither ๐ด๐ด nor ๐ต๐ต were emptyโ€“ Then there would be elements ๐‘Ž๐‘Ž โˆˆ ๐ด๐ด or ๐‘๐‘ โˆˆ ๐ต๐ตโ€“ This would give at least one element, namely (๐‘Ž๐‘Ž, ๐‘๐‘) in ๐ด๐ด ร— ๐ต๐ต, so ๐ด๐ด ร— ๐ต๐ต would not be the empty set

โ€“ This contradiction shows that either ๐ด๐ด or ๐ต๐ต (or both, it goes without saying) is empty

2-2

Set Operations

2-2 Ex.4

โ€ข Let ๐ด๐ด = {๐‘Ž๐‘Ž, ๐‘๐‘, ๐‘๐‘,๐‘‘๐‘‘, ๐‘’๐‘’} and ๐ต๐ต ={๐‘Ž๐‘Ž, ๐‘๐‘, ๐‘๐‘,๐‘‘๐‘‘, ๐‘’๐‘’, ๐‘“๐‘“,๐‘”๐‘”, โ„Ž}. Findโ€“ a) ๐ด๐ด โˆช ๐ต๐ตโ€“ b) ๐ด๐ด โˆฉ ๐ต๐ตโ€“ c) ๐ด๐ด โˆ’ ๐ต๐ตโ€“ d) ๐ต๐ต โˆ’ ๐ด๐ด

๐‘Ž๐‘Ž, ๐‘๐‘, ๐‘๐‘,๐‘‘๐‘‘, ๐‘’๐‘’, ๐‘“๐‘“,๐‘”๐‘”,โ„Ž = ๐ต๐ต๐‘Ž๐‘Ž, ๐‘๐‘, ๐‘๐‘,๐‘‘๐‘‘, ๐‘’๐‘’ = ๐ด๐ดโˆ…๐‘“๐‘“,๐‘”๐‘”,โ„Ž

Mutual Subsets

โ€ข 2-2 Ex.20โ€ข Show that if A and B are sets, then ๐ด๐ด โˆฉ ๐ต๐ต โˆช

๐ด๐ด โˆฉ ๏ฟฝ๐ต๐ต = ๐ด๐ด.

โ€ข ๐ด๐ด โŠ† ๐ด๐ด โˆฉ ๐ต๐ต โˆช ๐ด๐ด โˆฉ ๏ฟฝ๐ต๐ต : every element ๐‘ฅ๐‘ฅ โˆˆ ๐ด๐ดis an element of either๐ด๐ด โˆฉ ๐ต๐ต(if ๐‘ฅ๐‘ฅ โˆˆ ๐ต๐ต ) or ๐ด๐ด โˆฉ๏ฟฝ๐ต๐ต (if ๐‘ฅ๐‘ฅ โˆ‰ ๐ต๐ต).

โ€ข If ๐‘ฅ๐‘ฅ โˆˆ ๐ด๐ด โˆฉ ๐ต๐ต โˆช ๐ด๐ด โˆฉ ๏ฟฝ๐ต๐ต , then either ๐‘ฅ๐‘ฅ โˆˆ ๐ด๐ด โˆฉ๐ต๐ต or ๐‘ฅ๐‘ฅ โˆˆ ๐ด๐ด โˆฉ ๏ฟฝ๐ต๐ต. In either case, ๐‘ฅ๐‘ฅ โˆˆ ๐ด๐ด.

Membership Table

โ€ข 2-2 Ex.35โ€ข Show that ๐ด๐ดโจ๐ต๐ต = ๐ด๐ด โˆช ๐ต๐ต โˆ’ (๐ด๐ด โˆฉ ๐ต๐ต)

โ€ข Do not be confused with truth table

๐‘จ๐‘จ ๐‘ฉ๐‘ฉ ๐‘จ๐‘จโจ๐‘ฉ๐‘ฉ ๐‘จ๐‘จ โˆช ๐‘ฉ๐‘ฉ ๐‘จ๐‘จ โˆฉ ๐‘ฉ๐‘ฉ ๐‘จ๐‘จ โˆช ๐‘ฉ๐‘ฉ โˆ’ (๐‘จ๐‘จ โˆฉ ๐‘ฉ๐‘ฉ)0 0 0 0 0 0

0 1 1 1 0 1

1 0 1 1 0 1

1 1 0 1 1 0

2-3

Functions

2-3 Ex.6

โ€ข Find the domain and range of these functionsโ€“ b) the function that assigns to each positive integer its

largest decimal digitโ€“ c) the function that assigns to a bit string the number if

ones minus the number of zeros in the stringโ€“ e) the function that assigns to a bit string the longest string

of ones in the string

โ€ข Z+; {1,2,3,4,5,6,7,8,9,}โ€ข The set of bit strings; Zโ€ข The set of bit strings; the set of string of 1โ€™s: {ร˜,1,11,111,โ€ฆ}

2-3 Ex.8

โ€ข Find these values:โ€“ a) 1.1โ€“ b) 1.1โ€“ c) โˆ’0.1โ€“ d) โˆ’0.1โ€“ e) 2.99โ€“ f) โˆ’2.99

โ€“ g) 12

+ 12

โ€“ h) 12

+ 12

+ 12

12

โˆ’103

โˆ’21

2

1-1 and Onto Functions

2-3 Ex.12

โ€ข Determine whether each of these functions from ๐™๐™ to ๐™๐™ is one to one.โ€“ a) ๐‘“๐‘“ ๐‘›๐‘› = ๐‘›๐‘› โˆ’ 1โ€“ b) ๐‘“๐‘“ ๐‘›๐‘› = ๐‘›๐‘›2 + 1โ€“ c) ๐‘“๐‘“ ๐‘›๐‘› = ๐‘›๐‘›3

โ€“ d) ๐‘“๐‘“ ๐‘›๐‘› = ๐‘›๐‘›/2

YN, ๐‘“๐‘“ 3 = ๐‘“๐‘“ โˆ’3 = 10YN, ๐‘“๐‘“ 3 = ๐‘“๐‘“ 4 = 2

2-3 Ex.14

โ€ข Determine whether ๐‘“๐‘“:๐™๐™ ร— ๐™๐™ โ†’ ๐™๐™ is onto ifโ€“ a) ๐‘“๐‘“ ๐‘š๐‘š,๐‘›๐‘› = 2๐‘š๐‘š โˆ’ ๐‘›๐‘›โ€“ b) ๐‘“๐‘“ ๐‘š๐‘š,๐‘›๐‘› = ๐‘š๐‘š2 โˆ’ ๐‘›๐‘›2

โ€“ c) ๐‘“๐‘“ ๐‘š๐‘š,๐‘›๐‘› = ๐‘š๐‘š + ๐‘›๐‘› + 1โ€“ d) ๐‘“๐‘“ ๐‘š๐‘š,๐‘›๐‘› = ๐‘š๐‘š โˆ’ |๐‘›๐‘›|โ€“ e) ๐‘“๐‘“ ๐‘š๐‘š,๐‘›๐‘› = ๐‘š๐‘š2 โˆ’ 4

YNYYN

2-3 Ex.18

โ€ข Determine whether each of these functions is a bijection from ๐‘๐‘ to ๐‘๐‘โ€“ a) ๐‘“๐‘“ ๐‘ฅ๐‘ฅ = โˆ’3๐‘ฅ๐‘ฅ + 4โ€“ b) ๐‘“๐‘“ ๐‘ฅ๐‘ฅ = โˆ’3๐‘ฅ๐‘ฅ2 + 7โ€“ c) ๐‘“๐‘“ ๐‘ฅ๐‘ฅ = (๐‘ฅ๐‘ฅ + 1)/(๐‘ฅ๐‘ฅ + 2)โ€“ d) ๐‘“๐‘“ ๐‘ฅ๐‘ฅ = ๐‘ฅ๐‘ฅ5 + 1

โ€ข ๐‘“๐‘“โˆ’1 ๐‘ฅ๐‘ฅ = (4 โˆ’ ๐‘ฅ๐‘ฅ)/3โ€ข not 1-1 since ๐‘“๐‘“ 17 = ๐‘“๐‘“(โˆ’17), and not onto since the range is (โˆ’โˆž, 7]โ€ข ๐‘“๐‘“โˆ’1 ๐‘ฅ๐‘ฅ = (1 โˆ’ 2๐‘ฅ๐‘ฅ)/(๐‘ฅ๐‘ฅ โˆ’ 1), bijection, but not from ๐‘๐‘ to ๐‘๐‘โ€ข ๐‘“๐‘“โˆ’1 ๐‘ฅ๐‘ฅ = 5 ๐‘ฅ๐‘ฅ โˆ’ 1

2-3 Ex.34

โ€ข Let ๐‘“๐‘“ ๐‘ฅ๐‘ฅ = ๐‘Ž๐‘Ž๐‘ฅ๐‘ฅ + ๐‘๐‘ and ๐‘”๐‘” ๐‘ฅ๐‘ฅ = ๐‘๐‘๐‘ฅ๐‘ฅ + ๐‘‘๐‘‘, where ๐‘Ž๐‘Ž, ๐‘๐‘, ๐‘๐‘, and ๐‘‘๐‘‘ are constaints. Determine for which constants ๐‘Ž๐‘Ž, ๐‘๐‘, ๐‘๐‘, and ๐‘‘๐‘‘ it is true that ๐‘“๐‘“ โˆ˜ ๐‘”๐‘” = ๐‘”๐‘” โˆ˜ ๐‘“๐‘“.

โ€ข ๐‘“๐‘“ โˆ˜ ๐‘”๐‘” ๐‘ฅ๐‘ฅ = ๐‘Ž๐‘Ž๐‘๐‘๐‘ฅ๐‘ฅ + ๐‘Ž๐‘Ž๐‘‘๐‘‘ + ๐‘๐‘โ€ข ๐‘”๐‘” โˆ˜ ๐‘“๐‘“ ๐‘ฅ๐‘ฅ = ๐‘๐‘๐‘Ž๐‘Ž๐‘ฅ๐‘ฅ + ๐‘๐‘๐‘๐‘ + ๐‘‘๐‘‘โ€ข โ†’ ๐‘Ž๐‘Ž๐‘‘๐‘‘ + ๐‘๐‘ = ๐‘๐‘๐‘๐‘ + ๐‘‘๐‘‘

2-3 Ex.68

โ€ข Suppose that ๐‘“๐‘“ is a function from ๐ด๐ด to ๐ต๐ต, where ๐ด๐ด and ๐ต๐ต are finite sets with |๐ด๐ด| = |๐ต๐ต|Show that ๐‘“๐‘“ is one-to-one iff it is onto

โ€ข 1-1 โ†’ onto:โ€“ if not onto, |๐ต๐ต| is at least one greater than |๐ด๐ด|

โ€ข onto โ†’ 1-1:โ€“ if not 1-1, |๐ด๐ด| is at least one greater than |๐ต๐ต|

2-S Ex.13

โ€ข Let ๐‘“๐‘“ and ๐‘”๐‘” be functions from {1, 2, 3, 4} to {๐‘Ž๐‘Ž, ๐‘๐‘, ๐‘๐‘,๐‘‘๐‘‘} and from {๐‘Ž๐‘Ž, ๐‘๐‘, ๐‘๐‘,๐‘‘๐‘‘} to {1, 2, 3, 4}respectively, such that ๐‘“๐‘“ 1 = ๐‘‘๐‘‘, ๐‘“๐‘“(2) = ๐‘๐‘, ๐‘“๐‘“(3) = ๐‘Ž๐‘Ž, ๐‘“๐‘“(4) = ๐‘๐‘ and ๐‘”๐‘”(๐‘Ž๐‘Ž) = 2, ๐‘”๐‘”(๐‘๐‘) = 1, ๐‘”๐‘”(๐‘๐‘) = 3, ๐‘”๐‘”(๐‘‘๐‘‘) = 2โ€“ a) Is ๐‘“๐‘“ one-to-one? Is ๐‘”๐‘” one-to-one? โ€“ b) Is ๐‘“๐‘“ onto? Is ๐‘”๐‘” onto?โ€“ c) Does either ๐‘“๐‘“ or ๐‘”๐‘” have an inverse?

Y; NY; N

Y; N

Floor and Ceiling Functions

2-3 Ex.54

โ€ข How many bytes are required to encode ๐‘›๐‘› bits of data where ๐‘›๐‘› equals โ€“ a) 4?โ€“ b) 10?โ€“ c) 500?โ€“ d) 3000?

4/8 = 110/8 = 2500/8 = 633000/8 = 375

2-3 Ex.70 -c)

โ€ข Prove ๐‘ฅ๐‘ฅ/2 /2 = ๐‘ฅ๐‘ฅ/4 for all real number ๐‘ฅ๐‘ฅ

โ€ข Let ๐‘ฅ๐‘ฅ = 4๐‘›๐‘› + ๐‘˜๐‘˜, where 0 โ‰ค ๐‘˜๐‘˜ < 4โ€ข if ๐‘˜๐‘˜ = 0 โ†’ ๐‘›๐‘› = ๐‘›๐‘›, trueโ€ข if 0 < ๐‘˜๐‘˜ โ‰ค 2, then ๐‘ฅ๐‘ฅ/2 = 2๐‘›๐‘› + 1, ๐‘›๐‘› + 1/2 = ๐‘›๐‘› + 1โ€ข if 2 < ๐‘˜๐‘˜ < 4, then ๐‘ฅ๐‘ฅ/2 = 2๐‘›๐‘› + 2, ๐‘›๐‘› + 1 = ๐‘›๐‘› + 1โ€ข Since we proved all cases, the proof is complete

2-4

Sequences and Summations

2-4 Ex.8

โ€ข Find at least three different sequences beginning with the terms 3, 5, 7 whose terms are generated by a simple formula or rule.

โ€ข 3, 5, 7, 9, 11, 13, โ€ฆ .โ€ข 3, 5, 7, 11, 13, 17, โ€ฆ .โ€ข Solve ๐‘ฆ๐‘ฆ = ๐ด๐ด๐‘ฅ๐‘ฅ3 + ๐ต๐ต๐‘ฅ๐‘ฅ2 + ๐ถ๐ถ๐‘ฅ๐‘ฅ + ๐ท๐ท where (1, 3),

(2, 5), (3, 7), (4, ๐‘›๐‘›) have been plugged in for ๐‘ฅ๐‘ฅand ๐‘ฆ๐‘ฆ.

2-4 Ex.10

โ€ข For each of these lists of integers, provide a simple formula or rule that generates the terms of an integer sequence that begins with the given list. Assuming that your formula or rule is correct, determine the next three terms of the sequence.โ€“ a) 3, 6, 11, 18, 27, 38, 51, 66, 83, 102, โ€ฆโ€“ d) 1, 2, 2, 2, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, โ€ฆโ€“ e) 0, 2, 8, 26, 80, 242, 728, 2186, 6560, 19682, โ€ฆ

โ€ข ๐‘›๐‘›2 + 2; 123, 146, 171โ€ข for different value ๐‘›๐‘›, ๐‘›๐‘›๐‘˜๐‘˜ = ๐‘›๐‘›๐‘˜๐‘˜โˆ’2 + ๐‘›๐‘›๐‘˜๐‘˜โˆ’1; 8, 8, 8โ€ข ๐‘›๐‘›3 โˆ’ 1; 59048, 177146, 531440

2-4 Ex.32

โ€ข Determine whether each of these sets is countable or uncountable. For those that are countable, exhibit a one-to-one correspondence between the set of natural numbers and that set.โ€“ a) the integers greater than 10โ€“ d) integers that are multiples of 10

โ€ข This set is countable; in general ๐‘›๐‘› โ†” (๐‘›๐‘› + 10).โ€ข This set is countable; 1 โ†” 0, 2 โ†” 10, 3 โ†” โˆ’10, 4 โ†”

20, 5 โ†” โˆ’20, 6 โ†” 30, and so on.

Recommended