- 39 Views
- Uploaded on
- Presentation posted in: General

CSE 20 â€“ Discrete Mathematics

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

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Â http://peerinstruction4cs.org.Permissions beyond the scope of this license may be available atÂ http://peerinstruction4cs.org.

CSE 20 â€“ Discrete Mathematics

Dr. Cynthia Bailey Lee

Dr. Shachar Lovett

- Graphs
- Some theorems on graphs

- Model relations between pairs of objects
- Basic ingredient in many algorithms: Network routing, GPS guidance, Simulation of chemical reactions,â€¦

- The fruits are the
- Graphs
- Vertices
- Edges
- Loops
- None/other/more than one

- The arrows are the
- Graphs
- Vertices
- Edges
- Loops
- None/other/more than one

- Is this graph
- Undirected
- Directed
- Both
- Neither
- None/other/more than one

- Which of the following is not a correct graph

A.

B.

C.

D. None/other/more than one

- 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)

- 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

- 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

- Each vertex v has degree(v) edges adjacent to it, so this list has sum of degrees many elements
- 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.

- 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?
- Yes
- No

- 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
- Yes
- No

- How can we check if a graph is Eulerian?
- Check all possible paths
- Stare and guess
- Be brave and do some math

- Degree of a vertex: number of edges adjacent to it
- Eulerâ€™s theorem: a graph is Eulerianiff 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 ?

- 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

- 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

- Proof of Eulerâ€™s theorem (necessary part):
Let G be a graph with an Euler path: v1,v2,v3,â€¦.,vk where (vi,vi+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 v1 or vk), we count 2 edges in the path (one going in and one going out). So, any vertex which is not v1 or vk 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.

Another example (student self-study)

- 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

- E.g (proved in textbook)

- Theorem: If x2 is irrational then x is irrational.
- Proof: by contradiction.
Assume that

- There exists x where both x,x2 are rational
- There exists x where both x,x2 are irrational
- There exists x where x is rational and x2 irrational
- There exists x where x is irrational and x2 rational
- None/other/more than one

- Theorem: If x2 is irrational then x is irrational.
- Proof: by contradiction.
Assume that there exists x where x is rational and x2 irrational.

Try by yourself first

- Theorem: If x2 is irrational then x is irrational.
- Proof: by contradiction.
Assume that there exists x where x is rational and x2 irrational.

Since x is rational x=a/b where a,b are integers.

But then x2=a2/b2. Both a2,b2 are also integers and hence x2 is rational.

A contracition.

- Theorem: is irrational
- Proof (by contradiction).
THIS ONE IS MORE TRICKY.

TRY BY YOURSELF FIRST IN GROUPS.

- 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. ]

- 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 c2/d2=6.

So c2=6d2 must be divisible by 2.

Which means c is divisible by 2.

Which means c2 is divisible by 4.

But 6 is not divisible by 4, so d2 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.