CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Chapter 8 Topics in Graph Theory
Lecture 5 Graph Theory. Graphs Graphs are the most useful model with computer science such as logical design, formal languages, communication network,
MCA 202: Discrete Mathematics under construction Instructor Neelima Gupta
Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
Graph-02.
1 Lecture 5 (part 2) Graphs II Euler and Hamiltonian Path / Circuit Reading: Epp Chp 11.2, 11.3.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
What is the first line of the proof? a). Assume G has an Eulerian circuit. b). Assume every vertex has even degree. c). Let v be any vertex in G. d). Let.
Discrete Structures Chapter 7B Graphs Nurul Amelina Nasharuddin Multimedia Department.
Representing Graphs Wade Trappe. Lecture Overview Introduction Some Terminology –Paths Adjacency Matrix.
Discrete Structures Chapter 7A Graphs Nurul Amelina Nasharuddin Multimedia Department.
Homework collection Thursday 3/29 Read Pages 160 – 174 Page 185: 1, 3, 6, 7, 8, 9, 12 a-f, 15 – 20.
What is the first line of the backwards direction of this proof? 1.Assume G is a block. 2.Assume every pair of vertices lie on a common cycle. 3.Assume.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
1/22/03Tucker, Applied Combinatorics, Section EDGE COUNTING TUCKER, APPLIED COMBINATORICS, SECTION 1.3, GROUP B Michael Duquette & Amanda Dargie.
GRAPH Learning Outcomes Students should be able to:
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
5.1  Routing Problems: planning and design of delivery routes.  Euler Circuit Problems: Type of routing problem also known as transversability problem.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CS106X – Programming Abstractions in C++ Cynthia Bailey Lee BFS animation slides by Keith Schwarz CS2 in C++ Peer Instruction Materials by Cynthia Bailey.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Can you connect the dots as shown without taking your pen off the page or drawing the same line twice.
Euler and Hamilton Paths. Euler Paths and Circuits The Seven bridges of Königsberg a b c d A B C D.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSNB143 – Discrete Structure Topic 9 – Graph. Learning Outcomes Student should be able to identify graphs and its components. Students should know how.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Graphs.  Definition A simple graph G= (V, E) consists of vertices, V, a nonempty set of vertices, and E, a set of unordered pairs of distinct elements.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Programming Abstractions Cynthia Lee CS106X. Upcoming Topics Graphs! 1.Basics  What are they? How do we represent them? 2.Theorems  What are some things.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Graph theory and networks. Basic definitions  A graph consists of points called vertices (or nodes) and lines called edges (or arcs). Each edge joins.
MAT 2720 Discrete Mathematics Section 8.2 Paths and Cycles
Chapter 11 - Graph CSNB 143 Discrete Mathematical Structures.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
COMPSCI 102 Introduction to Discrete Mathematics.
CS106X – Programming Abstractions in C++ Cynthia Bailey Lee CS2 in C++ Peer Instruction Materials by Cynthia Bailey Lee is licensed under a Creative Commons.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
(CSC 102) Lecture 30 Discrete Structures. Graphs.
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
9.5 Euler and Hamilton graphs. 9.5: Euler and Hamilton paths Konigsberg problem.
1 Lecture 5 (part 2) Graphs II (a) Circuits; (b) Representation Reading: Epp Chp 11.2, 11.3
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Programming Abstractions Cynthia Lee CS106B. Upcoming Topics Graphs! 1.Basics  What are they? How do we represent them? 2.Theorems  What are some things.
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 10.
CSNB 143 Discrete Mathematical Structures
Graphs Hubert Chan (Chapter 9) [O1 Abstract Concepts]
CSE 20 – Discrete Mathematics
Eulerian tours Miles Jones MTThF 8:30-9:50am CSE 4140 August 15, 2016.
Discrete Structures – CNS2300
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Can you draw this picture without lifting up your pen/pencil?
Introduction to Graph Theory Euler and Hamilton Paths and Circuits
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Euler and Hamilton Paths
Discrete Mathematics for Computer Science
Planarity.
Presentation transcript:

CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International License. Based on a work at Permissions beyond the scope of this license may be available at LeeCreative Commons Attribution- NonCommercial-ShareAlike 4.0 International Licensehttp://peerinstruction4cs.org

Today’s Topics: 1. Graphs 2. Some theorems on graphs 2

Graphs  Model relations between pairs of objects  Basic ingredient in many algorithms: Network routing, GPS guidance, Simulation of chemical reactions,… 3

San diego road graph 4

Graph terminology  The fruits are the A. Graphs B. Vertices C. Edges D. Loops E. None/other/more than one 5

Graph terminology  The arrows are the A. Graphs B. Vertices C. Edges D. Loops E. None/other/more than one 6

Graph terminology  Is this graph A. Undirected B. Directed C. Both D. Neither E. None/other/more than one 7

Graph terminology  Which of the following is not a correct graph 8 A.B.C. D. None/other/more than one

Our first graph theorem  We already saw a theorem about graphs!  Recall: in any group of 6 people, either there are 3 that form a club, or 3 that are strangers  Any graph with 6 vertices contains either a triangle (3 vertices all connected) or an empty triangle (3 vertices not connected) 9

Our second graph theorem  Let G be an undirected graph  Degree of a vertex – number of edges adjacent to it (e.g. touch it)  Denote it by degree(v)  Theorem: in any undirected graph, the sum of all the degrees is even  Try and prove yourself first 10

Our second graph theorem  Theorem: in any undirected graph, the sum of all the degrees is even  Proof: Consider pairs (v,e) with v a vertex and e an edge adjacent to it. Create a list of all such pairs. How many elements this list has? We calculate it in two ways 1. Each vertex v has degree(v) edges adjacent to it, so this list has sum of degrees many elements 2. Each edge has 2 vertices adjacent to it, so this list has twice the number of edges many elements So, sum of degrees = twice the number of edges, hence it must be even. QED. 11

Eulerian graphs  Let G be an undirected graph  A graph is Eulerian if it can drawn without lifting the pen and without repeating edges  Is this graph Eulerian? A. Yes B. No 12

Eulerian graphs  Let G be an undirected graph  A graph is Eulerian if it can drawn without lifting the pen and without repeating edges  What about this graph A. Yes B. No 13

Eulerian graphs  How can we check if a graph is Eulerian? A. Check all possible paths B. Stare and guess C. Be brave and do some math 14

Eulerian graphs  Degree of a vertex: number of edges adjacent to it  Euler’s theorem: a graph is Eulerian iff the number of vertices with odd degrees is either 0 or 2 (eg all vertices or all but two have even degrees)  Does it work for and ? 15

Proving Euler’s theorem  Euler’s theorem gives a necessary and sufficient condition for a graph to be Eulerian  All degrees are even  Two degrees odd, rest are even  Will prove in class that this is necessary  Take-home challenge: prove that this is also sufficient 16

Proving Euler’s theorem: necessary part  Euler’s theorem (necessary part): If a graph G is Eulerian then all degrees are even; or two degrees are odd and rest are even Try to prove it first yourself 17

Proving Euler’s theorem: necessary part  Proof of Euler’s theorem (necessary part): Let G be a graph with an Euler path: v 1,v 2,v 3,….,v k where (v i,v i+1 ) are edges in G; vertices may appear more than once; and each edge of G is accounted for exactly once. The degree of a vertex of G is the number of edges it has. For any internal vertex in the path (eg not v 1 or v k ), we count 2 edges in the path (one going in and one going out). So, any vertex which is not v 1 or v k must have an even degree. If v1  vk then both have odd degrees. If v1=vk is the same vertex this is also has even degree. QED. 18

Proof by contradiction Another example (student self-study) 19

Example 2  A number x is rational if x=a/b for integers a,b.  E.g. 3=3/1, 1/2, -3/4, 0=0/1  A number is irrational if it is not rational  E.g (proved in textbook)  Theorem: If x 2 is irrational then x is irrational. 20

Example 2  Theorem: If x 2 is irrational then x is irrational.  Proof: by contradiction. Assume that A. There exists x where both x,x 2 are rational B. There exists x where both x,x 2 are irrational C. There exists x where x is rational and x 2 irrational D. There exists x where x is irrational and x 2 rational E. None/other/more than one 21

Example 2  Theorem: If x 2 is irrational then x is irrational.  Proof: by contradiction. Assume that there exists x where x is rational and x 2 irrational. 22 Try by yourself first

Example 2  Theorem: If x 2 is irrational then x is irrational.  Proof: by contradiction. Assume that there exists x where x is rational and x 2 irrational. 23 Since x is rational x=a/b where a,b are integers. But then x 2 =a 2 /b 2. Both a 2,b 2 are also integers and hence x 2 is rational. A contracition.

Example 3  Theorem: is irrational  Proof (by contradiction). THIS ONE IS MORE TRICKY. TRY BY YOURSELF FIRST IN GROUPS. 24

Example 3  Theorem: is irrational  Proof (by contradiction).  Assume not. Then there exist integers a,b such that  Squaring gives So also is rational since [So, to finish the proof it is sufficient to show that is irrational. ] 25

Example 3  Theorem: is irrational  Proof (by contradiction).  is rational … is rational.  =c/d for positive integers c,d. Assume that d is minimal such that c/d= Squaring gives c 2 /d 2 =6. So c 2 =6d 2 must be divisible by 2. Which means c is divisible by 2. Which means c 2 is divisible by 4. But 6 is not divisible by 4, so d 2 must be divisible by 2. Which means d is divisible by 2. So both c,d are divisible by 2. Which means that (c/2) and (d/2) are both integers, and (c/2) / (d/2) = Contradiction to the minimality of d. 26