Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Large numbers wikipedia , lookup
Abuse of notation wikipedia , lookup
List of first-order theories wikipedia , lookup
Mathematics of radio engineering wikipedia , lookup
History of the function concept wikipedia , lookup
Collatz conjecture wikipedia , lookup
Function (mathematics) wikipedia , lookup
Elementary mathematics wikipedia , lookup
Naive set theory wikipedia , lookup
Proofs of Fermat's little theorem wikipedia , lookup
THE ISLAMIC UNIVERSITY OF GAZA ENGINEERING FACULTY DEPARTMENT OF COMPUTER ENGINEERING DISCRETE MATHMATICS DISCUSSION – ECOM 2011 Eng. Huda M. Dawoud November, 2015 DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD Section 1: Sets 1. Use set builder notation to give a description of each of these sets. a) {0, 3, 6, 9, 12} b) {−3,−2,−1, 0, 1, 2, 3} Note: This question has more than one correct answer. c) {m, n, o, p} Answer: a) { 3n | n = 0, 1, 2, 3, 4 } b) { x | −3 ≤ x ≤ 3 }, where x is integer. c) {x | x is a letter of the word monop }. 4. For each of these pairs of sets, determine whether the first is a subset of the second, the second is a subset of the first, or neither is a subset of the other. a) the set of people who speak English, the set of people who speak English with an Australian accent b) the set of fruits, the set of citrus fruits c) the set of students studying discrete mathematics, the set of students studying data structures Answer: Note: A ⊆ B, when every element in A is an element in B. In (a) we can say that people who speak English with an Australian accent are people who speak English, but not vice versa. a) The second is a subset of the first, but not vice versa. b) The second set is a subset of the first, but not vice versa. c) There could be students studying discrete mathematics but not data structures and students studying data structure but not discrete, so neither set is a subset of the other. DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD 5. Determine whether each of these pairs of sets are equal. a) {1, 3, 3, 3, 5, 5, 5, 5, 5}, {5, 3, 1} b) {{1}}, {1, {1}} c) ∅, {∅} Answer: a) Yes; order and multiple listing make no difference. b) No; the first set has one element {1}, and the second has two elements 1 and {1}. c) No; the first set has no elements, and the second has one element ∅. 10. Determine whether these statements are true or false. a) ∅ ∈ {∅} b) ∅ ∈ {∅, {∅}} d) {∅} ∈ {{∅}} e) {∅} ⊂ {∅, {∅}} g) {{∅}} ⊂ {{∅}, {∅}} Answer: c) {∅} ∈ {∅} f ) {{∅}} ⊂ {∅, {∅}} Note: To solve this question you need to know that ∅ differs from {∅} which also differs from {{∅}}. That, the first one is the empty set ∅, the second is a set with the empty set ∅ as an element, the last one is a set with {∅} as an element. a) true b) true c) false d) true e) true-the one element in the set on the left is an element of the set on the right, and the sets are not equal f) true Note: When we see the ⊆ operator g) false-the two sets are equal we treat the two sides as sets, but The statement {{∅}} ⊆ {{∅}, {∅}} is true. when we see the ∊ operator we treat the left side as an element and the right side as a set. DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD 12. Use a Venn diagram to illustrate the subset of odd integers in the set of all positive integers not exceeding 10. Answer: 10 1 3 5 2 4 8 7 9 6 14. Use a Venn diagram to illustrate the relationship A ⊆ B and B ⊆ C. Answer: B A C 15. Use a Venn diagram to illustrate the relationships A ⊂ B and B ⊂ C. B A C الحظي االختالف بين:توضيح هو إضافة15 وسؤال14 سؤال ،النقاط للداللة على العناصر A حتى نلغي احتمال أن تكون وذلك أن هناكB هي نفسها .A غير موجود فيB عنصر في 16. Use a Venn diagram to illustrate the relationships A ⊂ B and A ⊂ C. DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD 18. Find two sets A and B such that A ∈ B and A ⊆ B. Answer: A = Ø and B = {Ø}, such that Ø ∈ {Ø} and Ø ⊆ {Ø}, As we previously know that Ø is a subset of any set. 20. What is the cardinality of each of these sets? a) ∅ b) {∅} c) {∅, {∅}} d) {∅, {∅}, {∅, {∅}}} Answer: a) The empty set has no elements, so its cardinality is 0. b) This set has one element (the empty set ∅), so its cardinality is 1. c) This set has two elements, so its cardinality is 2. d) This set has three elements ∅, {∅} and {∅, {∅}}, so its cardinality is 3. 21. Find the power set of each of these sets, where a and b are distinct elements. a) {a} b) {a, b} c) {∅, {∅}} Answer: a) {∅, {a}} b) {∅, {a}, {b}, {a,b}} c) {∅,{∅},{{∅}},{∅,{∅}}} DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD 28. What is the Cartesian product A × B, where A is the set of courses offered by the mathematics department at a university and B is the set of mathematics professors at this university? Give an example of how this Cartesian product can be used. Answer: By definition it is the set of all ordered pairs (c, p) such that c is a course and p is a professor. The elements of this set are the possible teaching assignments for the mathematics department. الضرب اإلتجاهي:مالحظة يعطيCartesian product كل االحتماالت الممكنة الرتباط B مع العناصر فيA العناصر في .على شكل أزواج مرتبة 35. How many different elements does A × B have if A has m elements and B has n elements? Answer: m×n 40. Explain why (A × B) × (C × D) and A × (B × C) × D are not the same. Answer: The elements of (A × B) × (C × D) consist of ordered pairs (x, y), where x ∊ A×B and y ∊ C ×D, so the typical element of (A×B)×(C ×D) looks like ((a, b), (c, d)). The elements of A×(B ×C)×D consist of 3-tuples (a, x, d), where a ∊ A, d ∊ D, and x ∊ B × C, so the typical element of A × (B × C) × D looks like (a, (b, c), d). The structures ((a, b), (c, d)) and (a, (b, c), d) are different, thus (A × B) × (C × D) and A × (B × C) × D are not the same. DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD Section 2: Set Operations 1. Let A be the set of students who live within one mile of school and let B be the set of students who walk to classes. Describe the students in each of these sets. a) A ∩ B b) A ∪ B c) A − B d) B – A Answer: a) the set of students who live within one mile of school and walk to class. b) the set of students who either live within one mile of school or walk to class. c) the set of students who live within one mile of school but do not walk to class. d) the set of students who walk to classes but don’t live within one mile of school. 6. Prove the identity laws in Table 1 by showing that a) A ∪ ∅ = A. Answer: b) A ∩ U = A. Notes: A ∪ B = { x | x ∈ A ∨ x ∈ B} A ∩ B = { x | x ∈ A ∧ x ∈ B} A – B = {x | x ∈ A ∧ x ∉ B} x∈Ø=F x∉Ø=T a) A ∪ Ø = { x | x ∈ A ∨ x ∈ Ø} = { x | x ∈ A ∨ F} = { x | x ∈ A} = A b) A ∩ U = { x | x ∈ A ∧ x ∈ U } = { x | x ∈ A ∧ T} = { x | x ∈ A} = A DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD 9. Prove the complement laws in Table 1 by showing that a) A ∪ A = U. b) A ∩ A = ∅. Answer: a) We must show that every element (of the universal set) is in A ∪ A. This is clear, since every element is either in A (and hence in that union) or else not in A (and hence in that union). b) We must show that no element is in A ∩ A. This is clear, since A ∩ A consists of elements that are in A and not in A at the same time, obviously an impossibility. 12. Prove the first absorption law from Table 1 by showing that if A and B are sets, then A ∪ (A ∩ B) = A. Answer: To prove that A ∪ (A ∩ B) ⊆ A Let x ∈ (A ∪ (A ∩ B)) ≡ x ∈ A or x ∈ (A ∩ B) ≡ x ∈ A or (x ∈ A and x ∈ B) From the left side we get that x ∈ A which means that A ∪ (A ∩ B) ⊆ A To prove that A ⊆ A ∪ (A ∩ B) Let x ∈ A From the left side we get that x ∈ A which makes the right side x ∈ A or (x ∈ A and x ∈ B) true which means that A ⊆ A ∪ (A ∩ B) Note: To show that two sets, for example A and B are equal we need to show that A ⊆ B and B ⊆ A :مالحظة A الثبات أن مجموعة x نفرض عنصرB مجموعة أخرى يعبر عن جميعA ينتمي للمجموعة جزئية من وإذا،العناصر التي تنتمي اليها استطعنا اثبات أنه ينتمي A ⊆ B نكون أثبتنا أنB للمجموعة وبشكل عام في كل أسئلة البراهين نفرض عنصر ينتمي للمجموعة ونحاول اثبات انه ينتمي للمجموعة .األخرى فيتحقق البرهان DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD 14. Find the sets A and B if A − B = {1, 5, 7, 8}, B − A ={2, 10}, and A ∩ B = {3, 6, 9}. Answer: 1 5 A 7 8 3 9 6 2 10 B A = {1, 3, 5, 6, 7, 8, 9}. B = {2, 3, 6, 9, 10}. :توضيح نسهل على أنفسنا الحل من خالل الرسم A ∩ B = {3, 6, 9} A تعني أن هناك تقاطع فنرسم B تتقاطع مع وغيرA العناصر الموجودة فيA – B ... وهكذاB موجودة في Note: A = (A − B) + (A ∩ B) B = (B − A) + (A ∩ B) 20. Show that if A and B are sets with A ⊆ B, then a) A ∪ B = B. b) A ∩ B = A. Answer: a) we need to prove that A ∪ B ⊆ B and B ⊆ A ∪ B Let x ∈ A ∪ B, then x ∈ A (which means that x ∈ B, because we are given that A ⊆ B) or x ∈ B. Thus, A ∪ B ⊆ B. And we know that B ⊆ A ∪ B. b) Same as a) DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD 29. What can you say about the sets A and B if we know that a) A ∪ B = A? b) A ∩ B = A? c) A − B = A? d) A ∩ B = B ∩ A? e) A − B = B − A? Answer: a) If B adds nothing new to A, then we can conclude that all the elements of B were already in A. In other words, B ⊆ A. b) In this case, all the elements of A are forced to be in B as well, so we conclude that A ⊆ B. c) This equality holds precisely when none of the elements of A are in B (if there were any such elements, then A - B would not contain all the elements of A). Thus we conclude that A and B are disjoint (A ∩ B = 0). d) We can conclude nothing about A and B in this case, since this equality always holds. e) Every element in A - B must be in A, and every element in B - A must not be in A. Since no item can be in A and not be in A at the same time, there are no elements in both A - B and B - A. Thus the only way for these two sets to be equal is if both of them are the empty set ∅. :توضيح A, B ومن خاللها طلب معلومات نستنتجها عن المجموعتينstatement في هذا السؤال أعطاني ..إن أمكننا ذلك هذا، لم تضيف أي عناصر جديدة لالتحادB معنى ذلك أناA كانت الناتجB وA عند اتحادa في الفرع . أو أنها فارغة ∅ والتي تعتبر جزئية من أي مجموعةA جزئية منB قد يعني أن كاملة هي العناصرA هذا يعني أن عناصرA تقاطع المجموعتين أنتج المجموعةb في الفرع .A ⊆ B المشتركة بين المجموعتين مما يعني أن ال تتقاطع معA كاملة مما يعني أنA هيB وغير موجودة فيA العناصر الموجودة فيc في الفرع . في أي عنصرB . ال نستطيع استنتاج أي شئ ألن التقاطع عمليه تبديلية صحيحة على كل المجموعاتd في الفرع B هي نفسها العناصر الموجودة فيB وغير موجودة فيA في الفرع األخير العناصر الموجودة في A بحيث العنصر ينتمي إلى، وهذا غير منطقي على مجموعتين تحتويان عناصرA وغير موجودة في ∅ فقط تنطبق هذه الحالة في المجموعةA وال ينتمي لB هو نفسه الذي ينتمي ل DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD 32. Find the symmetric difference of {1, 3, 5} and {1, 2, 3}. Answer: {2, 5} Note: Symmetric difference A ⊕ B, is the set containing those elements in either A or B, but not in both A and B. 47. Let Ai = {1, 2, 3, . . . , i} for i = 1, 2, 3, . . . . Find 𝑛 𝑛 𝑎) ⋃ 𝐴𝑖 𝑖=1 𝑏) ⋂ 𝐴𝑖 𝑖=1 Answer: a) A1 = {1}, A2 = {1, 2},…, An = {1, 2, 3, …, n} 𝑛 ⋃ 𝐴𝑖 = 𝐴1 ∪ 𝐴2 ∪ … ∪ 𝐴𝑛 = {1, 2,3, … , 𝑛} 𝑖=1 b) 𝑛 ⋂ 𝐴𝑖 = 𝐴1 ∩ 𝐴2 ∩ … ∩ 𝐴𝑛 = {1} 𝑖=1 DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD Section 3: Functions :توضيح هو عالقة تربط مجموعتين بحيث كل عنصر في المجموعة األولى يرتبط بعنصر واحد فقطfunction ال .من المجموعة الثانية 2. Determine whether f is a function from Z to R if a) f(n) = ±n. b) f(n) = √(n2 + 1). c) f(n) = 1/(n2 − 4). Answer: Remember: R: Real numbers Z: Integers N: Natural numbers Q: Rational numbers P: Irrational numbers a) We do not know whether f(3) = 3 or f(3) = −3. For a function, it cannot be both at the same time.. b) This is a function. For all integers n, √n2 + 1 is a well-defined real number. c) This is not a function with domain Z, since the value f(n) is not defined for n = 2 (and also for n = −2) which is (1/0). :مالحظة فيfunction يكونc النقطة من-2 و2 حالة استثنينا .domainال DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD 4. Find the domain and range of these functions. Note that in each case, to find the domain, determine the set of elements assigned values by the function. a) the function that assigns to each nonnegative integer its last digit b) the function that assigns the next largest integer to a positive integer c) the function that assigns to a bit string the number of one bits in the string d) the function that assigns to a bit string the number of bits in the string Answer: a) The domain is the set of nonnegative integers, and the range is the set of digits (0 through 9). b) The domain is the set of positive integers, and the range is the set of integers greater than 1. c) The domain is the set of all bit strings, and the range is the set of nonnegative integers. d) The domain is the set of all bit strings, and the range is the set of nonnegative integers (a bit string can have length 0). Remember: Bit String: is a string contains ones and zeros, for example: 101, 10001, 1101001. 8. Find these values. a) 1.1 b) 1.1 c) −0.1 e) 2.99 f) −2.99 g) 1 2 + d) −0.1 1 h) 2 Answer: a) 1 b) 2 c) −1 d) 0 e) 3 f) −2 g) 1 h) 2 1 2 + 1 2 + 1 2 DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD 12. Determine whether each of these functions from Z to Z is one-to-one. a) f(n) = n − 1 b) f(n) = n2 + 1 c) f(n) = n3 d) f(n) = n/2 Answer: :توضيح من الضروري13 و12 في سؤال domain والrange االنتباه جيداً لل ألن اإلجابة،المحدد في السؤال .تختلف كلياً باختالفهما a) This is one-to-one, since if n1 − 1 = n2 − 1, then n1 = n2. b) This is not one-to-one, since, for example, f(3) = f(−3) = 10. c) This is one-to-one, since if n13= n23, then n1 = n2 (take the cube root of each side). d) This is not one-to-one, since, for example, f(3) = f(4) = 2. Remember: A function is one-to-one (1-1), or injective, or an injection, IFF every element of its range has only 1 pre-image. أن domain بحيث ال يمكن لنقطتين في ال،domain مرتبط بعنصر واحد فقط في الrangeكل عنصر في ال . إال إن كانتا متساويتينrangeيكون لهما نفس الصورة في ال 13. Which functions in Exercise 12 are onto? Answer: a) This function is onto, since every integer is 1 less than some integer. b) This function is not onto. Since n2 + 1 is always positive, the range cannot include any negative integers. c) This function is not onto, since the integer 2, for example, is not in the range. In other words, 2 is not the cube of any integer. d) This function is onto. Remember: A function f: A⟶B is onto or surjective or a surjection IFF its range is equal to its codomain (∀b∈B, ∃a∈A: f(a)=b). غير مرتبط مع أي range ال يوجد عنصر في ال،domain له عنصر يرتبط به في الrangeكل عنصر في ال .domainعنصر في ال DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD 22. Determine whether each of these functions is a bijection from R to R. a) f(x) = −3x + 4 b) f(x) = −3x2 + 7 c) f(x) = (x + 1)/(x + 2) d) f(x) = x5 + 1 Answer: Note: To get the inverse in a) we convert x to y and y to x then get y in the left side, such that x = -3y + 4 => y = (x – 4) / -3 a) This is a bijection since f(x) is one-to-one and onto, the inverse function is f−1(x) = (4 − x)/3. b) This is not one-to-one since f(17) = f(−17), for instance. It is also not onto, since the range is the interval (−∞, 7]. For example, 42548 is not in the range. c) This function is a bijection, but not from R to R. To see that the domain and range are not R, note that x = −2 is not in the domain, and x = 1 is not in the range. On the other hand, f is a bijection from R − {−2} to R − {1}, since its inverse is f−1(x) = (1 − 2x)/(x − 1). d) It is clear that this continuous function is increasing throughout its entire domain (R) and it takes on both arbitrarily large values and arbitrarily small (large negative) ones. So it is a bijection. Its inverse is 5 clearly f−1(x) = 𝑥 − 1 . Remember: A function f is a one-to-one correspondence, or a bijection, or reversible, or invertible, IFF it is both one-to-one and onto. Such that f-1 ᴏ f=1 36. Find f ᴏ g and g ᴏ f, where f(x) = x2 + 1 and g(x) = x + 2, are functions from R to R. Answer: (f ᴏ g)(x) = f(g(x)) = f(x + 2) = (x + 2)2 + 1 = x2 + 4x + 5 (g ᴏ f)(x) = g(f(x)) = g(x2 + 1) = x2 + 1 + 2 = x2 + 3. Note that they are not equal. DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD Section 4: Sequences and Summations هي عالقة يتم من خاللها إيجاد عناصر متتالية ما من خالل العناصر السابقة لهذهRecurrence relation .المتتالية 2. What is the term a8 of the sequence {an} if an equals a) 2n−1? b) 7? c) 1 + (−1)n? d) −(−2)n? Answer: a) 28−1 = 128 b) 7 c) 1 + (−1)8 = 0 d) −(−2)8 = −256 6. List the first 10 terms of each of these sequences. a) the sequence obtained by starting with 10 and obtaining each term by subtracting 3 from the previous term b) the sequence whose nth term is the sum of the first n positive integers. Answer: a) 10, 7, 4, 1, −2, −5, −8, −11, −14, −17 DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD b) 1, 3, 6, 10, 15, 21, 28, 36, 45, 55. These are called the triangular numbers. Note that a4 = 4 + 3 + 2 + 1 = 10. 10. Find the first six terms of the sequence defined by each of these recurrence relations and initial conditions. b) an = an−1 − an−2, a0 = 2, a1 = −1 Answer: {2, -1, -3=(-1 -2), -2=(-3 - -1), 1=(-2 - -3), 3=(1- -2)} 12. Show that the sequence {an} is a solution of the recurrence relation an = −3an−1 + 4an−2 if a) an = 0. b) an = 1. c) an = (−4)n. d) an = 2(−4)n + 3. Answer: an = −3an−1 + 4an−2 a) -3(0) + 4(0) = 0 = an sequence في هذا السؤال نريد اثبات أن ال:توضيح an = −3an−1 + 4an−2 ) هي حل للمعادلةan( وإثبات، المعطاةanطبعاً يتم ذلك من خالل التعويض ب .أنها تحقق المعادلة b) -3(1) + 4(1) = 1 = an c) -3(-4)n-1 + 4(-4)n-2 = (-4)n-2 (-3(-4) + 4) = (-4)n-2 (12 + 4) = (-4)n-2 (16) = (-4)n-2 (-4)2 = (-4)n-2+2 = (-4)n = an Remember: d) -3 (2(-4)n-1 +3) + 4 (2(-4)n-2 + 3) = -6(-4)n-1 -9 + 8(-4)n-2 + 12 = -6(-4)n-1 + 8(-4)n-2 -9+ 12 =(-4)n-2 (-6(-4) + 8) -9 +12 =(-4)n-2 (32) +3 =(-4)n-2 (16)(2) +3 = 2 (-4)n-2 (-4)2 +3 = 2(-4)n +3 = an Ax x Ay = Ax+y DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD 16. Find the solution to each of these recurrence relations with the given initial conditions. Use an iterative approach such as that used in Example 10. b) an = an−1 + 3, a0 = 1 d) an = 2an−1 − 3, a0 = −1 Answer: n بداللةan في هذا السؤال نريد ايجاد:توضيح يمكن الحل بأكثر من طريقة احداها هي التعويض عن أول أو كما في،مجموعة من العناصر ومحاولة استنتاج العالقة .المثال العاشر من الكتاب وهو المطلوب في السؤال b) an = { 1, 4, 7, 10, 13, 16, …} an = 3n + 1 an = 3 + an−1 = 3 + 3 + an−2 = 2 · 3 + an−2 = 3 · 3 + an−3 = · · · = n · 3 + an−n = n · 3 + a0 = 3n + 1 d) an = −3 + 2an−1 = −3 + 2(−3 + 2an−2) = −3 + 2(−3) + 4an−2 = −3 + 2(−3) + 4(−3 + 2an−3) = −3 + 2(−3) + 4(−3) + 8an−3 = −3 + 2(−3) + 4(−3) + 8(−3 + 2an−4) = −3 + 2(−3) + 4(−3) + 8(−3) + 16an−4 ... = −3(1 + 2 + 4 + · · · + 2n−1) + 2nan−n = −3(2n − 1) + 2n(−1) = −2n+2 + 3 26. 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 term of the sequence. a) 3, 6, 11, 18, 27, 38, 51, 66, 83, 102, . . . b) 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, . . . c) 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, . . . d) 1, 2, 2, 2, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, . . . DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD Answer: a) The first term is 3, and the nth term is obtained by adding 2n − 1 to the previous term. In other words, we successively add 3, then 5, then 7, and so on. Alternatively, we see that the nth term is n2 +2; we can see this by inspection if we happen to notice how close each term is to a perfect square, or we can fit a quadratic polynomial to the data. The next three terms are 123, 146, 171. b) This is an arithmetic sequence whose first term is 7 and whose difference is 4. Thus the nth term is 7 + 4(n − 1) = 4n + 3. Thus the next three terms are 47, 51, 55. c) The nth term is clearly the binary expansion of n. Thus the next three terms are 1100, 1101, 1110. d) The sequence consists of one 1, followed by three 2’s, followed by five 3’s, followed by seven 5’s, and so on, with the number of copies of the next value increasing by 2 each time, and the values themselves following the rule that the first two values are 1 and 2 and each subsequent value is the sum of the previous two values. Obviously other answers are possible as well. By our rule, the next three terms would be 8, 8, 8. 34. Compute each of these double sums. Answer: a) =3 3 𝑖=1 2 𝑗=1(𝑖 − 𝑗) = (1 – 1) + (1 – 2) + (2 - 1) + (2 – 2) + (3 – 1) + (3 – 2) DISCRETE MATHMATICS 40. Find ECOM 2012 ENG. HUDA M. DAWOUD 200 3 𝑘=99 𝑘 Answer: From Table 2: 200 3 2 2 𝑘=1 𝑘 = (200) (201) /2 98 3 𝑘=1 𝑘 = (98)2(99)2/2 200 3 𝑘=99 𝑘 = 200 3 𝑘=1 𝑘 – 98 3 𝑘=1 𝑘 = 404,010,000 − 23,532,201 = 380,477,799. 43. What are the values of the following products? a) 10 𝑖=0 𝑖 c) 100 𝑖 𝑖=1 −1 Answer: a) 0 × 1 × 2 × 3 × 4 × 5 × 6 × 7 × 8 × 9 × 10 = 0 c) Each factor is either 1 or -1, so the product is either 1 or -1. To see which it is, we need to determine how many of the factors are -1. Clearly there are 50 such factors, namely when i = 1, 3, 5, ... , 99. Since ( -1 )50 = 1, the product is 1. DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD Section 5: Cardinality of Sets 2. Determine whether each of these sets is finite, countably infinite, or uncountable. a) the integers greater than 10 b) the odd negative integers c) the integers with absolute value less than 1,000,000 d) the real numbers between 0 and 2 e) the set A × Z+ where A = {2, 3} f ) the integers that are multiples of 10 Answer: a) This set is countably infinite. The integers in the set are 11, 12, 13, 14, and so on. b) This set is countably infinite. The integers in the set are −1, −3, −5, −7, and so on. DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD c) This set is {−999 999,−999 998, . . . ,−1, 0, 1, . . . , 999 999}. It is finite, with cardinality 1 999 999. d) This set is infinite uncountable. Because Real numbers are infinite between 0 and 2. e) This set is countably infinite. We can list its elements in the order (2, 1), (3, 1), (2, 2), (3, 2), (2, 3), (3, 3), . . . f) This set is countably infinite. The integers in the set are 0, ±10, ±20, ±30, and so on. Sets Infinite Uncountable Finite Countable Countable If it is a subset of a countable set, such as Z+ If the exist a function from Z+ to the Set, that is one-to-one and Onto. DISCRETE MATHMATICS ECOM 2012 Section 6: Matrices 1 1. Let A = 2 1 1 1 3 0 4 6 1 3 7 a) What size is A? b) What is the third column of A? c) What is the second row of A? d) What is the element of A in the (3, 2)th position? e) What is At ? Answer: a) 3 X 4 1 b) 4 3 c) 2 0 4 6 d) 1 1 e) 1 1 3 2 0 4 6 1 1 3 7 ENG. HUDA M. DAWOUD DISCRETE MATHMATICS ECOM 2012 ENG. HUDA M. DAWOUD 6. Find a matrix A such that 1 3 2 7 1 2 1 1 𝐴= 1 0 4 0 3 −1 −3 3 3 7 Answer: 𝑎11 𝐿𝑒𝑡 𝐴 = 𝑎21 𝑎31 1 3 2 𝑎11 2 1 1 𝑎21 4 0 3 𝑎31 𝑎12 𝑎22 𝑎32 𝑎12 𝑎22 𝑎32 𝑎13 𝑎23 𝑎33 𝑎13 7 𝑎23 = 1 𝑎33 −1 1 3 0 3 −3 7 1 · a11 + 3 · a21 + 2 · a31 = 7 1 · a12 + 3 · a22 + 2 · a32 = 1 1 · a13 + 3 · a23 + 2 · a33 = 3 2 · a11 + 1 · a21 + 1 · a31 = 1 2 · a12 + 1 · a22 + 1 · a32 = 0 2 · a13 + 1 · a23 + 1 · a33 = 3 4 · a11 + 0 · a21 + 3 · a31 = −1 4 · a12 + 0 · a22 + 3 · a32 = −3 4 · a13 + 0 · a23 + 3 · a33 = 7 This is really not as bad as it looks, since each variable only appears in three equations. For example, the first, fourth, and seventh equations are a system of three equations in the three variables a11 , a21 , and a31 . We can solve them using standard algebraic techniques to obtain a11 = −1, a21 = 2 and a31 = 1. By similar reasoning we also obtain a12 = 0, a22 = 1 and a32 = −1; and a13 = 1, a23 = 0 and a33 = 1. Thus our answer is DISCRETE MATHMATICS −1 𝐴= 0 1 ECOM 2012 ENG. HUDA M. DAWOUD 0 1 1 0 −1 1 28. Find the Boolean product of A and B, where 1 A= 0 1 1 0 0 0 1 0 1 1 0 1 and B = 1 1 1 1 1 1 0 Answer: A⦿B= (1 ∧ 1) ∨ (0 ∧ 0) ∨ (0 ∧ 1) ∨ (1 ∧ 1) (1 ∧ 0) ∨ (0 ∧ 1) ∨ (0 ∧ 1) ∨ (1 ∧ 0) (0 ∧ 1) ∨ (1 ∧ 0) ∨ (0 ∧ 1) ∨ (1 ∧ 1) (0 ∧ 0) ∨ (1 ∧ 1) ∨ (0 ∧ 1) ∨ (1 ∧ 0) (1 ∧ 1) ∨ (1 ∧ 1) ∨ (1 ∧ 1) ∨ (1 ∧ 1) (1 ∧ 0) ∨ (1 ∧ 1) ∨ (1 ∧ 1) ∨ (1 ∧ 0) 1 0 = 1 1 1 1