Week 10 - Wednesday.  What did we talk about last time?  Counting practice  Pigeonhole principle.

Slides:



Advertisements
Similar presentations
CSE 211 Discrete Mathematics
Advertisements

Chapter 8 Topics in Graph Theory
Chapter 9 Graphs.
Lecture 5 Graph Theory. Graphs Graphs are the most useful model with computer science such as logical design, formal languages, communication network,
22C:19 Discrete Math Graphs Fall 2010 Sukumar Ghosh.
Introduction to Graph Theory Instructor: Dr. Chaudhary Department of Computer Science Millersville University Reading Assignment Chapter 1.
22C:19 Discrete Math Graphs Fall 2014 Sukumar Ghosh.
Walks, Paths and Circuits Walks, Paths and Circuits Sanjay Jain, Lecturer, School of Computing.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 – CHAPTER 4 GRAPHS 1.
Lecture 21 Paths and Circuits CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Section 14.1 Intro to Graph Theory. Beginnings of Graph Theory Euler’s Konigsberg Bridge Problem (18 th c.)  Can one walk through town and cross all.
Introduction This chapter explores graphs and their applications in computer science This chapter explores graphs and their applications in computer science.
Edited by Malak Abdullah Jordan University of Science and Technology Data Structures Using C++ 2E Chapter 12 Graphs.
Chapter 2 Probability. 2.1 Sample Spaces and Events.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 21: Graphs.
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.
CTIS 154 Discrete Mathematics II1 8.2 Paths and Cycles Kadir A. Peker.
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
22C:19 Discrete Math Graphs Spring 2014 Sukumar Ghosh.
Graphs and Euler cycles Let Maths take you Further…
Week 10 - Monday.  What did we talk about last time?  More permutations  Addition rule  Inclusion and exclusion.
Eulerian Graphs CSE 331 Section 2 James Daly. Reminders Project 3 is out Covers graphs Due Friday.
Copyright (c) 2004 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 2 Probability.
GRAPH Learning Outcomes Students should be able to:
Data Structures Using C++ 2E
Chapter 15 Graph Theory © 2008 Pearson Addison-Wesley.
Graph Theoretic Concepts. What is a graph? A set of vertices (or nodes) linked by edges Mathematically, we often write G = (V,E)  V: set of vertices,
Graph Theory Topics to be covered:
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
Week 12 - Friday.  What did we talk about last time?  Asymptotic notation.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 9 (Part 2): Graphs  Graph Terminology (9.2)
Week 11 - Wednesday.  What did we talk about last time?  Graphs  Euler paths and tours.
1 CS104 : Discrete Structures Chapter V Graph Theory.
Based on slides by Y. Peng University of Maryland
Week 11 - Wednesday.  What did we talk about last time?  Exam 2 post-mortem  Combinations.
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.
Week 11 - Monday.  What did we talk about last time?  Binomial theorem and Pascal's triangle  Conditional probability  Bayes’ theorem.
Fall 2015 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1.
1 12/2/2015 MATH 224 – Discrete Mathematics Formally a graph is just a collection of unordered or ordered pairs, where for example, if {a,b} G if a, b.
Topics Paths and Circuits (11.2) A B C D E F G.
Week 12 - Wednesday.  What did we talk about last time?  Matching  Stable marriage  Started Euler paths.
An Introduction to Graph Theory
Graph Theory and Applications
Introduction to Probability (Dr. Monticino). Assignment Sheet  Read Chapters 13 and 14  Assignment #8 (Due Wednesday March 23 rd )  Chapter 13  Exercise.
Associated Matrices of Vertex Edge Graphs Euler Paths and Circuits Block Days April 30, May 1 and May
Graph theory and networks. Basic definitions  A graph consists of points called vertices (or nodes) and lines called edges (or arcs). Each edge joins.
Euler Paths and Circuits. The original problem A resident of Konigsberg wrote to Leonard Euler saying that a popular pastime for couples was to try.
Lecture 52 Section 11.2 Wed, Apr 26, 2006
Chapter 9: Graphs.
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
CS 261 – Nov. 17 Graph properties – Bipartiteness – Isomorphic to another graph – Pseudograph, multigraph, subgraph Path Cycle – Hamiltonian – Euler.
Graphs Rosen, Chapter 8. NOT ONE OF THESE! One of these!
1 Euler and Hamilton paths Jorge A. Cobb The University of Texas at Dallas.
Week 11 - Wednesday.  What did we talk about last time?  Graphs  Paths and circuits.
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
Week 10 - Monday.  What did we talk about last time?  Combinations  Binomial theorem.
An Introduction to Graph Theory
Week 7 - Monday CS 113.
Graph Theory An Introduction.
Graphs Hubert Chan (Chapter 9) [O1 Abstract Concepts]
Week 12 - Friday CS322.
Chapter 5 Fundamental Concept
Graph theory Definitions Trees, cycles, directed graphs.
Agenda Lecture Content: Introduction to Graph Path and Cycle
Introduction to Graph Theory Euler and Hamilton Paths and Circuits
Decision Maths Graphs.
CHAPTER 15 Graph Theory.
Week 10 - Wednesday CS221.
Presentation transcript:

Week 10 - Wednesday

 What did we talk about last time?  Counting practice  Pigeonhole principle

 This is a puzzle we should have done with sequences  Consider the following sequence, which should be read from left to right, starting at the top row  What are the next two rows in the sequence?

 Let A and B be events in the sample space S  0 ≤ P(A) ≤ 1  P(  ) = 0 and P(S) = 1  If A  B = , then P(A  B) = P(A) + P(B)  It is clear then that P(A c ) = 1 – P(A)  More generally, P(A  B) = P(A) + P(B) – P(A  B)  All of these axioms can be derived from set theory and the definition of probability

 What is the probability that a card drawn randomly from an Anglo-American 52 card deck is a face card (jack, queen, or king) or is red (hearts or diamonds)?  Hint:  Compute the probability that it is a face card  Compute the probability that it is red  Compute the probability that it is both

 Expected value is one of the most important concepts in probability, especially if you want to gamble  The expected value is simply the sum of all events, weighted by their probabilities  If you have n outcomes with real number values a 1, a 2, a 3, … a n, each of which has probability p 1, p 2, p 3, … p n, then the expected value is:

 A normal American roulette wheel has 38 numbers: 1 through 36, 0, and 00  18 numbers are red, 18 numbers are black, and 0 and 00 are green  The best strategy you can have is always betting on black (or red)  If you bet $1 on black and win, you get $1, but you lose your dollar if it lands red or green  What is the expected value of a bet?

 Given that some event A has happened, the probability that some event B will happen is called conditional probability  This probability is:

 Given two, fair, 6-sided dice, what is the probability that the sum of the numbers they show when rolled is 8, given that both of the numbers are even?

 Let sample space S be a union of mutually disjoint events B 1, B 2, B 3, … B n  Let A be an event in S  Let A and B 1 through B n have non-zero probabilities  For B k where 1 ≤ k ≤ n

 Bayes' theorem is often used to evaluate tests that can have false positives and false negatives  Consider a test for a disease that 1 in 5000 people have  The false positive rate is 3%  The false negative rate is 1%  What's the probability that a person who tests positive for the disease has the disease?  Let A be the event that the person tests positively for the disease  Let B 1 be the event that the person actually has the disease  Let B 2 be the event that the person does not have the disease  Apply Bayes' theorem

 If events A and B are events in a sample space S, then these events are independent if and only if P(A  B) = P(A)∙P(B)  This should be clear from conditional probability  If A and B are independent, then P(B|A) = P(B)

 A graph G is made up of two finite sets  Vertices: V(G)  Edges: E(G)  Each edge is connected to either one or two vertices called its endpoints  An edge with a single endpoint is called a loop  Two edges with the same sets of endpoints are called parallel  Edges are said to connect their endpoints  Two vertices that share an edge are said to be adjacent  A graph with no edges is called empty

 Graphs can be used to represent connections between arbitrary things  Streets connecting towns  Links connecting computers in a network  Friendships between people  Enmities between people  Almost anything…

 We can represent graphs in many ways  One is simply by listing all the vertices, all the edges, and all the vertices connected by each edge  Let V(G) = {v 1, v 2, v 3, v 4, v 5, v 6 }  Let E(G) = {e 1, e 2, e 3, e 4, e 5, e 6, e 7 }  Edges connect the following vertices:  Draw the graph with the given connections EdgeVertices e1e1 {v 1, v 2 } e2e2 {v 1, v 3 } e3e3 e4e4 {v 2, v 3 } e5e5 {v 5, v 6 } e6e6 {v5}{v5} e7e7 {v6}{v6}

 Graphs can (generally) be drawn in many different ways  We can label graphs to show that they are the same  Label these two graphs to show they are the same:

 A simple graph does not have any loops or parallel edges  Let n be a positive integer  A complete graph on n vertices, written K n, is a simple graph with n vertices such that every pair of vertices is connected by an edge  Draw K 1, K 2, K 3, K 4, K 5  A complete bipartite graph on (m, n) vertices, written K m,n is a simple graph with a set of m vertices and a disjoint set of n vertices such that:  There is an edge from each of the m vertices to each of the n vertices  There are no edges among the set of m vertices  There are no edges among the set of n vertices  Draw K 3,2 and K 3,3  A subgraph is a graph whose vertices and edges are a subset of another graph

 The degree of a vertex is the number of edges that are incident on the vertex  The total degree of a graph G is the sum of the degrees of all of its vertices  What's the relationship between the degree of a graph and the number of edges it has?  What's the degree of a complete graph with n vertices?  Note that the number of vertices with odd degree must be even… why?

 Used to be Königsberg, Prussia  Now called Kaliningrad, Russia  On the Pregel River, including two large islands

 In 1736, the islands were connected by seven bridges  In modern times, there are only five

 After a lazy Sunday and a bit of drinking, the citizens would challenge each other to walk around the city and try to find a path which crossed each bridge exactly once

 What did Euler find?  The same thing you did: nothing  But, he also proved it was impossible  Here’s how: Center Island North Shore East Island South Shore

 By simplifying the problem into a graph, the important features are clear  To arrive as many times as you leave, the degrees of each node must be even (except for the starting and ending points) Center Island North Shore East Island South Shore

 A walk from v to w is a finite alternating sequence of adjacent vertices and edges of G, starting at vertex v and ending at vertex w  A walk must begin and end at a vertex  A path from v to w is a walk that does not contain a repeated edge  A simple path from v to w is a path that does contain a repeated vertex  A closed walk is a walk that starts and ends at the same vertex  A circuit is a closed walk that does not contain a repeated edge  A simple circuit is a circuit that does not have a repeated vertex other than the first and last

 We can always pin down a walk unambiguously if we list each vertex and each edge traversed  How would we notate a walk that starts at v 1 and ends at v 2 and visits every edge exactly once in the following graph?  However, if a graph has no edges, then a sequence of vertices uniquely determines the walk v1v1 v2v2 v3v3 e1e1 e2e2 e3e3 e4e4

 Vertices v and w of G are connected iff there is a walk from v to w  Graph G is connected iff all pairs of vertices v and w are connected to each other  A graph H is a connected component of a graph G iff  H is a subgraph of G  H is connected  No connected subgraph of G has H as a subgraph and contains vertices or edges that are not in H  A connected component is essentially a connected subgraph that cannot be any larger  Every (non-empty) graph can be partitioned into one or more connected components

 What if you want to find an Euler circuit of your own?  If a graph is connected, non-empty, and every node in the graph has even degree, the graph has an Euler circuit  Algorithm to find one: 1. Pick an arbitrary starting vertex 2. Move to an adjacent vertex and remove the edge you cross from the graph ▪ Whenever you choose such a vertex, pick an edge that will not disconnected the graph 3. If there are still uncrossed edges, go back to Step 2

 An Euler circuit has to visit every edge of a graph exactly once  A Hamiltonian circuit must visit every vertex of a graph exactly once (except for the first and the last)  If a graph G has a Hamiltonian circuit, then G has a subgraph H with the following properties:  H contains every vertex of G  H is connected  H has the same number of edges as vertices  Every vertex of H has degree 2  In some cases, you can use these properties to show that a graph does not have a Hamiltonian circuit  In general, showing that a graph has or does not have a Hamiltonian circuit is NP-complete (widely believed to take exponential time)  Does the following graph have a Hamiltonian circuit? e b ac d

 Matrix representations of graphs  Directed graphs  Graph isomorphism  Our next class is tomorrow

 Work on Homework 8  Due next Friday  Keep reading Chapter 10  Want to go to graduate school?  Apply for a paid summer Research Experience for Undergraduates (REU)  WPI Data Science  FIT Machine Learning  Deadlines are March 28 and March 31  Contact me for more details