Friendships Reported by the Members of a Book Club, and Whether Another Club's Reports Can All Be True
Seven members of a book club, Ana, Ben, Cara, Dev, Eli, Fay and Gus, each say how many of the other six members they are friends with. A friendship always goes both ways. Ana says 4, Ben and Cara each say 3, and Dev, Eli, Fay and Gus each say 2. (a) How many friendships are there among the seven members? (b) The seven members of a second club give the counts 5, 4, 3, 3, 2, 2 and 2. Can all seven of these counts be correct? Give the total that settles it.
Draw each member as a vertex and each friendship as an edge. A member's count is then the degree of that vertex. Every edge has two ends, so it adds 1 to two degrees, and the degrees add up to twice the number of edges.
- Model the club as a graph: a vertex for each member and an edge for each friendship. Each member's count is the degree of their vertex, so the degrees are 4, 3, 3, 2, 2, 2, 2.
- Add the degrees: 4 + 3 + 3 + 2 + 2 + 2 + 2 = 18. Each friendship joins two members, so it is counted once by each of them and appears twice in this total.
- (a) The number of friendships is 18 ÷ 2 = 9. Check: the network in the figure fits every count and has 9 edges.
- For the second club, add the counts in the same way: 5 + 4 + 3 + 3 + 2 + 2 + 2 = 21.
- (b) No. The degrees of any graph add up to twice the number of edges, which is an even number, and 21 is odd. Put another way, three members give an odd count, and a graph always has an even number of vertices of odd degree.
answer(a) 9 friendships; (b) no: the counts add up to 21, which is odd, but the degrees of a graph always add up to an even number
techniqueVertices, Edges and Degree
Common pitfalls
- Taking 18 as the number of friendships. Ana's friendship with Ben appears in Ana's count and again in Ben's, so the total counts every friendship twice.
- Checking only that no count is more than 6. Each count is possible on its own; it is the total, 21, that cannot be twice a whole number of friendships.
Cables Planned Between Six Routers in an Office, and Whether Each Plan Can Be Built
An engineer is planning cables between six routers, P, Q, R, S, U and V. Two routers are joined by at most one cable, and no cable joins a router to itself. Plan 1 gives the numbers of cables at the routers as P 5, Q 5, R 4, S 2, U 1 and V 1. Plan 2 gives P 5, Q 4, R 4, S 3, U 2 and V 2. (a) Can plan 1 be built? Give the count that decides it. (b) Can plan 2 be built, and if so, how many cables does it use?
Draw each router as a vertex and each cable as an edge, so each planned number is a degree. The graph must be simple, so a router can be joined to each of the other five at most once. The routers with the most cables leave the least choice, so place their cables first.
- Model the plan as a graph: a vertex for each router and an edge for each cable. At most one cable between two routers and none from a router to itself means the graph is simple, so a degree can be at most 5, the number of other routers.
- Plan 1 adds up to 5 + 5 + 4 + 2 + 1 + 1 = 18, which is even, so the handshake count alone does not rule it out. Look at the busiest routers instead. P has degree 5, so it is joined to every other router, and so is Q.
- (a) No. U and V are each joined to both P and Q, so each has at least 2 cables, but plan 1 gives them 1 each. Plan 1 cannot be built.
- Plan 2: P has degree 5, so join it to all the others, using 5 cables. The degrees still needed are Q 3, R 3, S 2, U 1 and V 1.
- Join Q to R, S and U, using 3 cables. Still needed: R 2, S 1 and V 1. Join R to S and to V, using 2 cables. Every router now has its planned number.
- (b) Yes, plan 2 can be built, with 5 + 3 + 2 = 10 cables. Check: the degrees add up to 5 + 4 + 4 + 3 + 2 + 2 = 20, and 20 ÷ 2 = 10.
answer(a) No: P and Q, with 5 cables each, are joined to every other router, so U and V would each have at least 2 cables, not 1; (b) yes, with 10 cables
techniqueVertices, Edges and Degree · Simple, Complete and Bipartite Graphs
Common pitfalls
- Deciding that plan 1 works because its total, 18, is even. An even total is needed, but it is not enough: the two routers of degree 5 force every other router to have degree at least 2.
- Joining two routers twice, or a router to itself, to use up a spare degree. The cables form a simple graph, with at most one edge between two vertices and no loops.
A Chess League in Which Every School Plays Every Other School Once, and How Many Schools a Season Can Take
In a chess league, every school plays every other school exactly once. (a) This season 8 schools take part. How many matches are played? (b) Next season more schools want to join, but the league can schedule no more than 66 matches. What is the largest number of schools it can take, and how many matches does each school then play?
Draw each school as a vertex and each match as an edge. Every pair of schools plays once, so every pair of vertices is joined: the graph is complete. Count the edges from the degrees and halve.
- Model the league as a graph: a vertex for each school and an edge for each match. Every pair of schools plays once, so every pair of vertices is joined by one edge: the graph is the complete graph K8.
- Each school plays the other 7, so every vertex has degree 7 and the degrees add up to 8 × 7 = 56. Each match is counted by both schools that play it.
- (a) The number of matches is 56 ÷ 2 = 28. This is n(n − 1)2 with n = 8.
- For n schools the league needs n(n − 1)2 matches, and this grows as n grows. Try values near the limit: n = 11 gives 11 × 102 = 55, n = 12 gives 12 × 112 = 66 and n = 13 gives 13 × 122 = 78.
- (b) With 12 schools the league plays exactly 66 matches, which is no more than the limit, while 13 schools would need 78. The largest number is 12 schools, and each school plays the other 11.
answer(a) 28 matches; (b) 12 schools, each playing 11 matches
techniqueSimple, Complete and Bipartite Graphs · Vertices, Edges and Degree
Common pitfalls
- Answering 8 × 7 = 56 matches. That counts the match between two schools once for each school, so it must be halved.
- Solving n(n − 1) = 66 and finding no whole number. The matches number n(n − 1)2, so the equation is n(n − 1) = 132, which gives n = 12.
Tutors and Students at a Tutoring Center, and How Many Tutors Each Student Has
A tutoring center has 6 tutors and 9 students. Each tutoring pair is one tutor with one student. Three of the tutors work with 4 students each, and the other three work with 2 students each. Every student has the same number of tutors. (a) How many tutoring pairs are there? (b) How many tutors does each student have?
Draw each tutor and each student as a vertex and each tutoring pair as an edge. Every edge joins a tutor to a student, so the graph is bipartite, and every edge has exactly one end on each side. The degrees on either side therefore add up to the number of edges.
- Model the center as a graph: a vertex for each tutor and each student, and an edge for each tutoring pair. Every edge joins a tutor to a student, so the graph is bipartite, with the tutors on one side and the students on the other.
- Count the edges from the tutors' side. Each edge has exactly one end at a tutor, so the number of edges is the sum of the tutors' degrees: 3 × 4 + 3 × 2 = 12 + 6 = 18.
- (a) There are 18 tutoring pairs.
- Count the same edges from the students' side. Each edge has exactly one end at a student, so the students' degrees also add up to 18. The 9 students all have the same degree d, so 9d = 18.
- (b) d = 18 ÷ 9 = 2, so each student has 2 tutors. Check: the degrees on both sides together add up to 18 + 18 = 36, which is 2 × 18, as the handshake lemma requires.
answer(a) 18 tutoring pairs; (b) 2 tutors each
techniqueSimple, Complete and Bipartite Graphs · Vertices, Edges and Degree
Common pitfalls
- Adding the tutors' degrees and halving, to get 18 ÷ 2 = 9 pairs. In a bipartite graph each edge has one end on each side, so the tutors' degrees alone already count every edge once.
- Taking the center to be the complete bipartite graph K6,9, with 6 × 9 = 54 pairs. That would mean every tutor works with every student, but the tutors work with only 4 or 2 students each.
Seven Exams to Be Split Between a Morning and an Afternoon Session, and Which Exams Share a Session with Math
A school must hold seven exams, Biology, Chemistry, Economics, French, History, Math and Physics, in two sessions, morning and afternoon. Two exams clash if some student takes both, and exams that clash must be in different sessions. The clashing pairs are Math and Physics, Physics and Chemistry, Chemistry and Biology, Biology and Economics, Economics and Math, History and Physics, History and Biology, and French and Chemistry. (a) Can the seven exams be split between the two sessions? Give the count that settles it. (b) The only student taking both Economics and Math drops Economics, so that clash disappears. Which exams are now in the same session as Math?
Draw each exam as a vertex and each clash as an edge. A split into two sessions gives every vertex one of two colors, with the two ends of every edge in different colors, which is what it means for the graph to be bipartite. Going round a cycle the colors must alternate, so a cycle of odd length makes a split impossible.
- Model the timetable as a graph: a vertex for each exam and an edge for each clash. A split into two sessions colors each vertex morning or afternoon, with every edge joining two different colors, so the question asks whether the graph is bipartite.
- Follow the edges Math–Physics–Chemistry–Biology–Economics–Math. They form a cycle through 5 exams. Going round it, the sessions must alternate: morning, afternoon, morning, afternoon, morning.
- (a) No. The cycle has 5 exams, an odd number, so the alternation puts Economics in the same session as Math, and they clash. A graph with a cycle of odd length is not bipartite.
- Remove the edge Economics–Math. Put Math in the morning. Then Physics goes in the afternoon, Chemistry in the morning, Biology in the afternoon and Economics in the morning.
- History clashes with Physics and Biology, which are both in the afternoon, so History goes in the morning. French clashes only with Chemistry, so French goes in the afternoon. Every edge now joins a morning exam to an afternoon exam.
- (b) Math shares its session with Chemistry, Economics and History, 4 exams in all, while Physics, Biology and French are in the other session. The graph is connected, so once Math's session is fixed every other exam's session is forced, and no other split exists.
answer(a) No: Math, Physics, Chemistry, Biology and Economics form a cycle of 5 clashes, and a cycle of odd length cannot alternate between two sessions; (b) Chemistry, Economics and History, so that session holds 4 exams with Math
Common pitfalls
- Looking only for three exams that all clash with one another and, finding none, deciding that a split is possible. Any cycle of odd length prevents a split, and here the odd cycle has 5 exams.
- Putting History in the afternoon because the morning looks fuller. History clashes with both Physics and Biology, so it must go in the session that neither of them is in.
Pipes Already Laid Between Ten Villages, and the Fewest More That Connect Them All
A water company is connecting ten villages, A to J, with pipes. So far it has laid six pipes, joining A and B, B and C, D and E, F and G, G and H, and H and I. No set of these pipes forms a loop. (a) Into how many separate groups do the pipes divide the villages, where the villages in a group are connected to one another by pipes? (b) What is the fewest number of extra pipes that will connect all ten villages, and how many pipes will the finished network then have?
Draw each village as a vertex and each pipe as an edge. With no loop, each group is a tree and the whole graph is a forest. A tree has one edge fewer than it has vertices, so the number of groups is the number of vertices minus the number of edges.
- Model the network as a graph: a vertex for each village and an edge for each pipe. The groups are the connected components. With no loop, each component is a tree, and the whole graph is a forest.
- A tree with k vertices has k − 1 edges. Add this over all the components: if c components hold the 10 villages, the number of edges is 10 − c.
- (a) 10 − c = 6, so c = 4 groups. Check by tracing the pipes: the groups are A, B and C; D and E; F, G, H and I; and J on its own.
- A new pipe between two different groups joins them into one group, so each pipe reduces the number of groups by at most 1. To go from 4 groups to 1 takes at least 4 − 1 = 3 pipes, and 3 pipes that each join two different groups are enough.
- (b) The fewest extra pipes is 3, and the finished network has 6 + 3 = 9 pipes. Check: a connected network with no loop on 10 villages is a tree, and a tree with 10 vertices has 10 − 1 = 9 edges.
answer(a) 4 groups; (b) 3 extra pipes, making 9 pipes in all
techniqueSubgraphs, Connectedness and Trees
Common pitfalls
- Answering 4 extra pipes for part (b). Four is the number of groups, and joining 4 groups into one takes one pipe fewer than that.
- Counting only the villages that have pipes and forgetting J. A village with no pipe is a group on its own, a component with a single vertex.
Roads Between Seven Towns on an Island, Which Road's Closure Would Split the Network, and Where a New Road Should Go
An island has seven towns: the harbor H and the towns A, B, C, D, E and F. Its eight roads join H and A, A and B, B and C, C and H, B and D, D and E, E and F, and F and D, and every road carries traffic both ways. (a) Which one road, if it were closed, would leave some towns unable to reach the others, and how many towns would then be cut off from the harbor? (b) The council will build one new road from the harbor to a town it has no road to yet, so that closing any single road never splits the network. To which towns could the new road run?
Draw each town as a vertex and each road as an edge. A road whose closure disconnects the graph is called a bridge. A road that lies on a cycle is never a bridge, because the rest of the cycle is another way round, so look for the roads on no cycle.
- Model the island as a graph: a vertex for each town and an edge for each road. A road whose removal disconnects the graph is called a bridge. An edge that lies on a cycle is never a bridge, because the rest of the cycle is another way round.
- Find the cycles. H–A–B–C–H is a cycle of 4 roads, and D–E–F–D is a cycle of 3 roads. That accounts for 7 of the 8 roads.
- (a) The one road on no cycle is B–D. Removing it leaves two components, H, A, B, C and D, E, F, so the 3 towns D, E and F are cut off from the harbor. Every other road lies on a cycle, so closing it splits nothing.
- A new road from H to D, E or F makes a cycle that runs along B–D. For example, a road from H to F gives the cycle H–A–B–D–F–H. Then B–D is no longer a bridge, and every other road still lies on its old cycle.
- H already has roads to A and C, so the only other town to try is B. A road from H to B makes the cycles H–A–B–H and H–B–C–H, but neither passes along B–D, which stays a bridge.
- (b) The new road could run to D, E or F, 3 possible towns, but not to B.
answer(a) The road between B and D; 3 towns, D, E and F, would be cut off from the harbor; (b) D, E or F, any one of the 3, but not B
techniqueSubgraphs, Connectedness and Trees
Common pitfalls
- Choosing a road at the far end of the network, such as E–F, because it looks remote from the harbor. E–F lies on the cycle D–E–F–D, so closing it leaves the route E–D–F.
- Building the new road from the harbor to B, the near end of the bridge. The new road must reach the far side, D, E or F, to make a cycle through B–D.
A Project's Directory of Folders and Files, and How Many Items and Files It Holds
On a computer, every file or folder in a project, except the project's top folder, sits directly inside exactly one folder. In one project's directory there are 7 folders, the top folder included. Each folder holds exactly 3 items directly inside it, and a file holds nothing. (a) How many items does the directory contain in all, counting every folder and file and the top folder itself? (b) How many of those items are files?
Draw each folder or file as a vertex, with an edge from each folder to each item directly inside it. Every item except the top folder has exactly one folder above it, so the graph is a tree rooted at the top folder. Count the edges from the folders, then use the fact that a tree has one more vertex than it has edges.
- Model the directory as a graph: a vertex for each folder or file, and an edge from each folder to each item directly inside it. Every item except the top folder has exactly one folder above it, so the graph is connected with no cycle: a tree, rooted at the top folder.
- Count the edges from the folders. Each of the 7 folders has 3 items inside it, so there are 7 × 3 = 21 edges.
- (a) A tree has one more vertex than it has edges, so the directory holds 21 + 1 = 22 items. The extra 1 is the top folder, the only item that is not inside another folder.
- (b) The files are the items that are not folders: 22 − 7 = 15 files. They are the leaves of the tree, the vertices of degree 1.
- Check with the degrees. The top folder has degree 3, each of the other 6 folders has degree 3 + 1 = 4, and each file has degree 1: 3 + 6 × 4 + 15 = 42, which is 2 × 21.
answer(a) 22 items; (b) 15 files
techniqueSubgraphs, Connectedness and Trees · Vertices, Edges and Degree
Common pitfalls
- Answering 7 × 3 = 21 items. That counts every item that is inside a folder and misses the top folder, which is inside none.
- Answering 21 files by taking every item inside a folder to be a file. Six of those items are folders themselves, so the files number 21 − 6 = 15.
One-Way Streets Between Five Junctions in an Old Town Center, and Which Street to Reverse
The old center of a town has five junctions, A, B, C, D and E, joined by six one-way streets: from A to B, from B to C, from C to A, from C to D, from D to E, and from B to E. (a) Can a driver get from every junction to every other junction? Give the count that settles it. (b) The council will reverse the direction of exactly one street. Which street, reversed, lets a driver get from every junction to every other?
Draw each junction as a vertex and each street as an arc, an arrow pointing the way traffic flows. Every junction reaching every other is what it means for a directed graph to be strongly connected. A junction with no arc leaving it is a dead end, so start with the out-degrees.
- Model the streets as a directed graph: a vertex for each junction and an arc for each street, pointing the way traffic flows. Every junction reaching every other is what it means for the graph to be strongly connected.
- Find each junction's out-degree, the number of arcs leaving it: A 1, B 2, C 2, D 1 and E 0.
- (a) No. Junction E has out-degree 0, so a driver at E cannot leave it, and the graph is not strongly connected.
- The reversed street must give E an arc out, or E stays a dead end, so it must be one of the two streets into E: D to E or B to E. Reversing D to E would leave D with no arc out, since D's only street led to E. That leaves B to E.
- Reverse B to E, so that it runs from E to B. The arcs A to B, B to C and C to A form a cycle, and so do B to C, C to D, D to E and E to B. The two cycles share B and C, so every junction can reach every other.
- (b) Reverse the street from B to E. Check: from E the route E, B, C, A reaches A, and from A the route A, B, C, D, E reaches E.
answer(a) No: junction E has out-degree 0, so no street leaves it; (b) the street from B to E, which then runs from E to B; no other of the 6 streets works
Common pitfalls
- Reversing the street from C to D because it is the only street from the cycle A, B, C to D. After that reversal no arc leads into D, so no driver can reach D, and E is still a dead end.
- Deciding that the town is fine because every junction can reach E. Strong connectedness needs a route in each direction between every pair of junctions, and no route leads out of E.
A Table-Tennis League's Results Table with One Line Smudged, and Whom the Last Player Beat
Five players, Ana, Ben, Cal, Dee and Eve, each play every other player once in a table-tennis league, and every game has a winner. The results table shows that Ana won 3 games, Ben 3, Cal 2 and Dee 1, but Eve's line is smudged. (a) How many games did Eve win? (b) Ben lost only to Ana, Cal lost only to Ana and Ben, and Dee's one win was against Eve. Whom did Eve beat?
Draw each player as a vertex and each game as an arc from the winner to the loser. Every pair plays once, so every pair of vertices is joined by exactly one arc, and each player's wins are the out-degree of their vertex. The out-degrees add up to the number of games.
- Model the league as a directed graph: a vertex for each player and an arc from the winner to the loser of each game. Every pair plays once, so every pair of vertices is joined by exactly one arc. A player's wins are the out-degree of their vertex.
- There are 5 × 42 = 10 games, one for each edge of K5, and each game gives exactly one win, so the out-degrees add up to 10.
- (a) Eve won 10 − (3 + 3 + 2 + 1) = 10 − 9 = 1 game.
- Draw the arcs that are given. Ben lost only to Ana, so Ben beat Cal, Dee and Eve. Cal lost only to Ana and Ben, so Cal beat Dee and Eve. Dee's one win was against Eve, so Dee lost to Ana, Ben and Cal.
- Eve has now lost to Ben, Cal and Dee. Her only other game is against Ana, and she won 1 game, so she won that one.
- (b) Eve beat Ana. Check: Ana then beat Ben, Cal and Dee and lost to Eve, which gives Ana her 3 wins.
answer(a) 1 game; (b) Ana
techniqueDirected Graphs and Strong Connectedness · Simple, Complete and Bipartite Graphs
Common pitfalls
- Adding the known wins, 3 + 3 + 2 + 1 = 9, and guessing that Eve won none. Each of the 10 games gives one win, so the wins must add up to 10.
- Taking 5 × 4 = 20 as the number of games. That counts each game once for each of its two players, so the number of games is half of it.