CS243, Logic and Computation Sets, functions, and languages

Size: px
Start display at page:

Download "CS243, Logic and Computation Sets, functions, and languages"

Transcription

1 CS243, Prof. Alvarez 1 NAIVE SET THEORY Prof. Sergio A. Alvarez alvarez/ Maloney Hall, room 569 alvarez@cs.bc.edu Computer Science Department voice: (617) Boston College fax: (617) Chestnut Hill, MA USA CS243, Logic and Computation Sets, functions, and languages These notes introduce standard set-theoretic concepts and notation that will be used throughout the course. 1 Naive set theory 1.1 Sets. Specification by extension A set is a collection of objects, such as the values of a particular array or the names of the seven days of the week. The objects in a set are called its elements. A set contains only one instance of each element. One way of specifying a set is by extension, that is, by an enumeration of its elements. It is customary to write curly braces around the list of elements: {Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday} {1, 0.5, 17.2, 6} Membership of an element x in a set S is denoted x S. For example, Wednesday W, where W denotes the set of the names of the days of the week. The number of the elements in a set S is denoted S. For example, W = 7. A set A is called a subset of a set B if every element of A is also an element of B; this is denoted A B or A B (even if A = B). 1.2 Equality of sets. Empty set Two sets A and B are equal if, and only if, they have the same elements, that is, if A is a subset of B and B is a subset of A. Although relative order among the elements is suggested by comma-separated list notation like that above, sets are unordered. The set of the names of the seven days of the week could be writen equivalently as follows: W = {Sunday, Wednesday, Monday, Thursday, Tuesday, Saturday, Friday} On the other hand, the two sets below are not the same: A = {1, 2, 3} B = {{1}, {2, 3}} That s because these two sets do not have the same elements. In fact, these two sets don t even have the same number of elements: A has the three elements 1, 2, 3, while B has the

2 1.3 Well-foundedness. Paradoxes 1 NAIVE SET THEORY two elements {1} and {2, 3} (each of which is a set in its own right). The special symbol is reserved for the empty set the set that has no elements. I say the empty set because there certainly can t be two: if there were, we should be able to find an element of one of the two that is not an element of the other! 1.3 Well-foundedness. Paradoxes Sets can have other sets as their elements, as we saw above. However, we will usually restrict ourselves to finite nesting depths. 1 Interesting things can happen otherwise. For example, one can consider the following set, R: R = {x x is not an element of x} The following question naturally arises here: Is R an element of itself? This rapidly leads to trouble. If R were an element of itself, that would mean that R should satisfy the condition for membership in R, namely not being an element of itself (contradiction). Likewise, if R were not an element of itself, then it would satisfy the condition for membership in R! Thus, beasts like R cannot exist in the standard sense. This example is known as Russell s paradox. 1.4 Specification of sets by intension It is possible to specify sets by intension, that is, by giving the required properties of their elements. We have already done this informally, as when describing a set as consisting of the names of the seven days of the week. Another example is the set of integers between 1 and 10, inclusive. Symbolic notation is useful in providing an intensional specification, as in this example: S = {x Z 1 x 10}, where Z is the standard name of the set of integers (from the German zahlen). Specification by intension is essentially what is used in Python list comprehension syntax: >>> L = set([x**2 for x in range(10)]) >>> L set([0, 1, 4, 81, 64, 9, 16, 49, 25, 36]) Specification by intension is particularly convenient when dealing with large sets, or in cases in which the extension of the set is incompletely understood: A = {(x, y) R 2 y = x 3 } B = {x R cos(x) = x} 1 An exception will occur in the definition of ordinal numbers.

3 1.5 Operations with sets 1 NAIVE SET THEORY 1.5 Operations with sets Boolean set operations Suppose that A and B are sets. New sets can be defined in terms of A and B as follows: ˆ The complement of A, denoted A or A or Ā, is the set of all objects that are not elements of A. Some universe set U of all possible objects is usually assumed, and the complement of A then consists of all elements of U that do not belong to A. Notice that the complement of the complement of A is just A. ˆ The union of A and B is the set A B of all objects that belong to at least one of the sets A and B. ˆ The intersection of A and B is the set A B of all objects that belong to both of the sets A and B. Associativity. Commutativity. Union and intersection are both associative and commutative. That is, for any sets A, B, C, the following equalities hold: A (B C) = (A B) C A B = B A A (B C) = (A B) C A B = B A This means that order doesn t matter in applying union or intersection operations (as long as you stick to all unions or all intersections). In particular, the union or intersection of any number of sets are well-defined and there is a simplified notation for them: n A i is the set of all objects that belong to at least one of the sets A i, for i = 1 n i=1 n A i is the set of all objects that belong to all of the sets A i, for i = 1 n i=1 The union or intersection of an infinite number of sets can also be defined. We ll normally stick to the case in which there is one operand per natural number (positive integer): A i is the set of all objects that belong to at least one of the sets A i, i = 1, 2, 3, i=1 A i is the set of all objects that belong to all of the sets A i, i = 1, 2, 3, i=1

4 1.5 Operations with sets 1 NAIVE SET THEORY Mutual distributivity of interesection and union. Theorem 1.1. If A, B, and C are sets, then A (B C) = (A B) (A C) A (B C) = (A B) (A C) Proof. We will establish the equality of the two sets in the first part of Eq. 1. To do so, let L denote the set on the left-hand side, and R the set on the right-hand side. We will show that L R and that R L. This will prove that L and R have the same extension (contain the same elements), which is what is needed. ˆ First show that L R. Take any element x of L. We must show that x must also be an element of R. Since x is in L, we know that x must belong to A and to either B or C (by definition of intersection and union, respectively). If x belongs to B, then, since x also belongs to A, we see that x belongs to A B. If on the other hand, x belongs to C, then x belongs to A C (since x belongs to A in any case). This shows that x belongs to the union that defines R. ˆ Now show that R L. Take any element x of R, and show that x must also belong to L. Examining the union that defines R, we see that x either belongs to both A and B, or else to both A and C. Since B and C are both subsets of B C, we see that x will therefore belong to A (B C) in either case. This shows that x belongs to L, and completes the proof that intersection distributes over union (top part of Eq. 1). Boolean duality identities (DeMorgan s laws). Any given object x will simultaneously be in both A and B precisely when x fails to be in either A or B. Hence, A B = (A B) Since the complement of the complement of a set is the original set, substituting A for A and B for B in the preceding equation and then taking the complement on each side yields the following additional identity: (A B) = A B Ordered tuples. Cartesian product of sets Sets are unordered, but it is convenient to have a notation for lists in which relative order matters. Custom dictates that round parentheses be used for this, as in: (3, 9, 2) Thus, 3 is the first element of this tuple, 9 is the second, and 2 is the third. The length of a tuple is the number of its elements. The above tuple has length 3. We will see later that ordered tuples can be represented using sets in a special way. Python lists are very close conceptually to tuples as we describe them here. Python tuples are close, but the immutability of Python tuples is a property that is extraneous to the mathematical notion of tuple in the present sense. (1)

5 2 OTHER OBJECTS BUILT FROM SETS: RELATIONS, FUNCTIONS Cartesian product. We can put the notion of tuple to use right away. Suppose that S 1, S k are sets. The Cartesian product (also called direct product) of these sets is the set that has as its elements all ordered tuples (x 1, x k ), where each x i is an element of the corresponding set S i. For example, the Cartesian product of the two sets {A, B, C} and {1, 2, 3, 4} is the set {(A, 1), (A, 2), (A, 3), (A, 4), (B, 1), (B, 2), (B, 3), (B, 4), (C, 1), (C, 2), (C, 3), (C, 4)}. This product is denoted S 1 S k. 2 Other objects built from sets: relations, functions 2.1 Ordered tuples. Although an ordered tuple such as (3, 9, 2) is not the same as as the set of its elements {3, 9, 2}, tuples can be constructed from ordinary unordered sets: one simply uses nesting to represent order, so that the i-the element of the tuple is located at nesting depth i. For example, the above tuple can be represented by the following set: 2.2 Relations {3, {9, {2}}} Modeling relationships among objects is very useful. For example, words can be related by syntax or semantic content, and can be related by common interests or other social connections. Relationships like these can be represented through constructs based on sets Binary relations. Domain and codomain. A binary relation describes a relationships between pairs of objects. For example, 3 < 5 is an instance of the binary relation less than, and CS243 : computer science is an instance of the binary relation course : department. A binary relationship that models friendship could have an instance such as John is friends with Mary. The domain of a relation is the set of objects on which the relation can be applied (tested). The friendship relation would have a set of people as its domain, for example (or a set of user accounts). In the case of the course : department relation, the term domain would be reserved for the set of course numbers (as these are listed first), and the set of department names would be called the codomain. Sometimes the terms domain and codomain are used generally to refer to all objects to which a relationship could be applied, that is, tested. For example, one might consider the domain of the < relation to be the set of real numbers, even if only the numbers 1, 2, 3, 4, 5, 6 are being considered at that moment. Set representation of binary relations. Relational notation. A binary relation can be represented as a set, the elements of which are either unordered pairs or ordered pairs. For example, the course : department relation would be represented by the set of ordered pairs (c, d), where c is a course number and d is the name of the department that teaches

6 2.2 Relations 2 OTHER OBJECTS BUILT FROM SETS: RELATIONS, FUNCTIONS course c. The less than relation would be represented by the set of all ordered pairs (x, y), where x < y. The friendship relation would be represented by a set of unordered pairs, assuming that it is being thought of as symmetric. Given this representation, it is natural to use the notation (x, y) R to state that x and y are related by relation R. The existence of relationship R between objects x and y is also denoted by R(x, y) (prefix notation) or xry (infix notation). Examples include Fr(John, Mary) and John Fr Mary. We had already used the standard infix notation for the < relation. The postfix notation xyr is sometimes used, but is uncommon. Properties of (some) binary relations. same domain and codomain. Suppose that R is a binary relation with the ˆ R is symmetric if, and only if, xry yrx for all objects x, y Notice that the friendship relationship can plausibly be thought of as being symmetric (thus, one would also expect that Mary is friends with John would be valid in the above context). On the other hand, the less than relation is clearly not symmetric, as the statement x < y precludes the statement y < x in the usual interpretation. ˆ R is reflexive if and only if, xrx for all objects x The friendship relation is reflexive, assuming that there are no self-haters. The less than relation is not reflexive. Proximity is typically a reflexive notion: if object x is close to object y, then object y is close to object x. However, one-way roads could change that assessment. ˆ R is transitive if and only if xry and yrz xrz for all objects x, y, z Less than is a transitive relation, but friendship is not. Equivalence relations. A binary relation that is reflexive, symmetric, and transitive is called an equivalence relation. Equivalence describes a de facto equality in a specific context: two objects that are equivalent are equal for the intended purposes. What purposes are intended, and if a given equivalence relation captures the necessary features, are important modeling issues that must be addressed in each case, but they fall outside the definition of the general notion of equivalence relation. As an example, define a binary relation SS on a domain consisting of finite sets as follows. A SS B A and B have the same number of elements

7 2.3 Functions 2 OTHER OBJECTS BUILT FROM SETS: RELATIONS, FUNCTIONS Figure 1: An undirected graph. 6 We see that this relation SS (for same size ) is an equivalence relation: every set obviously has the same number of elements as itself, having the same number of elements is a symmetric property (if A has the same number of elements as B, then of course B has the same number as A), and, likewise, equality of size is clearly transitive (if A and B have the same size and B and C have the same size, then A and C have the same size). Two sets that have the same size (same number of elements) are not necessarily equal (have the same specific elements), but they are equal enough if the specific labels of the elements are irrelevant in a certain context. For example, one could be interested in measuring traffic or sales in two situations, and the specific details of the individual transactions may not be an immediate concern. Graphs. Graphs are graphical structures that represent binary relations. An undirected graph represents a symmetric binary relation as a collection of points called vertices, one for each element of the domain, with lines called arcs that connect pairs of vertices that are elements of the binary relation. An example appears in Fig. 1. Graphs allow the application of geometric or topological notions such as path, cycle, and connectedness to binary relations. For example, the graph in Fig. 1 is connected because it includes a path between every pair of vertices, and it has three cycles, namely the closed paths 1, 2, 5, 1, and 2, 3, 4, 5, 2, and 1, 2, 3, 4, 5, 1. Connected graphs without cycles, called trees, occur frequently and have important uses. 2.3 Functions Functions are the familiar processing boxes that, given an input object x, produce an output object f(x) that is determined by x. Functions can be thought of as special binary relations: ˆ A function f : X Y is a subset of the Cartesian product X Y such that, for each x X, there is a unique y Y such that (x, y) f. This unique value y is denoted f(x). The geometric-sounding term mapping and the term transformation

8 2.3 Functions 2 OTHER OBJECTS BUILT FROM SETS: RELATIONS, FUNCTIONS are sometimes used synonymously with function. The anonymous function notation x f(x) is also common Properties of (some) functions Suppose that f : X Y is a function. ˆ f is injective (also called one-to-one) if, and only if, f(x 1 ) = f(x 2 ) x 1 = x 2 for all objects x 1, x 2 in X Examples of injective functions include the function with the BC community as its domain that attaches an Eagle ID number to each person, and the function x x 3 on the real line. An example of a non-injective function is the function that associates to each person their home address. ˆ f is surjective (also called onto) if, and only if, y Y there is some x X such that f(x) = y This notion is relative to the codomain, of course. A function that is onto for a given codomain will not be onto if the codomain is redefined to be a larger set. Examples of surjective functions include the function that attaches an Eagle ID number to a member of the BC community, and the modulo 3 remainder function mod 3 : N {0, 1, 2} on the set of non-negative integers. ˆ f is bijective (or a bijection) if, and only if, f is both injective and surjective. Examples of bijections include the function x mod 3 (2 x) on the set {0, 1, 2}, and the function x x 3 on the set of real numbers. The existence of any bijection from X to Y implies that X and Y have the same number of elements. Since sets provide no structure other than membership, having the same number of elements is structurally indistinguishable from set equality, except for the names of the elements. For this reason, a bijection is sometimes called an isomorphism of sets. Example: near-associativity of the Cartesian product. Consider building the Cartesian product A B C in two stages, as follows: first, construct the Cartesian product A B, and then take the Cartesian product of the result with the remaining set, C, thereby obtaining (A B) C. The question is: does this two-stage procedure really produce the standard Cartesian product? Let s take a closer look at the result in each case: ˆ A B C was defined as consisting of all ordered tuples (a, b, c), where a A, b B, c C. ˆ (A B) C consists of all ordered pairs (d, c), where d A B, c C. Since the elements of A B are, in turn, ordered pairs of the form (a, b), where a A, b B, this means that (A B) C consists of all tuples ((a, b), c), where a A, b B, c C.

9 3 FORMAL LANGUAGES By the above, the two results are technically not the same. The first consists of ordered triples, while the second consists of ordered pairs in which the first component happens to be an ordered pair as well. However, the difference between (a, b, c) and ((a, b), c) for the same three objects a, b, c seems superficial. If we simply define the obvious function f : (A B) C A B C as follows: f ((a, b), c) = (a, b, c), then we will obtain a bijection between the two sets (check that this is true). Perhaps (A B) C and A B C are not equal, but we have shown them to be equivalent in a fundamental sense, by way of the above particularly natural bijection. 3 Formal languages Languages are used for human communication, as well as in the specification of computational procedures and systems. We will describe languages formally, in terms of sets. 3.1 Basic terminology: alphabet, string, Kleene closure, language. A fundamental object in any language is a string, which is just an ordered tuple of symbols taken from some alphabet. English words like terminology are strings over a well-known 26-letter alphabet. More generally, suppose that S denotes the alphabet to be used. The strings of length k over S are the elements of the Cartesian product S k. The length of a string can be any non-negative integer. We allow 0 as the length of the empty string, often known by the name ɛ. We will not consider strings of infinite length in most cases. Therefore, our default set of strings over an alphabet S will be the following union over all non-negative lengths: S = S k k=0 This set of all strings is called the Kleene closure of S. A language over an alphabet S is just a subset of S, that is, a language over S is some set of strings over S. 3.2 Syntax and semantics Syntax is taken to be synonymous with grammar, that is, the specification of the allowable forms of strings in a given language. For example, the syntax of Python allows the following string: >>> for i in range(1,10): but not the following string: >>> for each i between 1 and 10:

10 3.2 Syntax and semantics 3 FORMAL LANGUAGES Syntax is often described in terms of rules. An example of a formal syntactical specification appears below. Semantics refers to the meaning associated with strings. For example, in Python, the syntactically correct string in the first example above should set up an iteration over the values 0, 9 for i Example: a context-free grammar A grammar that models the syntax of a certain type of sentence can be described as a start symbol, S, together with a set of production rules or rewriting rules that allow successive transformation of the start symbol into more detailed forms, ending in a string of actual words. The grammar rules appear below. In each case, vertical lines or dashes are used on the right-hand side to indicate several available alternatives. S SNP SV P P NP P V P SNP SA ADJ SNP SA SNP P P SA SN P NP P A ADJ P NP P A P NP P P P A P N SA the a this that P A the these those SN boat boy girl car cat dog train plane poem scientist water sky P N SNs SV P SV ADV P P SV ADV SV SV is goes flies hits runs kisses imagines breaks enjoys P V P P V ADV P P P V P P P V P V are go fly hit run kiss imagine break enjoy P P P SNP P P NP P to at on near by below above before after ADV merrily greedily quickly clumsily ADJ bright green red yellow blue large small rough fragrant soft In order for a sentence (string) to be generated by a grammar, it is necessary that there be a derivation of that string in the grammar, meaning a sequence of strings of which the first string is the start symbol S, the last string is the target string (sentence), and each string in the sequence can be obtained from the one immediately preceding it by applying one of the transformation rules of the grammar to one of the variables in the predecessor string. Below are some examples of sentences generated by the above grammar. the bright blue dog runs merrily by the water those boys are on the plane a fragrant poem imagines in the sky that car kisses the soft boat Consider the second of those sentences: those boys are on the plane. This is generated

11 4 EXERCISES by the above grammar via the following derivation: S P NP P V P P A P N P V P those P NP P V P those P N P V P those SNs P V P those boys P V P those boys P V P P those boys are P P those boys are P SNP those boys are on SNP those boys are on SA SN those boys are on the SN those boys are on the plane We will encounter context-free grammars again later in the course. For now, we note that a context-free grammar can be defined formally in terms of sets and functions: Definition 3.1. A context-free grammar is a tuple (V, T, R, S) consisting of a set V of variables (like ADJ and P N P above), a set T of terminal symbols (such as the, boat, merrily), a set R of rewriting rules (e.g., SNP SA ADJ SNP ), and a selected variable S called the start symbol. Each rule in R is of the form V w, where w is a string of variables and / or terminals; equivalently, R V (V T ). 4 Exercises 1. In Python, what is the size (length) of set(l), where L is the list [x%5 for x in range(100)]? How does the answer differ from the length of L? Explain the difference. 2. Show in detail that the set of integers that are divisible (with zero remainder) by both 2 and by 3 is equal to the set {6n n is an integer}. 3. Are (A B) C and A (B C) the same set? Describe the relationship between the two precisely. Explain in detail. 4. Show that the bottom part of Eq. 1 follows from the top part by DeMorgan s laws. 5. A binary relation R is called antireflexive if xry implies that it is not the case that yrx. Give examples of a reflexive relation that is not antireflexive, an antireflexive relation that is not reflexive, and a binary relation that is neither reflexive nor antireflexive.

12 4 EXERCISES 6. Suppose that a function f : R R is a symmetric binary relation, where R is the set of real numbers. Give a precise expression for f(x) in terms of x. Explain.

Complexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np

Complexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np Chapter 1: Introduction Introduction Purpose of the Theory of Computation: Develop formal mathematical models of computation that reflect real-world computers. Nowadays, the Theory of Computation can be

More information

CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN. Lecture 1: Introduction

CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN. Lecture 1: Introduction CS314: FORMAL LANGUAGES AND AUTOMATA THEORY L. NADA ALZABEN Lecture 1: Introduction Introduction to the course 2 Required Text Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, BY MICHAEL

More information

9.5 Equivalence Relations

9.5 Equivalence Relations 9.5 Equivalence Relations You know from your early study of fractions that each fraction has many equivalent forms. For example, 2, 2 4, 3 6, 2, 3 6, 5 30,... are all different ways to represent the same

More information

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics 400 lecture note #4 [Ch 6] Set Theory 1. Basic Concepts and Definitions 1) Basics Element: ; A is a set consisting of elements x which is in a/another set S such that P(x) is true. Empty set: notated {

More information

Computer Science and Mathematics. Part I: Fundamental Mathematical Concepts Winfried Kurth

Computer Science and Mathematics. Part I: Fundamental Mathematical Concepts Winfried Kurth Computer Science and Mathematics Part I: Fundamental Mathematical Concepts Winfried Kurth http://www.uni-forst.gwdg.de/~wkurth/csm17_home.htm 1. Mathematical Logic Propositions - can be either true or

More information

Slides for Faculty Oxford University Press All rights reserved.

Slides for Faculty Oxford University Press All rights reserved. Oxford University Press 2013 Slides for Faculty Assistance Preliminaries Author: Vivek Kulkarni vivek_kulkarni@yahoo.com Outline Following topics are covered in the slides: Basic concepts, namely, symbols,

More information

2.1 Sets 2.2 Set Operations

2.1 Sets 2.2 Set Operations CSC2510 Theoretical Foundations of Computer Science 2.1 Sets 2.2 Set Operations Introduction to Set Theory A set is a structure, representing an unordered collection (group, plurality) of zero or more

More information

Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103. Chapter 2. Sets

Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103. Chapter 2. Sets Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from Discrete Mathematics and It's Applications Kenneth H.

More information

The Language of Sets and Functions

The Language of Sets and Functions MAT067 University of California, Davis Winter 2007 The Language of Sets and Functions Isaiah Lankham, Bruno Nachtergaele, Anne Schilling (January 7, 2007) 1 The Language of Sets 1.1 Definition and Notation

More information

CHAPTER 8. Copyright Cengage Learning. All rights reserved.

CHAPTER 8. Copyright Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS Copyright Cengage Learning. All rights reserved. SECTION 8.3 Equivalence Relations Copyright Cengage Learning. All rights reserved. The Relation Induced by a Partition 3 The Relation

More information

Chapter 3. Set Theory. 3.1 What is a Set?

Chapter 3. Set Theory. 3.1 What is a Set? Chapter 3 Set Theory 3.1 What is a Set? A set is a well-defined collection of objects called elements or members of the set. Here, well-defined means accurately and unambiguously stated or described. Any

More information

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Fall CSE 20 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Final exam The final exam is Saturday December 16 11:30am-2:30pm. Lecture A will take the exam in Lecture B will take the exam

More information

CSC Discrete Math I, Spring Sets

CSC Discrete Math I, Spring Sets CSC 125 - Discrete Math I, Spring 2017 Sets Sets A set is well-defined, unordered collection of objects The objects in a set are called the elements, or members, of the set A set is said to contain its

More information

CSC 501 Semantics of Programming Languages

CSC 501 Semantics of Programming Languages CSC 501 Semantics of Programming Languages Subtitle: An Introduction to Formal Methods. Instructor: Dr. Lutz Hamel Email: hamel@cs.uri.edu Office: Tyler, Rm 251 Books There are no required books in this

More information

Logic and Discrete Mathematics. Section 2.5 Equivalence relations and partitions

Logic and Discrete Mathematics. Section 2.5 Equivalence relations and partitions Logic and Discrete Mathematics Section 2.5 Equivalence relations and partitions Slides version: January 2015 Equivalence relations Let X be a set and R X X a binary relation on X. We call R an equivalence

More information

1 of 7 7/15/2009 3:40 PM Virtual Laboratories > 1. Foundations > 1 2 3 4 5 6 7 8 9 1. Sets Poincaré's quote, on the title page of this chapter could not be more wrong (what was he thinking?). Set theory

More information

Figure 1.1: This is an illustration of a generic set and its elements.

Figure 1.1: This is an illustration of a generic set and its elements. Chapter 1 Mathematical Review et theory is now generally accepted as the foundation of modern mathematics, and it plays an instrumental role in the treatment of probability. Unfortunately, a simple description

More information

Sets 1. The things in a set are called the elements of it. If x is an element of the set S, we say

Sets 1. The things in a set are called the elements of it. If x is an element of the set S, we say Sets 1 Where does mathematics start? What are the ideas which come first, in a logical sense, and form the foundation for everything else? Can we get a very small number of basic ideas? Can we reduce it

More information

This book is licensed under a Creative Commons Attribution 3.0 License

This book is licensed under a Creative Commons Attribution 3.0 License 6. Syntax Learning objectives: syntax and semantics syntax diagrams and EBNF describe context-free grammars terminal and nonterminal symbols productions definition of EBNF by itself parse tree grammars

More information

Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Sets Fall / 31

Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Sets Fall / 31 Sets MAT231 Transition to Higher Mathematics Fall 2014 MAT231 (Transition to Higher Math) Sets Fall 2014 1 / 31 Outline 1 Sets Introduction Cartesian Products Subsets Power Sets Union, Intersection, Difference

More information

Review of Sets. Review. Philippe B. Laval. Current Semester. Kennesaw State University. Philippe B. Laval (KSU) Sets Current Semester 1 / 16

Review of Sets. Review. Philippe B. Laval. Current Semester. Kennesaw State University. Philippe B. Laval (KSU) Sets Current Semester 1 / 16 Review of Sets Review Philippe B. Laval Kennesaw State University Current Semester Philippe B. Laval (KSU) Sets Current Semester 1 / 16 Outline 1 Introduction 2 Definitions, Notations and Examples 3 Special

More information

Semantics via Syntax. f (4) = if define f (x) =2 x + 55.

Semantics via Syntax. f (4) = if define f (x) =2 x + 55. 1 Semantics via Syntax The specification of a programming language starts with its syntax. As every programmer knows, the syntax of a language comes in the shape of a variant of a BNF (Backus-Naur Form)

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Final exam The final exam is Saturday March 18 8am-11am. Lecture A will take the exam in GH 242 Lecture B will take the exam

More information

Point-Set Topology 1. TOPOLOGICAL SPACES AND CONTINUOUS FUNCTIONS

Point-Set Topology 1. TOPOLOGICAL SPACES AND CONTINUOUS FUNCTIONS Point-Set Topology 1. TOPOLOGICAL SPACES AND CONTINUOUS FUNCTIONS Definition 1.1. Let X be a set and T a subset of the power set P(X) of X. Then T is a topology on X if and only if all of the following

More information

THEORY OF COMPUTATION

THEORY OF COMPUTATION THEORY OF COMPUTATION UNIT-1 INTRODUCTION Overview This chapter begins with an overview of those areas in the theory of computation that are basic foundation of learning TOC. This unit covers the introduction

More information

Introduction to Sets and Logic (MATH 1190)

Introduction to Sets and Logic (MATH 1190) Introduction to Sets and Logic () Instructor: Email: shenlili@yorku.ca Department of Mathematics and Statistics York University Dec 4, 2014 Outline 1 2 3 4 Definition A relation R from a set A to a set

More information

1.1 - Introduction to Sets

1.1 - Introduction to Sets 1.1 - Introduction to Sets Math 166-502 Blake Boudreaux Department of Mathematics Texas A&M University January 18, 2018 Blake Boudreaux (Texas A&M University) 1.1 - Introduction to Sets January 18, 2018

More information

A set with only one member is called a SINGLETON. A set with no members is called the EMPTY SET or 2 N

A set with only one member is called a SINGLETON. A set with no members is called the EMPTY SET or 2 N Mathematical Preliminaries Read pages 529-540 1. Set Theory 1.1 What is a set? A set is a collection of entities of any kind. It can be finite or infinite. A = {a, b, c} N = {1, 2, 3, } An entity is an

More information

Sets and set operations

Sets and set operations CS 44 Discrete Mathematics for CS Lecture Sets and set operations Milos Hauskrecht milos@cs.pitt.edu 5329 Sennott Square Course administration Homework 3: Due today Homework 4: Due next week on Friday,

More information

1 Introduction CHAPTER ONE: SETS

1 Introduction CHAPTER ONE: SETS 1 Introduction CHAPTER ONE: SETS Scientific theories usually do not directly describe the natural phenomena under investigation, but rather a mathematical idealization of them that abstracts away from

More information

2. Sets. 2.1&2.2: Sets and Subsets. Combining Sets. c Dr Oksana Shatalov, Fall

2. Sets. 2.1&2.2: Sets and Subsets. Combining Sets. c Dr Oksana Shatalov, Fall c Dr Oksana Shatalov, Fall 2014 1 2. Sets 2.1&2.2: Sets and Subsets. Combining Sets. Set Terminology and Notation DEFINITIONS: Set is well-defined collection of objects. Elements are objects or members

More information

Sets. Margaret M. Fleck. 15 September 2010

Sets. Margaret M. Fleck. 15 September 2010 Sets Margaret M. Fleck 15 September 2010 These notes cover set notation, operations on sets, and how to prove claims involving sets (Rosen sections 2.1 and 2.2). They also cover some logic subtleties that

More information

COMS 1003 Fall Introduction to Computer Programming in C. Bits, Boolean Logic & Discrete Math. September 13 th

COMS 1003 Fall Introduction to Computer Programming in C. Bits, Boolean Logic & Discrete Math. September 13 th COMS 1003 Fall 2005 Introduction to Computer Programming in C Bits, Boolean Logic & Discrete Math September 13 th Hello World! Logistics See the website: http://www.cs.columbia.edu/~locasto/ Course Web

More information

Discrete Mathematics Lecture 4. Harper Langston New York University

Discrete Mathematics Lecture 4. Harper Langston New York University Discrete Mathematics Lecture 4 Harper Langston New York University Sequences Sequence is a set of (usually infinite number of) ordered elements: a 1, a 2,, a n, Each individual element a k is called a

More information

MA651 Topology. Lecture 4. Topological spaces 2

MA651 Topology. Lecture 4. Topological spaces 2 MA651 Topology. Lecture 4. Topological spaces 2 This text is based on the following books: Linear Algebra and Analysis by Marc Zamansky Topology by James Dugundgji Fundamental concepts of topology by Peter

More information

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Discrete Mathematics

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Discrete Mathematics About the Tutorial Discrete Mathematics is a branch of mathematics involving discrete elements that uses algebra and arithmetic. It is increasingly being applied in the practical fields of mathematics

More information

13 th Annual Johns Hopkins Math Tournament Saturday, February 18, 2012 Explorations Unlimited Round Automata Theory

13 th Annual Johns Hopkins Math Tournament Saturday, February 18, 2012 Explorations Unlimited Round Automata Theory 13 th Annual Johns Hopkins Math Tournament Saturday, February 18, 2012 Explorations Unlimited Round Automata Theory 1. Introduction Automata theory is an investigation of the intersection of mathematics,

More information

RAQUEL s Relational Operators

RAQUEL s Relational Operators Contents RAQUEL s Relational Operators Introduction 2 General Principles 2 Operator Parameters 3 Ordinary & High-Level Operators 3 Operator Valency 4 Default Tuples 5 The Relational Algebra Operators in

More information

LOGIC AND DISCRETE MATHEMATICS

LOGIC AND DISCRETE MATHEMATICS LOGIC AND DISCRETE MATHEMATICS A Computer Science Perspective WINFRIED KARL GRASSMANN Department of Computer Science University of Saskatchewan JEAN-PAUL TREMBLAY Department of Computer Science University

More information

9/19/12. Why Study Discrete Math? What is discrete? Sets (Rosen, Chapter 2) can be described by discrete math TOPICS

9/19/12. Why Study Discrete Math? What is discrete? Sets (Rosen, Chapter 2) can be described by discrete math TOPICS What is discrete? Sets (Rosen, Chapter 2) TOPICS Discrete math Set Definition Set Operations Tuples Consisting of distinct or unconnected elements, not continuous (calculus) Helps us in Computer Science

More information

This Lecture. We will first introduce some basic set theory before we do counting. Basic Definitions. Operations on Sets.

This Lecture. We will first introduce some basic set theory before we do counting. Basic Definitions. Operations on Sets. Sets A B C This Lecture We will first introduce some basic set theory before we do counting. Basic Definitions Operations on Sets Set Identities Defining Sets Definition: A set is an unordered collection

More information

MATH 22 MORE ABOUT FUNCTIONS. Lecture M: 10/14/2003. Form follows function. Louis Henri Sullivan

MATH 22 MORE ABOUT FUNCTIONS. Lecture M: 10/14/2003. Form follows function. Louis Henri Sullivan MATH 22 Lecture M: 10/14/2003 MORE ABOUT FUNCTIONS Form follows function. Louis Henri Sullivan This frightful word, function, was born under other skies than those I have loved. Le Corbusier D ora innanzi

More information

UNIVERSITY OF EDINBURGH COLLEGE OF SCIENCE AND ENGINEERING SCHOOL OF INFORMATICS INFR08008 INFORMATICS 2A: PROCESSING FORMAL AND NATURAL LANGUAGES

UNIVERSITY OF EDINBURGH COLLEGE OF SCIENCE AND ENGINEERING SCHOOL OF INFORMATICS INFR08008 INFORMATICS 2A: PROCESSING FORMAL AND NATURAL LANGUAGES UNIVERSITY OF EDINBURGH COLLEGE OF SCIENCE AND ENGINEERING SCHOOL OF INFORMATICS INFR08008 INFORMATICS 2A: PROCESSING FORMAL AND NATURAL LANGUAGES Saturday 10 th December 2016 09:30 to 11:30 INSTRUCTIONS

More information

CS100: DISCRETE STRUCTURES

CS100: DISCRETE STRUCTURES CS: DISCRETE STRUCTURES Computer Science Department Lecture : Set and Sets Operations (Ch2) Lecture Contents 2 Sets Definition. Some Important Sets. Notation used to describe membership in sets. How to

More information

Propositional Logic. Part I

Propositional Logic. Part I Part I Propositional Logic 1 Classical Logic and the Material Conditional 1.1 Introduction 1.1.1 The first purpose of this chapter is to review classical propositional logic, including semantic tableaux.

More information

This is already grossly inconvenient in present formalisms. Why do we want to make this convenient? GENERAL GOALS

This is already grossly inconvenient in present formalisms. Why do we want to make this convenient? GENERAL GOALS 1 THE FORMALIZATION OF MATHEMATICS by Harvey M. Friedman Ohio State University Department of Mathematics friedman@math.ohio-state.edu www.math.ohio-state.edu/~friedman/ May 21, 1997 Can mathematics be

More information

Excerpt from "Art of Problem Solving Volume 1: the Basics" 2014 AoPS Inc.

Excerpt from Art of Problem Solving Volume 1: the Basics 2014 AoPS Inc. Chapter 5 Using the Integers In spite of their being a rather restricted class of numbers, the integers have a lot of interesting properties and uses. Math which involves the properties of integers is

More information

Sets. Mukulika Ghosh. Fall Based on slides by Dr. Hyunyoung Lee

Sets. Mukulika Ghosh. Fall Based on slides by Dr. Hyunyoung Lee Sets Mukulika Ghosh Fall 2018 Based on slides by Dr. Hyunyoung Lee Sets Sets A set is an unordered collection of objects, called elements, without duplication. We write a A to denote that a is an element

More information

2.2 Syntax Definition

2.2 Syntax Definition 42 CHAPTER 2. A SIMPLE SYNTAX-DIRECTED TRANSLATOR sequence of "three-address" instructions; a more complete example appears in Fig. 2.2. This form of intermediate code takes its name from instructions

More information

CHAPTER 3 FUZZY RELATION and COMPOSITION

CHAPTER 3 FUZZY RELATION and COMPOSITION CHAPTER 3 FUZZY RELATION and COMPOSITION The concept of fuzzy set as a generalization of crisp set has been introduced in the previous chapter. Relations between elements of crisp sets can be extended

More information

Functions. How is this definition written in symbolic logic notation?

Functions. How is this definition written in symbolic logic notation? functions 1 Functions Def. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A. We write f(a) = b if b is the unique element of B assigned by

More information

Today s Topics. What is a set?

Today s Topics. What is a set? Today s Topics Introduction to set theory What is a set? Set notation Basic set operations What is a set? Definition: A set is an unordered collection of objects Examples: Sets can contain items of mixed

More information

SETS. Sets are of two sorts: finite infinite A system of sets is a set, whose elements are again sets.

SETS. Sets are of two sorts: finite infinite A system of sets is a set, whose elements are again sets. SETS A set is a file of objects which have at least one property in common. The objects of the set are called elements. Sets are notated with capital letters K, Z, N, etc., the elements are a, b, c, d,

More information

r=1 The Binomial Theorem. 4 MA095/98G Revision

r=1 The Binomial Theorem. 4 MA095/98G Revision Revision Read through the whole course once Make summary sheets of important definitions and results, you can use the following pages as a start and fill in more yourself Do all assignments again Do the

More information

Programming Lecture 3

Programming Lecture 3 Programming Lecture 3 Expressions (Chapter 3) Primitive types Aside: Context Free Grammars Constants, variables Identifiers Variable declarations Arithmetic expressions Operator precedence Assignment statements

More information

1. Relations 2. Equivalence relations 3. Modular arithmetics. ! Think of relations as directed graphs! xry means there in an edge x!

1. Relations 2. Equivalence relations 3. Modular arithmetics. ! Think of relations as directed graphs! xry means there in an edge x! 2 Today s Topics: CSE 20: Discrete Mathematics for Computer Science Prof. Miles Jones 1. Relations 2. 3. Modular arithmetics 3 4 Relations are graphs! Think of relations as directed graphs! xry means there

More information

Chapter 3. Describing Syntax and Semantics

Chapter 3. Describing Syntax and Semantics Chapter 3 Describing Syntax and Semantics Chapter 3 Topics Introduction The General Problem of Describing Syntax Formal Methods of Describing Syntax Attribute Grammars Describing the Meanings of Programs:

More information

Sets. {1, 2, 3, Calvin}.

Sets. {1, 2, 3, Calvin}. ets 2-24-2007 Roughly speaking, a set is a collection of objects. he objects are called the members or the elements of the set. et theory is the basis for mathematics, and there are a number of axiom systems

More information

Notes on metric spaces and topology. Math 309: Topics in geometry. Dale Rolfsen. University of British Columbia

Notes on metric spaces and topology. Math 309: Topics in geometry. Dale Rolfsen. University of British Columbia Notes on metric spaces and topology Math 309: Topics in geometry Dale Rolfsen University of British Columbia Let X be a set; we ll generally refer to its elements as points. A distance function, or metric

More information

Formal languages and computation models

Formal languages and computation models Formal languages and computation models Guy Perrier Bibliography John E. Hopcroft, Rajeev Motwani, Jeffrey D. Ullman - Introduction to Automata Theory, Languages, and Computation - Addison Wesley, 2006.

More information

11 Sets II Operations

11 Sets II Operations 11 Sets II Operations Tom Lewis Fall Term 2010 Tom Lewis () 11 Sets II Operations Fall Term 2010 1 / 12 Outline 1 Union and intersection 2 Set operations 3 The size of a union 4 Difference and symmetric

More information

CS 341 Homework 1 Basic Techniques

CS 341 Homework 1 Basic Techniques CS 341 Homework 1 Basic Techniques 1. What are these sets? Write them using braces, commas, numerals, (for infinite sets), and only. (a) ({1, 3, 5} {3, 1}) {3, 5, 7} (b) {{3}, {3, 5}, {{5, 7}, {7, 9}}}

More information

A GRAPH FROM THE VIEWPOINT OF ALGEBRAIC TOPOLOGY

A GRAPH FROM THE VIEWPOINT OF ALGEBRAIC TOPOLOGY A GRAPH FROM THE VIEWPOINT OF ALGEBRAIC TOPOLOGY KARL L. STRATOS Abstract. The conventional method of describing a graph as a pair (V, E), where V and E repectively denote the sets of vertices and edges,

More information

A.1 Numbers, Sets and Arithmetic

A.1 Numbers, Sets and Arithmetic 522 APPENDIX A. MATHEMATICS FOUNDATIONS A.1 Numbers, Sets and Arithmetic Numbers started as a conceptual way to quantify count objects. Later, numbers were used to measure quantities that were extensive,

More information

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions.

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions. THREE LECTURES ON BASIC TOPOLOGY PHILIP FOTH 1. Basic notions. Let X be a set. To make a topological space out of X, one must specify a collection T of subsets of X, which are said to be open subsets of

More information

Binary Relations McGraw-Hill Education

Binary Relations McGraw-Hill Education Binary Relations A binary relation R from a set A to a set B is a subset of A X B Example: Let A = {0,1,2} and B = {a,b} {(0, a), (0, b), (1,a), (2, b)} is a relation from A to B. We can also represent

More information

CSE 215: Foundations of Computer Science Recitation Exercises Set #9 Stony Brook University. Name: ID#: Section #: Score: / 4

CSE 215: Foundations of Computer Science Recitation Exercises Set #9 Stony Brook University. Name: ID#: Section #: Score: / 4 CSE 215: Foundations of Computer Science Recitation Exercises Set #9 Stony Brook University Name: ID#: Section #: Score: / 4 Unit 14: Set Theory: Definitions and Properties 1. Let C = {n Z n = 6r 5 for

More information

13 th Annual Johns Hopkins Math Tournament Saturday, February 19, 2011 Automata Theory EUR solutions

13 th Annual Johns Hopkins Math Tournament Saturday, February 19, 2011 Automata Theory EUR solutions 13 th Annual Johns Hopkins Math Tournament Saturday, February 19, 011 Automata Theory EUR solutions Problem 1 (5 points). Prove that any surjective map between finite sets of the same cardinality is a

More information

Topic 1: What is HoTT and why?

Topic 1: What is HoTT and why? Topic 1: What is HoTT and why? May 5, 2014 Introduction Homotopy type theory (HoTT) is a newly emerging field of mathematics which is currently being developed as a foundation of mathematics which is in

More information

Material from Recitation 1

Material from Recitation 1 Material from Recitation 1 Darcey Riley Frank Ferraro January 18, 2011 1 Introduction In CSC 280 we will be formalizing computation, i.e. we will be creating precise mathematical models for describing

More information

CPSC 121 Some Sample Questions for the Final Exam Tuesday, April 15, 2014, 8:30AM

CPSC 121 Some Sample Questions for the Final Exam Tuesday, April 15, 2014, 8:30AM CPSC 121 Some Sample Questions for the Final Exam Tuesday, April 15, 2014, 8:30AM Name: Student ID: Signature: Section (circle one): George Steve Your signature acknowledges your understanding of and agreement

More information

CS2 Algorithms and Data Structures Note 10. Depth-First Search and Topological Sorting

CS2 Algorithms and Data Structures Note 10. Depth-First Search and Topological Sorting CS2 Algorithms and Data Structures Note 10 Depth-First Search and Topological Sorting In this lecture, we will analyse the running time of DFS and discuss a few applications. 10.1 A recursive implementation

More information

Will introduce various operators supported by C language Identify supported operations Present some of terms characterizing operators

Will introduce various operators supported by C language Identify supported operations Present some of terms characterizing operators Operators Overview Will introduce various operators supported by C language Identify supported operations Present some of terms characterizing operators Operands and Operators Mathematical or logical relationships

More information

axiomatic semantics involving logical rules for deriving relations between preconditions and postconditions.

axiomatic semantics involving logical rules for deriving relations between preconditions and postconditions. CS 6110 S18 Lecture 18 Denotational Semantics 1 What is Denotational Semantics? So far we have looked at operational semantics involving rules for state transitions, definitional semantics involving translations

More information

p x i 1 i n x, y, z = 2 x 3 y 5 z

p x i 1 i n x, y, z = 2 x 3 y 5 z 3 Pairing and encoding functions Our aim in this part of the course is to show that register machines can compute everything that can be computed, and to show that there are things that can t be computed.

More information

14.1 Encoding for different models of computation

14.1 Encoding for different models of computation Lecture 14 Decidable languages In the previous lecture we discussed some examples of encoding schemes, through which various objects can be represented by strings over a given alphabet. We will begin this

More information

Topology and Topological Spaces

Topology and Topological Spaces Topology and Topological Spaces Mathematical spaces such as vector spaces, normed vector spaces (Banach spaces), and metric spaces are generalizations of ideas that are familiar in R or in R n. For example,

More information

LECTURE NOTES ON SETS

LECTURE NOTES ON SETS LECTURE NOTES ON SETS PETE L. CLARK Contents 1. Introducing Sets 1 2. Subsets 5 3. Power Sets 5 4. Operations on Sets 6 5. Families of Sets 8 6. Partitions 10 7. Cartesian Products 11 1. Introducing Sets

More information

10/11/2018. Partial Orderings. Partial Orderings. Partial Orderings. Partial Orderings. Partial Orderings. Partial Orderings

10/11/2018. Partial Orderings. Partial Orderings. Partial Orderings. Partial Orderings. Partial Orderings. Partial Orderings Sometimes, relations define an order on the elements in a set. Definition: A relation R on a set S is called a partial ordering or partial order if it is reflexive, antisymmetric, and transitive. A set

More information

2 Review of Set Theory

2 Review of Set Theory 2 Review of Set Theory Example 2.1. Let Ω = {1, 2, 3, 4, 5, 6} 2.2. Venn diagram is very useful in set theory. It is often used to portray relationships between sets. Many identities can be read out simply

More information

2. CONNECTIVITY Connectivity

2. CONNECTIVITY Connectivity 2. CONNECTIVITY 70 2. Connectivity 2.1. Connectivity. Definition 2.1.1. (1) A path in a graph G = (V, E) is a sequence of vertices v 0, v 1, v 2,..., v n such that {v i 1, v i } is an edge of G for i =

More information

Functions. Def. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A.

Functions. Def. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A. Functions functions 1 Def. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A. a A! b B b is assigned to a a A! b B f ( a) = b Notation: If

More information

Figure 4.1: The evolution of a rooted tree.

Figure 4.1: The evolution of a rooted tree. 106 CHAPTER 4. INDUCTION, RECURSION AND RECURRENCES 4.6 Rooted Trees 4.6.1 The idea of a rooted tree We talked about how a tree diagram helps us visualize merge sort or other divide and conquer algorithms.

More information

ECS 20 Lecture 9 Fall Oct 2013 Phil Rogaway

ECS 20 Lecture 9 Fall Oct 2013 Phil Rogaway ECS 20 Lecture 9 Fall 2013 24 Oct 2013 Phil Rogaway Today: o Sets of strings (languages) o Regular expressions Distinguished Lecture after class : Some Hash-Based Data Structures and Algorithms Everyone

More information

CHAPTER 3 FUZZY RELATION and COMPOSITION

CHAPTER 3 FUZZY RELATION and COMPOSITION CHAPTER 3 FUZZY RELATION and COMPOSITION Crisp relation! Definition (Product set) Let A and B be two non-empty sets, the prod uct set or Cartesian product A B is defined as follows, A B = {(a, b) a A,

More information

Technische Universität München Zentrum Mathematik

Technische Universität München Zentrum Mathematik Technische Universität München Zentrum Mathematik Prof. Dr. Dr. Jürgen Richter-Gebert, Bernhard Werner Projective Geometry SS 208 https://www-m0.ma.tum.de/bin/view/lehre/ss8/pgss8/webhome Solutions for

More information

2/18/14. Uses for Discrete Math in Computer Science. What is discrete? Why Study Discrete Math? Sets and Functions (Rosen, Sections 2.1,2.2, 2.

2/18/14. Uses for Discrete Math in Computer Science. What is discrete? Why Study Discrete Math? Sets and Functions (Rosen, Sections 2.1,2.2, 2. Why Study Discrete Math? Sets and Functions (Rosen, Sections 2.1,2.2, 2.3) TOPICS Discrete math Set Definition Set Operations Tuples Digital computers are based on discrete units of data (bits). Therefore,

More information

Let A(x) be x is an element of A, and B(x) be x is an element of B.

Let A(x) be x is an element of A, and B(x) be x is an element of B. Homework 6. CSE 240, Fall, 2014 Due, Tuesday October 28. Can turn in at the beginning of class, or earlier in the mailbox labelled Pless in Bryan Hall, room 509c. Practice Problems: 1. Given two arbitrary

More information

Math 187 Sample Test II Questions

Math 187 Sample Test II Questions Math 187 Sample Test II Questions Dr. Holmes October 2, 2008 These are sample questions of kinds which might appear on Test II. There is no guarantee that all questions on the test will look like these!

More information

MATHEMATICS 191, FALL 2004 MATHEMATICAL PROBABILITY Outline #1 (Countability and Uncountability)

MATHEMATICS 191, FALL 2004 MATHEMATICAL PROBABILITY Outline #1 (Countability and Uncountability) MATHEMATICS 191, FALL 2004 MATHEMATICAL PROBABILITY Outline #1 (Countability and Uncountability) Last modified: September 16, 2004 Reference: Apostol, Calculus, Vol. 2, section 13.19 (attached). The aim

More information

2.2 Set Operations. Introduction DEFINITION 1. EXAMPLE 1 The union of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 2, 3, 5}; that is, EXAMPLE 2

2.2 Set Operations. Introduction DEFINITION 1. EXAMPLE 1 The union of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 2, 3, 5}; that is, EXAMPLE 2 2.2 Set Operations 127 2.2 Set Operations Introduction Two, or more, sets can be combined in many different ways. For instance, starting with the set of mathematics majors at your school and the set of

More information

MATH 139 W12 Review 1 Checklist 1. Exam Checklist. 1. Introduction to Predicates and Quantified Statements (chapters ).

MATH 139 W12 Review 1 Checklist 1. Exam Checklist. 1. Introduction to Predicates and Quantified Statements (chapters ). MATH 139 W12 Review 1 Checklist 1 Exam Checklist 1. Introduction to Predicates and Quantified Statements (chapters 3.1-3.4). universal and existential statements truth set negations of universal and existential

More information

Recursively Enumerable Languages, Turing Machines, and Decidability

Recursively Enumerable Languages, Turing Machines, and Decidability Recursively Enumerable Languages, Turing Machines, and Decidability 1 Problem Reduction: Basic Concepts and Analogies The concept of problem reduction is simple at a high level. You simply take an algorithm

More information

2 Sets. 2.1 Notation. last edited January 26, 2016

2 Sets. 2.1 Notation. last edited January 26, 2016 2 Sets Sets show up in virtually every topic in mathematics, and so understanding their basics is a necessity for understanding advanced mathematics. As far as we re concerned, the word set means what

More information

Modular Arithmetic. Marizza Bailey. December 14, 2015

Modular Arithmetic. Marizza Bailey. December 14, 2015 Modular Arithmetic Marizza Bailey December 14, 2015 Introduction to Modular Arithmetic If someone asks you what day it is 145 days from now, what would you answer? Would you count 145 days, or find a quicker

More information

Cantor s Diagonal Argument for Different Levels of Infinity

Cantor s Diagonal Argument for Different Levels of Infinity JANUARY 2015 1 Cantor s Diagonal Argument for Different Levels of Infinity Michael J. Neely University of Southern California http://www-bcf.usc.edu/ mjneely Abstract These notes develop the classic Cantor

More information

SOFTWARE ENGINEERING DESIGN I

SOFTWARE ENGINEERING DESIGN I 2 SOFTWARE ENGINEERING DESIGN I 3. Schemas and Theories The aim of this course is to learn how to write formal specifications of computer systems, using classical logic. The key descriptional technique

More information

(a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are rational they can be written as the ratio of integers a 1

(a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are rational they can be written as the ratio of integers a 1 CS 70 Discrete Mathematics for CS Fall 2000 Wagner MT1 Sol Solutions to Midterm 1 1. (16 pts.) Theorems and proofs (a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are

More information

Mathematically Rigorous Software Design Review of mathematical prerequisites

Mathematically Rigorous Software Design Review of mathematical prerequisites Mathematically Rigorous Software Design 2002 September 27 Part 1: Boolean algebra 1. Define the Boolean functions and, or, not, implication ( ), equivalence ( ) and equals (=) by truth tables. 2. In an

More information

15 212: Principles of Programming. Some Notes on Grammars and Parsing

15 212: Principles of Programming. Some Notes on Grammars and Parsing 15 212: Principles of Programming Some Notes on Grammars and Parsing Michael Erdmann Spring 2011 1 Introduction These notes are intended as a rough and ready guide to grammars and parsing. The theoretical

More information