Topic 0. Introduction Aims and objectives of the subject “Discrete mathematics”: To introduce students to some main concepts and methods of discrete mathematics (sets, relations, elements of mathematical logic, Boolean algebra, graphs, combinatorial analysis, etc.). To make students aware of some applications of discrete mathematics in the area of discrete information processing by computers. To teach students how to apply concepts and methods of discrete mathematics for solving their information processing problems (to be able to analyze the structure of discrete components and their relation in the problem and to design an algorithm that produces the required data). About the word “discrete”[dis'kri:t]: In every day English, the word “discrete” means separate, distinct. A discrete element is easily distinguished from other elements in a group (set). It is recognized clearly. In a continuous set, it’s not easy to say which value is represented by a given element. For example, in a set of real numbers, element 3.14 may represent an infinite number of rational and irrational numbers depending on the digits that follow the digit “4”. A discrete element has only one unambiguous value. There is another word “discreet”[dis'kri:t] that is pronounced in the same way but has a different meaning (of people behavior): careful and sensible in what one chooses not to say, not causing discomfort. Ex. It was not very discreet of you to call me up at the office. 1 What is the difference between the discrete mathematics and other mathematical courses? Discrete mathematics studies finite sets and countable infinite sets. Note: In a countable set, each element can be assigned a distinct integer number. It also 𝟏 does not use transition to the limit value like 𝐥𝐢𝐦 = 𝟎. 𝒏→∞ 𝒏 On the other hand, in the course of calculus, almost all sets under consideration are infinite, like the set of rational numbers, the set of all values of a function, etc. Sets studied in discrete mathematics are usually finite. But very often such finite sets contain a very large number of elements. For example, the set of all 10 Boolean functions of 10 arguments contains 22 elements. This is a huge number. A great number of elements in many sets makes it necessary to develop special methods for specification, research and analysis of such sets. Our course of discrete mathematics consists of such main parts: Graphs Basics of counting Types of algorithms and types of problems Set theory Propositional logic Predicate logic Algebra of 2-valued elements Boolean algebra Discrete mathematics and computers. Most methods of CDM are extremely useful for design and analysis of computer software and hardware. These methods are the tools for improving efficiency of existing software and hardware. On the other hand, modern powerful computers give us hope of solving problems that were out of reach in previous decades. It stimulates CDM to develop new methods for solving problems. 2 Topic 1: Basic concepts of the set theory The notion (concept) of a set is one of the initial notions of mathematics that cannot be defined quite formally. We can talk about a set of triangle edges (sides), about the set of Ukrainian words, about the set of natural numbers and so on. Synonyms of the term “set” are: a collection, a group, a class, etc. Approximately, one may say that a set is a collection of objects or ideas called elements of the set. From the examples above, we can see that the notion of a set may be applied to collections of different nature: A set of triangle sides (It contains a small, finite number of elements). A set of Ukrainian words (It contains a very large number, because nobody knows how many Ukrainian words there exist. But, for sure, this number is less than, say, one billion. So, this set is finite). A set of natural numbers (It contains an infinite amount of elements, because this set can’t be listed even theoretically. But we can easily decide if a given number is a natural one or not). Sets are usually denoted by Latin capital letters and their elements – by corresponding small letters. A = {a, b, c, d}, B = {b, d}, C = {a, b, c, d}. Note: {a, b} = {b, a} - same unordered set, curly braces, sequence of elements not important. (a, b) ≠ (b, a) – two different ordered sets, round brackets, sequence is important. {a, b, b, c} ={a, b, c} – a set does not have duplicate elements if not stated otherwise. If set B contains only elements that belong to set A then B is said to be a subset of A: B A (proper subset, not all elements of A are in B), C A (C may have all elements of A or may not). For any set A the following is true: ∅ ⊆ A, A⊆A. Two sets A and B are equal (denoted by A = B) if they consist of the same elements. This is equivalent to the condition that, for arbitrary x, if it is contained in A then it follows that x is in set B as well, and vice versa. So: For any xA (it follows) xB and for any yB yA then A = B. The number of elements in a set A is called the cardinality of A and is denoted │A│. If A = {a, b, c, d} then │A│= 4. Set P(A) is a power set of A. P(A) contains all possible subsets of set A. Ex.: A = {a, b}. P(A) = {, {a}, {b}, {a, b}}. Elements of a power set are sets themselves. There is a difference between “a” and “{a}”: - a A (A is an element of A). - {a} A; {a} A, {a} P(A). ({a} is not an element of A, it is a subset of A, and it is an element of P(A).) 3 Example. Let the set of Ivory Coast population be {Alex, Bob, … , Sam, … }. Suppose Sam is the only member of Ivory Cost team for some Winter Olympic games. In such a case the set of national teams at the games = {{US team}, {Russia team}, {Canada team}, …, {Sam}, …}. Now Sam is treated as a team. He has a team status, like the status of the US Olympic team of about 600 members. Definition: sets A and B (finite or infinite) are called equivalent (A ≈ B) if they have the same cardinality. Ex.1: A = {1, 7, 10, 15}, B = {a, b, c, d}. │A│= │B│⟹ A ≈ B. Ex.2: C = {x│ x =𝑖 3 , i ∈ N}, D = {x│ x = i -3, i∈ N}. Note: N = {1, 2, 3 …} is the set of natural numbers. │C│= │N│, │D│ = │N│ ⟹ │C│ = │D│⟹ C ≈ D. H/t: Prove that the number │P (A) │ of all subsets of a finite set A equals to 2│A│ . Methods of set specification a. Enumeration of set elements (listing element). Ex.: D = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} – set of decimal digits. A = {a, b, c, d}. b. Set comprehension (understanding/ describing the feature that unites elements in one set). C = {x│ x =𝑖 3 , i ∈ N} – set of cubes of natural numbers. c. A set can be specified by means of set operations applied to initially available sets. Ex.: 𝐴1 = {a, b}, 𝐵1 = {b, c, d}, 𝐷1 =𝐴1 ∪ 𝐵1; now 𝐷1 = {a, b, c, d}. Operations on sets It is convenient to illustrate operations on sets by means of Venn diagrams and Euler diagrams. Such diagrams are made of Euler circles. Note: Euler diagrams only have the intersection combinations that actually exist in the real world. Venn diagrams represent every hypothetically possible logical relation between categories. Venn diagrams, by definition, have to display every possible intersection combination, which creates some interesting layout issues. 4 Ex.: A = {a, b, c, d}, B = {a, b}, C = {c}. Euler diagram is made of 3 Euler circles. A C B Venn diagrams reflect the standard general relations between n sets. It is also called Venn symbol. It has 2𝑛 domains, where n is the number of sets. n=2 n=3 A A B C B and so on. 5 The union of sets A and B is a set C that contains only elements belonging to A or B. It is denoted so: C =𝐴 ∪ 𝐵. 𝐴 ∪ 𝐵 = {x│ x ∈ A or x ∈ B or both}. It is pronounced “A union B” or “Union of A and B”. Ex.:A = {a, b}, B = {b, c, d}, C=𝐴 ∪ 𝐵; now 𝐶 = {a, b, c, d}. Union of two sets is represented by such a diagram: A B Denoted C = A ∪ B The union itself consists of the domains that have any shading. Set intersection Intersection of sets A and B is a set C which contains elements that belong both to A and B. Intersection is represented by such a diagram: A B Denoted: C = A∩B. Intersection consists of the domain that has a darker shading. C = A ∩ B = {x │ x ∈ A and x ∈ B}. Ex.: A = {0, 1, 2, 3}, B = {0, 2, 4, 6}, C = {0, 2}. Using the notion of the universal set one can define the operation of the compliment of a set. Definition: A universal set contains all elements that are of interest in a given problem. 6 Set compliment A compliment of a set A is a set B that contains all the elements of the universal set that does not belong to A. Compliment is represented by such a diagram: Denoted Ā A Compliment consists of the domain without shading. Ā = {x │x ∈ U and x∉ A}. Ex.: U = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, A = {0, 2, 4, 6, 8}, Ā = {1, 3, 5, 7, 9}, where universal set is a set of decimal digits, A is a set of even digits and Ā consists of odd digits. Set difference A difference of sets A and B is a set C that consists of the elements that belong to A and don’t belong to B. Difference is represented by such diagram: A B Denoted: A - B Difference is represented by the domain with light shading. A – B = {x │ x ∈ A and x∉ B}. Ex.: A = {0, 1, 2, 3, 4}, B = 0, 2, 4, 6}, A - B = {1, 3}, B - A = {6}. Properties of difference of two sets: B - A≠A - B B - A = Ā∩ B The difference of two sets can be expressed by means of compliment and intersection of sets. 7 H/t: Draw a Venn diagram for sets: A (A∪B) ∩ B (A - B) ∪(A ∩ B) C B U H/t: Given a Venn diagram. Write a formula for each of the domains. Subsets of the universal set together with operations for sets constitute a special type of algebra. It’s called set algebra. Formulas of the set algebra transform sets into other sets. Example of a formula of the set algebra: (Ā∪ B) ∪ C. It specifies a new set, consisting of elements of sets A, B and C. Priority of operations: ¯, ∩, ∪, -. 8 Finite and infinite sets Many sets discussed in mathematics are infinite. DM is interested only in countable sets (sets where each element can get a unique counting number, that is elements are counted). Ex.: A = {x | x=𝑖 2 , i ∈N} = {1, 4, 9, 16, 25…}. Note: N is the set of all natural numbers. A is countable, so it is a discrete set. To show that A is countable, we establish a one-to-one correspondence between the elements of A and N. The doubly directed arrows represent the correspondence between 𝒊 ∈ N and x ∈ A. It is the rule how to find x for a given 𝒊 and vice versa. Note: Not all infinite sets have the same cardinality. The set of real numbers is not countable. It was proven that the set of all real numbers from 0 to 1 contains infinitely more elements than the whole set of natural numbers. 9 Vocabulary 10 Topic: “Set algebra” commutative law – коммутативный закон associative law – ассоциативный закон distributive law – дистрибутивный закон to be subject to – подчиняться elimination law – закон элиминации contradiction – противоречие excluded middle – исключенное третье Topic: “Relations” Alink – связь Cartesian product – декартово произведение sequence – последовательность Cartesian power of a set – декартова степень множества notation – обозначение triple – тройка (чего-либо) arrangement – расположение to satisfy – удовлетворять matrix / matrices – матрица / матрицы rules of precedence of operations – правила старшинства операций Topic: “Operations on sets” set union (union of sets) – объединение множеств Venn diagram – диаграмма Венна circle – окружность, круг circumference – окружность / длина окружности relation – отношение relationship – взаимоотношение, связь domain – область hatch – штриховка intersection – пересечение (множеств) compliment (of a set) – дополнение difference – разность property – свойство priority – приоритет, старшинство 11 Topic: “Basic concepts of the theory of sets” a set – множество to define – определить a triangle – треугольник an element of a set – элемент множества finite – конечный infinite – бесконечный to denote – обозначать negation – отрицание compliment – дополнение curly braces – фигурные скобки a duplicate – дубликат empty set – пустое множество to contain – содержать relevant – имеющий отношение, относящийся universal set – универсальное множество sub set – подмножество proper sub set – собственное подмножество to be equal – быть равным arbitrary – произвольный to imply – подразумевать, иметь в качестве следствия cardinality – мощность множества specify – задавать, уточнять enumeration – перечисление enumerate – перечислять comprehension–понимание 12 set comprehension – задание множества описанием × - Cartesian product ⊆- set inclusion 13