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

Similar documents
2.1 Sets 2.2 Set Operations

CSC Discrete Math I, Spring Sets

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

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

Discrete mathematics II. - Graphs

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

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

MATH 363 Final Wednesday, April 28. Final exam. You may use lemmas and theorems that were proven in class and on assignments unless stated otherwise.

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

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

SET DEFINITION 1 elements members

Graph Theory S 1 I 2 I 1 S 2 I 1 I 2

Introduction II. Sets. Terminology III. Definition. Definition. Definition. Example

Binary Relations McGraw-Hill Education

Set and Set Operations

Introduction III. Graphs. Motivations I. Introduction IV

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions.

1.1 - Introduction to Sets

Today s Topics. What is a set?

A graph is finite if its vertex set and edge set are finite. We call a graph with just one vertex trivial and all other graphs nontrivial.

Basics of Graph Theory

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.

GRAPHS, GRAPH MODELS, GRAPH TERMINOLOGY, AND SPECIAL TYPES OF GRAPHS

CS243, Logic and Computation Sets, functions, and languages

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

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

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

CS100: DISCRETE STRUCTURES

Symmetric Product Graphs

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

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

Discrete Mathematics

CS6702 GRAPH THEORY AND APPLICATIONS 2 MARKS QUESTIONS AND ANSWERS

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

Sets. De Morgan s laws. Mappings. Definition. Definition

CHAPTER 3 FUZZY RELATION and COMPOSITION

Lecture 6,

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

Functions and Sequences Rosen, Secs. 2.3, 2.4

Planar Graphs. 1 Graphs and maps. 1.1 Planarity and duality

A GRAPH FROM THE VIEWPOINT OF ALGEBRAIC TOPOLOGY

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


MA651 Topology. Lecture 4. Topological spaces 2

Graph and Digraph Glossary

CS 311 Discrete Math for Computer Science Dr. William C. Bulko. Graphs

Treewidth and graph minors

Introduction to Sets and Logic (MATH 1190)

CHAPTER 3 FUZZY RELATION and COMPOSITION

Planar graphs. Chapter 8

CONNECTED SPACES AND HOW TO USE THEM

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.

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

1. Lexical Analysis Phase

Mathematically Rigorous Software Design Review of mathematical prerequisites

Chapter 10: Trees. A tree is a connected simple undirected graph with no simple circuits.

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

Basic Properties The Definition of Catalan Numbers

1. a graph G = (V (G), E(G)) consists of a set V (G) of vertices, and a set E(G) of edges (edges are pairs of elements of V (G))

Slides for Faculty Oxford University Press All rights reserved.

Characterizing Graphs (3) Characterizing Graphs (1) Characterizing Graphs (2) Characterizing Graphs (4)

Discrete Mathematics SECOND EDITION OXFORD UNIVERSITY PRESS. Norman L. Biggs. Professor of Mathematics London School of Economics University of London

Power Set of a set and Relations

Lecture 17: Continuous Functions

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

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

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

2 Review of Set Theory

Graphs (MTAT , 6 EAP) Lectures: Mon 14-16, hall 404 Exercises: Wed 14-16, hall 402

2. Functions, sets, countability and uncountability. Let A, B be sets (often, in this module, subsets of R).

Chapter 4. Relations & Graphs. 4.1 Relations. Exercises For each of the relations specified below:

Lecture 1: Examples, connectedness, paths and cycles

Sets and set operations

CS 1200 Discrete Math Math Preliminaries. A.R. Hurson 323 CS Building, Missouri S&T

Domination, Independence and Other Numbers Associated With the Intersection Graph of a Set of Half-planes

Sets. Margaret M. Fleck. 15 September 2010

Discrete Mathematics Lecture 4. Harper Langston New York University

Mathematics for Computer Science Exercises from Week 4

Directed Graph and Binary Trees

TOPOLOGY, DR. BLOCK, FALL 2015, NOTES, PART 3.

Point-Set Topology 1. TOPOLOGICAL SPACES AND CONTINUOUS FUNCTIONS

K 4,4 e Has No Finite Planar Cover

INTRODUCTION TO TOPOLOGY

v V Question: How many edges are there in a graph with 10 vertices each of degree 6?

MAT 090 Brian Killough s Instructor Notes Strayer University

Graphs and trees come up everywhere. We can view the internet as a graph (in many ways) Web search views web pages as a graph

Logic and Discrete Mathematics. Section 2.5 Equivalence relations and partitions

CS6702 GRAPH THEORY AND APPLICATIONS QUESTION BANK

CMSC Honors Discrete Mathematics

The Language of Sets and Functions

ROUGH MEMBERSHIP FUNCTIONS: A TOOL FOR REASONING WITH UNCERTAINTY

On Universal Cycles of Labeled Graphs

Phil 320 Chapter 1: Sets, Functions and Enumerability I. Sets Informally: a set is a collection of objects. The objects are called members or

Some properties of the line graphs associated to the total graph of a commutative ring

Key Graph Theory Theorems

CMSC 380. Graph Terminology and Representation

Math 170- Graph Theory Notes

Logic: The Big Picture. Axiomatizing Arithmetic. Tautologies and Valid Arguments. Graphs and Trees

11/22/2016. Chapter 9 Graph Algorithms. Introduction. Definitions. Definitions. Definitions. Definitions

A digital pretopology and one of its quotients

Transcription:

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 false - Examples: "Vienna is the capital of Austria", "Mary is pregnant", "3+4=8" - can be combined by logical operators, e.g., "Today is Tuesday and the sun is shining". Usual logical operators and their abbreviations: a b a and b (And) a b a or b (latin: vel) a not a a b a implies b (if a then b) a b a is equivalent to b (if and only if a then b; iff a then b) 1

Quantifiers x for all x holds... x there exists an x for which... Further symbols := is equal by definition : is equivalent by definition 2. Sets A set is a collection of different objects, which are called the elements of the set. The order in which the elements are listed does not matter. A set can have a finite or an infinite number of elements. We speak of finite and infinite sets. Examples: The set of all human beings on earth (finite) The set of all prime numbers (infinite) Sets are usually designated by upper-case letters, their elements by lower-case letters. a M a M a is element of the set M a is not element of the set M 2

Two notations for sets: - Listing of all elements, delimited by commas (or semicolons) and put in braces: A = { 1; 2; 3; 4; 5 } - Usage of a variable symbol and specification of a proposition (containing the variable) which has to be fulfilled by the elements: A = { x x is a positive integer smaller than 6 } (the vertical line is read: "... for which holds:...") alternative notation for the last one: A = { x IN x < 6 } (IN is the set of positive integer numbers, not including 0.) Number of elements of a set M (also called cardinality of M): M example: { x IN x < 12 x is even } = 5 Propositions involving sets: Example: n IN : n 2 = 2 n (true, because it is fulfilled for n = 2) A special set: The empty set Notation: For the empty set, we have = 0. 3

Subsets and supersets If A contains all elements of B (and possibly some more), B is called a subset of A (and A a superset of B). Notation: B A (or, equivalently, A B) Visualization by a so-called Venn diagram: It holds: A B B A A = B. Intersection The intersection of the sets A and B is the set of all elements which are elements of A and of B. Operator symbol: A B = { x x A and x B }. Example: { 1; 2; 3; 4 } { 2; 4; 6; 8 } = { 2; 4 }. 4

Two sets A and B are called disjoint if A B =. Union The union of the sets A and B is the set of all elements which are element of A or of B. Operator symbol: ( = Union) A B = { x x A or x B }. Example: { 1; 2; 3; 4 } { 2; 4; 6; 8 } = { 1; 2; 3; 4; 6; 8 }. What is the number of elements A B? 5

If A and B are disjoint, we have: A B = A + B Generalization: If A1, A2,..., An are all pairwise disjoint, then A1 A2... An = A1 +... + An. Remarks: (1) (A B) C = A (B C) ("associativity"), so we can omit the parentheses (the same holds for + and for ). (2) Short notations for iterated operations: for n sets A1, A2,..., An : n U Ai = A1 i= 1 K A n for n numbers x1, x2,..., xn : n i= 1 n i= 1 x = x + K + x i x i = 1 x 1 K x n n 6

(3) The formula A B = A + B does not hold if A and B are not disjoint. In the general case, we have: A B = A + B A B. Difference of sets The difference set of the sets A and B is the set of all elements which are element of A but not of B. ("A without B") Operator symbol: (sometimes also used: \ ). A B = { x x A and x B }. Example: { 1; 2; 3; 4 } { 2; 4; 6; 8 } = { 1; 3 }. Complement If all considered sets are subsets of a given basic set Z, the difference Z A is often called the complement of A and is denoted A C. A C = { x Z x A }. 7

The power set The set of all subsets of a given set S is called the power set of S and is denoted P(S). Example: P(S) = { A A S } S = { 1; 2; 3 } P(S) = { ; {1}; {2}; {3}; {1; 2}; {1; 3}; {2; 3}; {1; 2; 3} } For the number of its elements, we have always: P(S) = 2 S Cartesian products of sets The cartesian product of two sets A and B, denoted A B, is the set of all possible ordered pairs where the first component is an element of A and the second component an element of B. A B = { (a, b) a A and b B } Remark: In an ordered pair, the order of the components is fixed. If a b, then (a, b) (b, a). Example: A = { 1; 2; 3 }, B = { u, v }: A B = { (1, u); (2, u); (3, u); (1, v); (2, v); (3, v) }. 8

Attention: Usually it is A B B A! Number of elements: A B = A B. Visualization of A B in a coordinate system: If A and B are subsets of the set IR of real numbers, we can use the well-known cartesian coordinate system. Products of more than two sets The elements of (A B) C are "nested pairs" ((a, b), c); we identify them with the triples (a, b, c) and write A B C. Analogously for quadruples, etc. A1 A2... An = { (a1, a2,..., an) a1 A1 a2 A2... an An } 9

If A1 = A2 =... = An, we write: A n = A A... A (n times) = set of all n-tuples with components from A. Example: B = { x, y } B 3 = { (x, x, x); (x, x, y); (x, y, x); (x, y, y); (y, x, x); (y, x, y); (y, y, x); (y, y, y) } If the components are letters, the parentheses and commas are often omitted: B 3 = { xxx; xxy;... ; yyy } set of words of length 3 The set of arbitrary words (strings) over a set: A* = A 0 A 1 A 2 A 3... with A 0 := { ε }, where ε is the empty word. Example: { x, y }* = { ε; x; y; xx; xy; yx; yy; xxx;... } A + = A 1 A 2 A 3... does not contain the empty word. 10

The cartesian product in the description of datasets Frequently, informations regarding a measurement are put together in an n-tuple. Example: S = set of time values T = set of temperature values U = set of laboratory identifiers V = set of measurement values A measurement is then represented by a 4-tuple (s, t, u, v) S T U V with s = time of measurement, t = current temperature, u = lab id, v = measured value. 11

3. Relations A (binary) relation R between two sets A and B is a subset of A B. That means, a relation is represented by a set R of ordered pairs (a, b) with a A and b B. If (a, b) R we write also a R b (infix notation). Graphical representation (if A and B are finite): If (a, b) R, connect a and b by an arrow a b c d f e The converse relation R 1 of R: (b, a) R 1 (a, b) R R 1 is a subset of B A. In the graphical representation, switch the directions of all arrows to obtain the converse relation! 12

If A = B, we have a relation in a set A. Example: A = IR (set of real numbers), R = < relation "smaller as". R consists of all number pairs (x, y) with x < y. Generalization: n-ary relation: any subset of A1 A2... An. 13

4. Graphs A graph consists of a set V of vertices and a set E of edges. Each edge connects two vertices. Different variants of graphs differ in the way how the edges are defined and what edges are allowed: Undirected graphs: The edges are (unordered) 2-element subsets of V. Visualization by undirected arcs: Directed graphs: The edges are ordered pairs, i.e., E V V. (E is a relation in V.) Visualization by directed arcs. "Loops" are allowed, multiple arcs between the same vertices are not allowed: 14

Multigraphs: Multiple directed edges are allowed. Labelled graphs: Vertices and/or edges have labels from a set of vertex/edge labels (names, numbers...) Examples: transport networks metabolic networks food webs class diagrams in software engineering genealogical trees structural formulae in chemistry (vertex-labelled multigraph) 15

Paths in graphs: A path is a sequence of edges where two consecutive edges have one vertex in common: A path where start and end vertex coincide is called a circle. In directed graphs, we distinguish between directed and undirected paths. A directed circle is called a cycle. 16

Connectedness If for every pair of vertices (a, b) in a graph, there is a path between a and b, the graph is called connected. Every unconnected graph can be decomposed in connected components. A graph with 4 connected components Graph-theoretical distance The distance between two vertices a and b in a graph is the length, i.e., the number of edges, of the shortest path between a and b if such a path exists. Otherwise, the distance is undefined. dist(a, b) = 3 Trees A tree is a graph without circles. A tree: 17

Example: phylogenetic trees, describing genetic kinship between species. A rooted tree is a tree in which one vertex, the root, is distinguished. The root is often drawn at the top: Rooted trees are used to describe hierarchies, e.g., in biological systematics, in organisations or in nested directories of data. 18

Degree The number of edges to which a vertex belongs is called the degree of the vertex. In directed graphs, we distinguish between indegree and outdegree of a vertex. Subdivision A subdivision G' of a graph G is obtained by inserting vertices of degree 2 in the edges of G. Complete graphs The complete graph Kn is the graph with n vertices where every pair of different vertices is connected by an edge. (Also called: Clique.) K1 K2 K3 K4 K5 19

Bipartite graphs A bipartite graph can be split into two disjoint sets of vertices, A and B, such that all edges go from a vertex from A to a vertex from B. (The edges then form a relation between A and B.) The complete bipartite graph Km,n is a bipartite graph with A = m, B = n, and edges go from every vertex of A to every vertex of B. K2,3 K3,3 K2,4 Planarity A graph is planar if its vertices and edges can be embedded in the plane, with edges as arcs in the plane, such that no two different edges intersect in points different from their start and end vertex. 20

non-planar embedding planar embedding of the same graph Kuratowski's theorem: A graph is planar if and only if it does not contain any subdivision of K5 or K3,3. K5 K3,3 21

5. Functions The function is a fundamental notion in mathematics. It is used to describe: - a dependency between two variables (e.g., between measured sizes of the same objects) - a transformation of data during some calculation or processing step input f output - a development of a variable in time or in space (e.g., heigth growth of a plant; magnetic field strength in space...) Frequently used synonyms for function: mapping, transformation, operator The precise definition of a function identifies it with the relation between "input" (argument(s)) and "output" (value), i.e., a function is defined as a special case of a relation: A relation R between the sets A (= possible input values) and B (= possible values) is a function if for every a A there is exactly one b B with a R b. We write then f instead of R and use frequently the notation f(a) = b. Further typical notations: f: A B, a b. 22

The following situation is thus excluded for functions, because a would have two different "images" in B : Allowed is: f(a) must be unique. f(a) = c, f(b) = c. Written as set: f = {(a, c); (b, c)} A B. We say: "f maps a to c", "c is an image of a under f ". f is the function, f(a) is a special value. a is called the argument of f. Different notations: f(a) or fa af prefix notation postfix notation 23

Domain and image of a function Multivariate functions 24

Injective, surjective, bijective functions 25

How to obtain the inverse function of a bijective real-valued function (with one argument): solve f(x) = y for x, so you obtain x = f 1 (y) switch the names of the variables (x y) 26