Discrete Mathematics Introduction

Similar documents
5 Graphs

Discrete mathematics , Fall Instructor: prof. János Pach

Introduction III. Graphs. Motivations I. Introduction IV

WUCT121. Discrete Mathematics. Graphs

An Introduction to Graph Theory

Chapter 18 out of 37 from Discrete Mathematics for Neophytes: Number Theory, Probability, Algorithms, and Other Stuff by J. M. Cargal.

Assignment 4 Solutions of graph problems

2 Review of Set Theory

Graph Theory. 1 Introduction to Graphs. Martin Stynes Department of Mathematics, UCC January 26, 2011

SPERNER S LEMMA MOOR XU

Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1

Graph Theory Questions from Past Papers

Chapter 1. Math review. 1.1 Some sets

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

ASSIGNMENT 4 SOLUTIONS

On the Number of Tilings of a Square by Rectangles

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

Senior Math Circles November 25, 2009 Graph Theory II

Midterm 2 Solutions. CS70 Discrete Mathematics and Probability Theory, Spring 2009

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

The Probabilistic Method

Grades 7 & 8, Math Circles 31 October/1/2 November, Graph Theory

Catalan Numbers. Table 1: Balanced Parentheses

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18

Computer Science 280 Fall 2002 Homework 10 Solutions

PCP and Hardness of Approximation

GRAPH THEORY: AN INTRODUCTION

Genus Ranges of 4-Regular Rigid Vertex Graphs

Midterm 2 Solutions. CS70 Discrete Mathematics for Computer Science, Fall 2007

Graph theory. Po-Shen Loh. June We begin by collecting some basic facts which can be proved via bare-hands techniques.

Maximal Monochromatic Geodesics in an Antipodal Coloring of Hypercube

Count by Writing Code. Saad Mneimneh

PACKING DIGRAPHS WITH DIRECTED CLOSED TRAILS

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.

Artificial Intelligence

THE PRINCIPLE OF INDUCTION. MARK FLANAGAN School of Electrical, Electronic and Communications Engineering University College Dublin

Framework for Design of Dynamic Programming Algorithms

On median graphs and median grid graphs

Discrete Mathematics and Probability Theory Fall 2013 Midterm #2

TILING RECTANGLES SIMON RUBINSTEIN-SALZEDO

CS195H Homework 5. Due:March 12th, 2015

Math.3336: Discrete Mathematics. Chapter 10 Graph Theory

Discrete Mathematics Course Review 3

DO NOT RE-DISTRIBUTE THIS SOLUTION FILE

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

CSE 312 Foundations II. 2. Counting. Winter 2017 W.L. Ruzzo

Week 8: The fundamentals of graph theory; Planar Graphs 25 and 27 October, 2017

Intermediate Math Circles Wednesday, February 8, 2017 Graph Theory I

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

1. CONVEX POLYGONS. Definition. A shape D in the plane is convex if every line drawn between two points in D is entirely inside D.

Math 170- Graph Theory Notes

STUDENT NUMBER: MATH Final Exam. Lakehead University. April 13, Dr. Adam Van Tuyl

The Game of Criss-Cross

On the Minimum Number of Convex Quadrilaterals in Point Sets of Given Numbers of Points

arxiv: v1 [math.co] 17 Jan 2014

Math 311. Trees Name: A Candel CSUN Math

UNM - PNM STATEWIDE MATHEMATICS CONTEST XLI. February 7, 2009 Second Round Three Hours

Majority and Friendship Paradoxes

Notebook Assignments

Computational Biology Lecture 12: Physical mapping by restriction mapping Saad Mneimneh

An Interesting Way to Combine Numbers

TOURNAMENT OF THE TOWNS, Glossary

where each number (after the first two 1 s) is the sum of the previous two numbers.

Basic Combinatorics. Math 40210, Section 01 Fall Homework 4 Solutions

Introduction to Counting, Some Basic Principles

Tangencies between disjoint regions in the plane

A.1 Numbers, Sets and Arithmetic

The University of Sydney MATH2969/2069. Graph Theory Tutorial 2 (Week 9) 2008

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

Definition 1 (Hand-shake model). A hand shake model is an incidence geometry for which every line has exactly two points.

Greedy Algorithms 1 {K(S) K(S) C} For large values of d, brute force search is not feasible because there are 2 d {1,..., d}.

Elements of Graph Theory

To illustrate what is intended the following are three write ups by students. Diagonalization

MATRIX INTEGRALS AND MAP ENUMERATION 1

Lecture 20 : Trees DRAFT

Graph Theory Mini-course

Graph Theory: Introduction

arxiv: v2 [math.co] 13 Aug 2013

MITOCW watch?v=kvtlwgctwn4

6.856 Randomized Algorithms

Cache-Oblivious Traversals of an Array s Pairs

Introduction to Algorithms / Algorithms I Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/18/14

Ma/CS 6b Class 26: Art Galleries and Politicians

TEACHERS NOTES AND SOLUTIONS

Which n-venn diagrams can be drawn with convex k-gons?

THE LABELLED PEER CODE FOR KNOT AND LINK DIAGRAMS 26th February, 2015

Mathematics Background

UNSW School Mathematics Competition

Graph Theory Part Two

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

14.1 Encoding for different models of computation

Basics of Graph Theory

Notes for Recitation 9

2 Geometry Solutions

c 2011 BRITTANY NICOLE MOTT ALL RIGHTS RESERVED

1. A busy airport has 1500 takeo s perday. Provetherearetwoplanesthatmusttake o within one minute of each other. This is from Bona Chapter 1 (1).

arxiv: v1 [math.co] 20 Aug 2012

HOMEWORK #4 SOLUTIONS - MATH 4160

Solutions to In Class Problems Week 9, Fri.

Scheduling, Map Coloring, and Graph Coloring

Transcription:

Discrete Mathematics Introduction Saad Mneimneh 1 Introduction College mathematics will often focus on calculus, and while it is true that calculus is the most important field that started modern mathematics, it is very technical. For example, it takes a lot of work to introduce notions like continuity, derivatives, and limits. It took centuries just to develop proper definitions. One, however, can develop a feel of mathematics and apply mathematical methods in useful ways to daily problems by looking at other fields of mathematics such as discrete mathematics. So what is discrete mathematics? Well, discrete mathematics deal with things that are not continuous, like number theory which studies integers. Consider for example the sum 1++3+...+n. In a continuous setting, one would explore the following expression n 0 which is slightly different that the sum above. A typical knowledge of calculus will make anyone realize that the integral represents the area under the function f(x) = x taken between x = 0 and x = n. But what does the sum represent? As we will see later on, this is related to an important result known as the handshake lemma and has many applications. Discrete mathematics is more like dealing with puzzles. The following is a list of topics that are typically covered in a discrete mathematics course: combinatorics/counting xdx proofs (it is a mathematics course after all, and there is no mathematics without proofs) algorithms/recursion/complexity number theory probability graph theory

So what is the pre-requisite for such a course. Almost nothing. But you will need to think in abstract terms. Let s start with an example to illustrate this fact. Euler s formula: v e + f = What is this formula about? Imagine a map where boundaries are non-crossing lines as shown below. The quantities v, e, and f refer to vertices, edges, and faces respectively. Vertices are the dots, edges are the boundaries, and faces are the regions on the map. We have 13 vertices, 18 edges, and 7 faces (including the outer face). We can easily verify that 13 18 + 7 =. In general, a graph consists of a set of vertices and a set of edges connecting pairs of vertices. If edges do not cross the graph is said to be planar and faces are well defined. In fact, vertices can be placed arbitrarily and edges don t have to be straight lines. Therefore, a graph is planar if it can be drawn while avoiding crossings (even if it can be drawn with crossings). Euler s formula says that for any planar graph, v e + f =. What does it take to obtain such a result? Not much. Let s start with the smallest planar graph consisting of a single vertex. This planar graph has 1 vertex, 0 edges, and 1 face (the outer face). Therefore, it satisfies the formula. There are two ways to grow the graph. (1) add a vertex and connect it with an edge to an existing vertex, in this case we increase both v and e by 1, and thus we keep the sum unchanged. () add an edge between two existing vertices, in this case we increase both e and f by 1 (we create a face), and thus we keep the sum unchanged. We just rediscovered Euler s result! This type of argument is know as proof by induction, a technique that we will study later. 3 Why counting? In the example above, we counted the vertices, edges, and faces, and established a result. Counting is a general technique that can help us establish facts. Counting can also give us a sense of the complexity of objects we are dealing with. Consider the following example, that I will call the lazy professor example. A professor randomly permutes the tests among his students and asks

each student to grade the test he/she gets. The professor would like to compute the probability that no student gets his/her own test (of course, a desirable outcome). On way to calculate this probability is by enumerating all possible permutations, and counting those permutations in which no students gets his/her own test. Here s an example with three students A, B, and C. The possible permutations are the following (showing the assignment for test A, test B, and test C respectively): (A,B,C) (A,C,B) (B,A,C) (B,C,A) (C,A,B) (C,B,A) Among these permutations (6), only (B,C,A) and (C,A,B) are good. Therefore, the probability is /6 = 1/3. In general, however, the number of permutations is n n! = 1... n = i where n is the number of students. Knowing this fact implies that this enumeration is highly inefficient. We will see how to compute this probability using a counting technique known as inclusion-exclusion. 4 Basic examples of counting Consider the game of snakes and ladders. You probably played this game before. The nice thing about it is that no thinking is required! So it is a light activity that can be done to entertain. i=1

But how long does one game last? Consider a snakes and ladders game with n squares. We wish to place 10 snakes and 10 ladders. How many possible configurations are possible? Simulating those configurations will help determine the best layout of snakes and ladders in terms of the average length of a game. But counting those configurations is not a trivial task (well, it is not so hard either). Let s simplify a little bit. Assume we are going to place one snake only. How many snakes are possible? The head of the snake can be in any square (let s ignore that the head cannot be in the last square). The tail must always be in a lower number square. If the head is in square n, the tail can be in squares n 1,n,...,1. Therefore, we have n 1 snakes with head in square n. This can be generalized, i.e. we have i 1 snakes with head in square i. The total number of snakes is therefore: (n 1) + (n ) +... + 1 Why do we add all the above? The idea is that each group of snakes is disjoint from all others. In other words, a snake cannot have its head in square i and in square j for i j (unless it is a double headed snake!). The addition principle: Consider k sets S 1,..., S k that are pairwise disjoint. We denote by S i the size of set S i. The total number of elements in all sets is S 1 + S +... + S k. There is another way to count the number of possible snakes. Often when counting object, it is useful to obtain an algorithm that generates them. For instance, to generate a snake, we first choose a square, then we choose another square. The two squares together define the snake. This can be thought of as an activity with two stages. In the first stage, we have n choices. In the second stages, we have n 1 choices, regardless of the choice made in the first stage. In other words, for every choice that we make in the first stage, we have n 1 choices for the second stage (not the same choices). Therefore, we have n(n 1) possible outcomes. However, this is not the number of snakes because we overcounted. How do we know that we overcounted? Simply ask the following question: Given a snake, how many ways generate that same snake by our algorithm? Observe that square i followed by square j define the same snake as square j followed by square i (because the head of the snake has to be in the higher square). Therefore, each snake is counted exactly twice. The number of possible snakes is n(n 1)/. The multiplication principle: If an activity consists of k stages, and stage i can be carried out in α i ways, regardless of other stages, the activity can be carried out in α 1 α...α k ways. This is illustrated in following decision tree for three stages. Starting from the root of the tree, the number of leaves that we can reach is α 1 α (in computer science a tree is almost always upside down).

α 1 α α Note that the α 1 α...α k ways are not necessarily distinct. It depends on what we are counting. Sometimes we overcount, so we have to adjust by dividing. The general strategy is, therefore, to come up with an algorithm of making choices that generate the objects that we are counting. We have to make sure: every generated outcome is valid all valid outcomes can be generated each valid outcome is generated exactly once; otherwise, adjust based on the amount of overcounting In our algorithm above, every outcome is a valid snake (based on our interpretation of the squares), all snakes can be generated (their squares can be generated), and each outcome is generated twice (so we must divide by ). We have just established the following: 1 + +... + (n 1) = n(n 1) which is the same as saying (make sure you understand why): 1 + +... + n = n(n + 1) This was proved by counting the same thing in two different ways. This is called a proof by a combinatorial argument. If we define T n, the n th triangular number T n = 1 + +... + n = then the number of possible snakes is T n 1. n i i=1

5 Handshake lemma The above count is also related to the handshake lemma. Consider n people that shake hands with each other. How many handshakes do we count? Let s imagine an algorithm that generates a handshake. We first choose a person, then we choose another person. Those two persons define a handshake. By the multiplication principle, the total number of outcomes is n(n 1). But again, we overcounted! Each handshake is generated twice because the choices (A,B) and (B,A) define the same handshake. So we have to divide by to get n(n 1)/. This can be viewed as a graph with n vertices (the people) and an edge connecting every pair of vertices (the handshakes). But what happens if we drop some edges, i.e. not all handshakes were made. Consider the following example: Define the degree of a vertex to be the number of edges touching it. In the graph above, we see degrees of 1, 1, 4,,, 3,, 1 (try to map them to the vertices, interesting exercise: come up with two graphs that have the exact same set of degrees). What can we say about the sum of the degrees? By summing up the degrees we basically count edges ( handshakes ). Each edges is counted twice, once from each side. Therefore, the sum of the degrees is equal to twice the number of edges. That s the handshake lemma! This also implies that the sum of degrees is always even. This in turn implies that there is a even number of vertices with odd degrees (why?). The handshake lemma has many applications, e.g. the mountain climbing problem (search for it online). 6 Generalization What does n(n 1)/ really represent? It is not hard to see that this is the number of ways of choosing two from n objects (where order is not important). In other words, this is the number of pairs that we can form on n objects. The snake was defined as a pair of squares, the handshake as a pair of people. This quantity has a notation (and we call it n choose two). ( n ) = n(n 1) ( ) n Therefore, it is legitimate to ask what is for k = 0,1,,...,n? In other k words, in how many ways can we choose k from n objects?