Friday's annotated slides (1/25) - maths.nuigalway.ieniall/MA284/Week12-2.pdf · If the graph has n...

15
(1/25) MA284 : Discrete Mathematics Week 12: Trees; Review http://www.maths.nuigalway.ie/ ~ niall/MA284/ 22 and 24 November, 2017 C C H H H C C H H H H H H H 1 Trees Recall... Applications: Chemistry Applications: Decision Trees Spanning trees 2 What we didn’t study Directed graphs Adjacency Matrix 3 Review The Final Exam Past exam papers Revision Questions 4 A summary in one slide (1/2)... Friday's annotated slides

Transcript of Friday's annotated slides (1/25) - maths.nuigalway.ieniall/MA284/Week12-2.pdf · If the graph has n...

Page 1: Friday's annotated slides (1/25) - maths.nuigalway.ieniall/MA284/Week12-2.pdf · If the graph has n vertices, labelled {1,2,...,n},

(1/25)

MA284 : Discrete Mathematics

Week 12: Trees; Review

http://www.maths.nuigalway.ie/~niall/MA284/

22 and 24 November, 2017

C

C H H H

C C H

H H H H H H

1 Trees

Recall...

Applications: Chemistry

Applications: Decision Trees

Spanning trees

2 What we didn’t study

Directed graphs

Adjacency Matrix

3 Review

The Final Exam

Past exam papers

Revision Questions

4 A summary in one slide (1/2)...

Friday's annotated slides

Page 2: Friday's annotated slides (1/25) - maths.nuigalway.ieniall/MA284/Week12-2.pdf · If the graph has n vertices, labelled {1,2,...,n},

What we didn’t study (13/25)

Other topics in combinatorics and graph theory that we have not cover. The

most interesting (to my mind are)

directed graphs

the representation of graphs using adjacency and incidence matrices;

Algorithms, like determining if a graph is connected, or finding the

shortest path between two vertices...

the graph Lapacian;

visualisation of graphs;

and many, many, more...

Page 3: Friday's annotated slides (1/25) - maths.nuigalway.ieniall/MA284/Week12-2.pdf · If the graph has n vertices, labelled {1,2,...,n},

What we didn’t study Directed graphs (14/25)

Graphs often represent networks, such as the road network we had earlier, or

social networks. So far, we have had that, if vertex a is adjacent to vertex b,

then b is adjacent to a.

In many situations, this is not reasonable:

a city road system might have a one-way system;

on a social network, you might follow someone who does not follow you

back.

a

b

c

e

f

dd

f

e

b

c

a

Page 4: Friday's annotated slides (1/25) - maths.nuigalway.ieniall/MA284/Week12-2.pdf · If the graph has n vertices, labelled {1,2,...,n},

What we didn’t study Directed graphs (15/25)

Example: Graph of a tournament (2017 Senior Men’s 6 Nations Rugby)

IRELAND

FRANCE

ENGLAND

ITALY

SCOTLAND

WALES

Page 5: Friday's annotated slides (1/25) - maths.nuigalway.ieniall/MA284/Week12-2.pdf · If the graph has n vertices, labelled {1,2,...,n},

What we didn’t study Adjacency Matrix (16/25)

In a practical setting, a graph must be stored in some computer-readable

format. One of the most comment is an adjacency matrix. If the graph has n

vertices, labelled {1, 2, . . . , n}, then the adjacency matrix is an n× n matrix, A,

with entries

ai,j =

�1 vertex i is adjacent to j

0 otherwise.

24

3

5

1

0 0 0 0 1

0 0 1 1 0

0 1 0 1 1

0 1 1 0 1

1 0 1 1 0

Page 6: Friday's annotated slides (1/25) - maths.nuigalway.ieniall/MA284/Week12-2.pdf · If the graph has n vertices, labelled {1,2,...,n},

What we didn’t study Adjacency Matrix (17/25)

Properties of the adjacency matrix

The adjacency matrix of a graph is symmetric.

The adjacency matrix of a directed graph is not necessarily symmetric.

If B = Ak , then bi,j is the number of paths from vertex i to vertex j .

We can work out if a graph is connected by looking at the eigenvalues of

A.

If the graphs G and H are isomorphic, and have adjacency matrices AG

and Ah, respectively, then there is a permutation matrix, P, such that

PAGP−1 = AH .

Page 7: Friday's annotated slides (1/25) - maths.nuigalway.ieniall/MA284/Week12-2.pdf · If the graph has n vertices, labelled {1,2,...,n},

Review (18/25)

But the set of topics that we did study includes:

1. The additive and multiplicative principles;

2. Sets, including power sets; union and intersection;

3. the Principle of Inclusion/Exclusion (PIE) and its applications;

4. Binomial Coefficients (& lattice paths, bit-strings); Pascal’s triangle;

5. Permutations and Combinations;

6. Stars and Bars, multisets, and the NNI Equations and Inequalities;

7. Algebraic and Combinatorial Proofs;

8. Derangements; counting with repetition;

9. Graph Theory: motivation and basic definitions;

10. Isomorphisms between graphs.

11. Important families of graphs (Cycle graphs, Kn, Kn,n, etc.)

12. Planar & non-planar graphs; chromatic numbers, Euler’s formula, . . .

13. Convex polyhedra, and Platonic solids;

14. Graph Colouring; Greedy and Welsh-Powell algorithms;

15. Eulerian and Hamiltonian graphs;

16. Trees.

Page 8: Friday's annotated slides (1/25) - maths.nuigalway.ieniall/MA284/Week12-2.pdf · If the graph has n vertices, labelled {1,2,...,n},

Review The Final Exam (19/25)

The final exam for Discrete Mathematics:

1 There are 10 questions: you should attempt all ten.

2 There are 5 questions on combinatorics, and 5 on graph theory.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Tips:

Page 9: Friday's annotated slides (1/25) - maths.nuigalway.ieniall/MA284/Week12-2.pdf · If the graph has n vertices, labelled {1,2,...,n},

Review Past exam papers (20/25)

Up until 2014/2015, Discrete Mathematics was delivered as two separate

modules: MA284 and MA204. It’s current incarnation is similar, but is not

identical to either. Some of the past exam papers for them are useful study

aids:

2016/2017 – MA204/MA284: Everything

2015/2016 – MA204/MA284: Everything except Q4(c).

2014/2015 – MA284 Q1, Q2, Q3, Q4(b),

but not Q4(a) [Platonic graphs] and Q4(c) [m-ary trees]

2014/2015 – MA204 Q1; Q2(a), (b) and (d); Q3(a) and (b), Q4

but not Q2(c) [recurrence]; Q3(c) [Reverse Polish

Notation]

Page 10: Friday's annotated slides (1/25) - maths.nuigalway.ieniall/MA284/Week12-2.pdf · If the graph has n vertices, labelled {1,2,...,n},

Review Revision Questions (21/25)

Q1. Find the number of different arrangements of the letters in the word:MISAPPREHENSION.Of these arrangements,

(a) how many have all the vowels together?(b) how many start and end with N?(c) how many start or end with N?(d) how many have all the letters in alphebetical order?

Q2. (a) The sets A and B are such that |A| = 10 and |B| = 20.What is the largest possible value of |A ∪ B|?What is the largest possible value of |A ∩ B|?What is the value of |A ∪ B|+ |A ∩ B|?

(b) Suppose that four sets are such that

each set has 30 elements;each pair of sets share 10 elements, andeach triple of sets share 5 elements.

If the union of all four sets has 80 elements, how many elements are therein the intersection of all four sets?

Q3. (a) Prove that k�nk

�= n

�n−1k−1

�. (b) Prove that

�nk

�=

�n−1k−1

�+

�n−1k

�.

Q4. (a) How many (binary) bit strings are there of length 8?How many of these have weight 3?

Page 11: Friday's annotated slides (1/25) - maths.nuigalway.ieniall/MA284/Week12-2.pdf · If the graph has n vertices, labelled {1,2,...,n},

Review Revision Questions (22/25)

(b) A ternary string is a sequence of 0s, 1s, and 2s. How many ternary stringsof length 17 are there?How many of those strings contain exactly eight 0s, four 1s, and five 2s?How many ternary strings of length 17 contain an odd number of 1s?

Q5. How many non-negative integer solutions are there to the equationx1 + x2 + x3 + x4 + x5 < 11, if there are no restrictions?How many solutions are there if x1 > 3?How many solutions are there if each xi < 3?

Q6. Students in an Indiscreet Mathematics class work together in groups of 5 for anassignment. The group is given a score, which they divide up, according to theamount of work each did, to get their individual scores. Aoife, Brian, Conor,Declan, and Eimer worked together, and got a score of 20.

(a) How many ways can their scores be assigned?(b) The were given scores (respectively) of 2, 4, 6, 8 and 0. The lecturer

entered these scores, but assigned them all to the wrong people. How manyways can this happen?

Q7. (a) Prove that�

v∈V

deg(v) = 2|E | for any graph G = (V ,E). Deduce that the

number of edges in the complete graph on n vertices is equal to�n2

�.

(b) Prove that if a connected planar graph has v vertices, e edges, and f faces,then v − e + f = 2. Use this to show that K3,3 is not planar.

Page 12: Friday's annotated slides (1/25) - maths.nuigalway.ieniall/MA284/Week12-2.pdf · If the graph has n vertices, labelled {1,2,...,n},

Review Revision Questions (23/25)

Q8. Determine the chromatic number of each of the following graphs, and give acorresponding colouring.

1

2 5

8 7

3

9

4

10

6

Q9. Explain the terms Eulerian path and Eulerian circuit.For each of the following graphs, determine if it has an Eulerian path and/orEulerian circuit. If so, give an example; if not, explain why.

(a) G = (V ,E) with V = {a, b, c, d , e, f } and E =�{a, b}, {a, c}, {a, d},

{a, f }, {b, c}, {b, d}, {b, e}, {c, e}, {c, f }, {d , e}, {d , f }, {e, f }�

(b)

a

b h

c

e

f

d

g

ji

Q10. (a) Show that if T is a tree with e edges, then it has e + 1 vertices.(b) Show that if T is an acyclic graph with v vertices, and e = v − 1 edges,

then it is a tree.

Page 13: Friday's annotated slides (1/25) - maths.nuigalway.ieniall/MA284/Week12-2.pdf · If the graph has n vertices, labelled {1,2,...,n},

A summary in one slide (1/2)... (24/25)

Page 14: Friday's annotated slides (1/25) - maths.nuigalway.ieniall/MA284/Week12-2.pdf · If the graph has n vertices, labelled {1,2,...,n},

A summary in one slide (1/2)... (24/25)

Page 15: Friday's annotated slides (1/25) - maths.nuigalway.ieniall/MA284/Week12-2.pdf · If the graph has n vertices, labelled {1,2,...,n},

A summary in one slide (1/2)... (24/25)