53
Math 235 Homefun Exercises Dr. G Fall 2017 1: WTF is Discrete Math? It’s time to get you set up with L A T E X, a typesetting language that does a much better job of creating professional-looking documents than standard word processors like Microsoft Word. The King’s College Math and Computer Science departments both require their students to become proficient in L A T E X. Now is the time to get started! Go to the computer lab, find and run the application TeXstudio, and open the document Welcome to LaTeX.tex that I emailed to you. Compile it by pressing the F5 key. Read the whole thing! 2: Graph Theory Fundamentals 1. Draw a graph with five vertices v 1 , v 2 , v 3 , v 4 , and v 5 such that the degree of v 1 is 3, v 2 has odd degree, v 3 has degree 2, and v 4 and v 5 are adjacent. 2. For all the graphs you’ve seen so far, go back and count the number of edges in each. Then, add up the degrees of all the vertices. You should see a connection between the number of edges and the sum of all degrees. State that connection clearly and succinctly. 3. If a vertex has an even degree (2, 4, 6, etc.), then we call it an even vertex. Likewise, a vertex having an odd degree is called an odd vertex. Use what you found in the previous exercise to prove that in any graph, the number of odd vertices must be even. 4. Consider a graph with seven vertices. Five vertices have degree 4 and two vertices have degree 2. How many edges does this graph have? 5. Consider a graph whose degree sequence is 5, 5, 4, 4, 3, 3, 3, 3. How many edges does this graph have? 6. What is the degree sequence of the complete graph K n ? 7. How many edges does the complete graph K n have? Experiment for specific small values of n, and then give the general answer in terms of n. 8. Draw graphs having the following degree sequence, or else explain why no such graph can exist. 1

Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

Math 235 Homefun Exercises

Dr. G

Fall 2017

1: WTF is Discrete Math?It’s time to get you set up with LATEX, a typesetting language that does a much better job ofcreating professional-looking documents than standard word processors like Microsoft Word.The King’s College Math and Computer Science departments both require their students tobecome proficient in LATEX. Now is the time to get started! Go to the computer lab, findand run the application TeXstudio, and open the document Welcome to LaTeX.tex that Iemailed to you. Compile it by pressing the F5 key. Read the whole thing!

2: Graph Theory Fundamentals1. Draw a graph with five vertices v1, v2, v3, v4, and v5 such that the degree of v1 is 3, v2

has odd degree, v3 has degree 2, and v4 and v5 are adjacent.

2. For all the graphs you’ve seen so far, go back and count the number of edges in each.Then, add up the degrees of all the vertices. You should see a connection betweenthe number of edges and the sum of all degrees. State that connection clearly andsuccinctly.

3. If a vertex has an even degree (2, 4, 6, etc.), then we call it an even vertex. Likewise,a vertex having an odd degree is called an odd vertex. Use what you found in theprevious exercise to prove that in any graph, the number of odd vertices must be even.

4. Consider a graph with seven vertices. Five vertices have degree 4 and two vertices havedegree 2. How many edges does this graph have?

5. Consider a graph whose degree sequence is 5, 5, 4, 4, 3, 3, 3, 3. How many edges doesthis graph have?

6. What is the degree sequence of the complete graph Kn?

7. How many edges does the complete graph Kn have? Experiment for specific smallvalues of n, and then give the general answer in terms of n.

8. Draw graphs having the following degree sequence, or else explain why no such graphcan exist.

1

Page 2: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

(a) 1, 1, 1, 1

(b) 1, 1, 1, 1, 1

(c) 2, 2, 2, 2, 2

(d) 4, 4, 3, 2, 2, 0

(e) 3, 3, 3, 3, 2, 2, 2

(f) 3, 3, 3, 3, 3, 3

(g) 6, 6, 4, 2, 2, 2, 1, 1

9. Try to draw a graph where the degrees of the vertices are all different. Can you do it?If so, show me. If not, try to prove why you believe it’s impossible.

10. Imagine the complete graph K6 where each edge has been colored either red or blue.Prove that this graph contains either a red triangle or a blue triangle.

11. Show that K5 can have its edges colored red and blue with no red nor blue triangles.

12. Suppose all vertices in a graph have the same odd degree k. Show that the number ofedges is a multiple of k.

13. Show by example that if the vertices in a graph all have the same even degree k, thenumber of edges may or may not be a multiple of k.

3: Cycles1. A cut vertex is any vertex in a connected graph that, if deleted, would disconnect

the graph.

(a) Draw a graph with 5 vertices, one of which is a cut vertex.

(b) Draw a graph with 5 vertices such that every vertex is a cut vertex.

(c) Explain why no graph having a cut vertex can be Hamiltonian.

2. Suppose that if G is a connected graph and C is a cycle within G. Prove that if one ofthe edges of C is deleted, G remains connected.

3. A graph G with n vertices is called pancyclic if it contains cycles of every length 3, 4,. . . , n. For each of n = 4, 5, and 6, draw a pancyclic graph with n vertices. To makeit more interesting, use as few edges as possible.

4. Determine whether the following graphs are Hamiltonian:

Page 3: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

5. Prove that any graph with degree sequence 4, 4, 4, 4, 4, 4 is Hamiltonian.

6. The wheel graphWn consists of a cycle graph Cn together with one extra vertex thatis adjacent to all other vertices (so actually, the wheel graph Wn has n + 1 vertices).For example, here is W6:

(a) What is the degree sequence of Wn?

(b) Prove that Wn is Hamiltonian for all n ≥ 3.

7. Solve the Traveling Salesperson Problem for the weighted graph below two ways: firstusing the Nearest Neighbor algorithm (start at the top vertex), then using CheapestLink.

17

2

9

5

6

10

43

8

Page 4: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

8. There are 8 different binary strings of length 3:

000, 100, 010, 001, 110, 101, 011, 111

Draw a graph where each vertex represents one of these strings. Draw an edge betweentwo vertices if and only if the strings differ only in one digit. For example, the strings100 and 110 differ only in the second digit, so you should draw an edge between thesetwo vertices. Find a Hamilton cycle in this graph.

9. The girth of a graph is the length of its shortest cycle. What is the girth of thecomplete graph Kn? What is the girth of the cycle graph Cn?

10. Find the girth of the following graph:

Note: this graph is famous. It’s called the Petersen Graph. You’ll be seeing it a lot.

4: Circuits1. Use Fleury’s algorithm to find an Euler circuit in the graph below:

2. Find an Euler circuit in each of the graphs below:

Page 5: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

A

B

C D

E

F

G

3. Consider the graph below:

(a) Explain why this graph does not possess an Euler circuit.

(b) Label the vertices, and then give an Euler path in this graph.

4. For which values of n does the complete graph Kn have an Euler circuit?

5. A bridge is any edge in a connected graph that, if deleted, would disconnect the graph.

(a) Draw a graph with 6 vertices having exactly one bridge.

(b) Draw a graph with 6 vertices such that every edge is a bridge.

(c) Explain why no graph having a bridge can have an Euler circuit.

(d) Show by examples that a graph having a bridge may or may not have an Eulerpath.

6. List all bridges in the following graph:

Page 6: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

A

B

C

D

E

F

G

G

Hint: This is actually kinda tricky because of the way the edges are crossing eachother. If you try redrawing the graph without any edges crossing, finding the bridgesbecomes much easier.

7. We saw one practical application of Euler circuits: the Trash Collector Problem. Findat least two other “real world” situations that amount to finding an Euler circuit insome graph.

8. A graph is randomly traceable from a vertex v if, whenever we start from v andtraverse the graph in an arbitrary way never retracing any edge, we eventually obtainan Euler circuit.

(a) Show that the graph below is randomly traceable from the marked vertex v.

v

(b) Show that this graph is not randomly traceable from any other vertex.

5: Trees1. If T is a tree with n vertices, what is the maximum degree any one vertex can have?

2. If T is a tree with n vertices, what is the maximum number of leaves (i.e. vertices ofdegree 1) T can have?

Page 7: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

3. Prove that if T is a tree, then adding any new edge creates a cycle.

4. I’m very bad at chess, so I’ve decided that the next time I play, I will quit afterwinning a game or after five games have been played. Make a tree showing all possibleoutcomes. How many outcomes are there? In how many of these outcomes do I win agame?

5. It’s the weekend and I have several ways to spend my Friday and Saturday evenings. Icould do some cleaning, watch cat videos on Youtube, or go out with my friends. Makea tree showing all the possible ways I can spend my Friday and Saturday evenings.

6. Draw some trees and count how many edges they have. Then finish this conjecture: Ifa tree has n vertices, then it has edges. Try to prove your conjecture.

7. Solve the minimal connector problem for this edge-weighted graph. What is the totalweight of the spanning tree you found?

A B C

D E F

G H I

3 5

1

6

47

1

5 7

3

9 1

2 5

38

8. Application to Chemistry: One of the earliest uses of graphs was to enumeratechemical molecules. If we have a molecule consisting only of carbon and hydrogenatoms, then we can represent it as a graph in which each carbon atom appears as avertex of degree 4 and each hydrogen atom appears as a vertex of degree 1.

The graphs of n-butane and 2-methyl propane are shown below. Although they havethe same chemical formula C4H10, they are different molecules because the atoms arearranged differently within the molecule. These two molecules form part of a generalclass of molecules known as the alkanes, or paraffins, with chemical formula CnH2n+2.It is natural to ask how many different molecules there are with this formula.

Page 8: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

C C C CH

H H H H

H

HHHH

C

H

H H

C

H

C

H

H

H

C

H

H

H

To find all possible molecules with the formula CnH2n+2, note that the molecule iscompletely determined by how the carbon atoms are arranged; once the carbon atomsare set, the hydrogen atoms just fill in to bring the degree of each carbon vertex to 4.So forget the hydrogen atoms, and the problem is reduced to finding the number ofdistinct trees with 4 vertices.

C C C C

C

CC C

It turns out, these two are the only trees with 4 vertices (up to isomorphism), son-butane and 2-methyl propane are the only molecules with formula CnH2n+2.

Now it’s your turn! Draw all possible chemical molecules for C5H12 and C6H14.

9. Application to Computer Science: It’s very easy for us to find Hamilton cycles inthis simple graph:

A

B

C

D

In fact, there are exactly two Hamilton cycles: ABDCA and its reverse ACDBA.This is easy for us, because we have eyes and a brain. But increasingly, computersare tasked with solving graph theory problems, so the more interesting problem hereis “How can we program a computer to find a Hamilton cycle in a graph?”

In general, this is a very expensive problem, meaning it can take a lot of processingtime for a computer to search a graph for a Hamilton cycle. The programmer has toinstruct the computer to search the graph in an orderly, algorithmic way. Say we startat vertex A. Then we could first travel to either B or C. If we go to B, then we cango to either C or D next. And so on, and so on, . . . These and all other possible pathsare stored in the following search tree:

Page 9: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

A

B C

C D B D

D C D B

A A

Our original graph was very simple, so the search tree is small. Starting from vertexA, there are only four ways the computer could blindly stumble through the graph,represented by the four downward branches of the tree. Two of those branches aredead ends (ABCD and ACBD), and the other two branches reveal the two Hamiltoncycles noted earlier.

So how do we tell the computer how to investigate the search tree? The standardapproach to this type of problem is to perform a depth-first search. Number thevertices if they aren’t already, so the computer knows which vertex to try first whena choice arises. Our vertices are already labeled A, B, C, and D, so we’ll just usealphabetical order. Starting from vertex A, the computer must choose whether totravel to B or C. Alphabetical order says try B first. From B, the computer mustchoose either C or D (the only remaining vertices we haven’t visited yet). Alphabeticalorder says go to C. From here we must go to D, and we hit a dead end.

From the dead end, we climb back up the tree until we reach a branch we haven’texplored yet. Keep doing this until you discover a Hamilton cycle. Here’s our originalgraph again, and the search tree with the steps described above illustrated. Try tofollow the search process both in the original graph and its search tree.

Page 10: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

A

B

C

D

A

B C

C D B D

D C D B

A A

The depth-first search follows the walk ABCDCBDCA, eventually finding the Hamil-ton cycle ABDCA. If the task is just to determine whether a given graph is Hamilto-nian, the algorithm would stop here. If our task were to find all the Hamilton cyclesin the graph, we would have to instruct the computer to search the entire tree, keepingtrack of all cycles found along the way.

Now it’s your turn! Here’s a pretty graph:

A

B

E D

C

(a) Draw the search tree for this graph, using the alphabetical ordering of the vertices.

(b) Starting at vertex A, perform a depth-first search for a Hamilton cycle. List thevertices in the order they are visited during the search.

(c) What Hamilton cycle does the search algorithm eventually find?

(d) How many times does the algorithm have to backtrack through the tree before itfinds a solution?

Page 11: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

6: Coloring Graphs1. Find χ(G) for the Petersen Graph (on the left) and the Grotzsch Graph (on the

right):

2. Find χ(G) for the Cube Graph:

3. Recall that the wheel graph Wn consists of a cycle graph Cn together with anothervertex that is adjacent to all other vertices. What is the chromatic number of thewheel graph?

4. Prove or give a counterexample: for any n ∈ N, there exists a graph G with χ(G) = n.

5. Determine which of the following graphs are bipartite.

Page 12: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

6. The six students of a super fancy preschool are going on a field trip. The problemis, many of these students don’t get along with one another and will have to travel inseparate cars. The x’s in the chart below show which pairs of kids are in conflict. (forexample, the x in row 1, column 2 says that Amy and Bob can’t ride in the same car.)Use graph coloring to determine how many cars will be needed for the field trip.

Amy Bob Carl Doug Eva FranAmy x x x

Bob x x x

Carl x x x x

Doug x x x

Eva

Fran x x x

7. The complete bipartite graph Km,n is the bipartite graph with m “red” vertices andn “blue” vertices such that every red vertex is adjacent to every blue vertex. DrawK2,2, K4,2, K3,3, K6,1, and Kn,1.

8. Suppose G is a bipartite graph with an odd number of vertices. Explain why G cannot possibly be Hamiltonian.

9. Use the previous problem to prove the following graph is not Hamiltonian.

Page 13: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

7: Planar Graphs and Euler’s Polyhedron Formula1. Find a planar drawing of K3,2:

2. Prove that K5 is not planar.

3. Prove that K3,3 is not planar.

4. Explain why K2,n is planar for any n ∈ N. In any planar drawing of K2,n, how manyfaces are there?

5. If a graph G has 10 vertices and is planar, what is the maximum number of edges itcan have?

6. If a graph G has 50 edges and is planar, what is the minimum number of vertices itcan have?

7. Use Euler’s formula to prove that if G is connected, planar, and bipartite, then E ≤2V − 4.

8. Prove that if G is a planar graph, then G must have a vertex of degree 5 or less. Hint:Suppose every vertex has degree six or more. Show that this leads to a contradiction.

9. A cube has eight vertices, twelve edges, and six faces. Sure enough, V − E + F = 2.Fill in the chart below (you can use Google!), and verify Euler’s formula for the otherfour platonic solids.

Tetrahedron Cube Octahedron Icosahedron Dodecahedron

Vertices 8

Edges 12

Faces 6

V − E + F? 2

10. Is every tree planar? Explain your reasoning.

Page 14: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

11. When presented with the following graph, a student says “That graph is not planar,because two of the edges are crossing.”

What is wrong with this student’s reasoning?

12. Application to Geometry: One of the most surprising formulas for computingareas seems more like a magic trick than real math. But it works! It’s called Pick’sTheorem, and it can find the area of any polygon whose vertices are all integer points(i.e points (x, y) where both x, y ∈ Z). For example, here’s a triangle:

x

y

There are 14 integer points on the boundary of this polygon, and 9 integer points insidethe polygon (please confirm this now!). Pick’s Theorem says: to find the area, dividethe number of integer points on the boundary by 2, then add the number of interiorpoints, then subtract one:

A =14

2+ 9− 1 = 7 + 9− 1 = 15.

You can confirm this is correct using the traditional A = 12bh formula.

More generally, the theorem says that a polygon with vertices at integer points havingB integer points on the boundary and I interior integer points has area

A =1

2B + I − 1.

Let’s see why Pick’s Theorem works. In other words, let’s prove it!

Page 15: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

(a) An elementary triangle is a triangle whose vertices are integer points but hasno other integer points inside or on the boundary. Every elementary triangle hasthe same area. What is it?

(b) Given a polygon with vertices at integer points, the first step is to triangulate itinto a bunch of elementary triangles. For example:

triangulate!−−−−−−−→

The polygon, the integer points inside and on the boundary, and the new edgescreated by the triangulation now form a planar graph with V vertices, E edges,and F faces. Let VB and VI denote the number of vertices on the boundary andinterior, respectively (so V = VB + VI). Likewise, let EB and EI denote thenumber of edges on the boundary and interior (so E = EB + EI). Explain whyVB = EB.

(c) Use the two previous parts to explain why the polygon’s area is A = 12(F − 1).

(d) Now we count edges. Each elementary triangle is bordered by 3 edges. Use thisto prove that

3(F − 1) + EB = 2E.

(e) Combine the results of the two previous parts to obtain the formula

E = F − 1 + A+1

2EB.

(f) Plug in for E in Euler’s polyhedron formula to get

A = V − 1

2EB − 1.

(g) Finally, use the earlier facts that V = VB + VI and EB = VB to finish the proofof Pick’s Theorem.

(h) Why does Pick’s Theorem require the polygon to have its vertices at integerpoints? Specifically, which part(s) of our proof would fail if the polygon’s verticeswere not necessarily at integer points?

Page 16: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

8: Graph Theory in terms of Set Theory1. Draw the graph G = (V,E) with V = {a, b, c, d, e, f} and

E = {{a, b}, {a, c}, {a, d}, {a, e}, {b, d}, {b, f}, {c, d}}.

2. If I asked you to draw the graph G = (V,E) with

E = {{a, b}, {a, c}, {a, d}, {a, e}, {b, d}, {b, f}, {c, d}},

do you have enough information to draw the graph?

3. List the vertex set and edge set for the graph

1

23

4

5 6

4. Draw the graph complements of the cycle graphs C3, C4, C5, and C6.

5. Draw the graph complement of the cube graph.

6. If G has 7 vertices and 12 edges, how many vertices edges does its graph complementG have?

7. If G has n vertices and m edges, how many vertices and edges does its graph comple-ment G have?

8. Recall that the complete bipartite graph Km,n is the bipartite graph with vertex setsV1 of size m and V2 of size n. How many edges does Km,n have?

9. What is the graph complement of Km,n?

10. Several times so far, we talked informally about deleting edges and vertices in graphs.Here are the formal, set-theoretic definitions. If G = (V,E) is a graph and e ∈ E, thegraph G − e is the graph obtained by removing e from the edge set. If v ∈ V , thegraph G − v is the graph obtained by removing v from the vertex set and removingany edge e such that v ∈ e.

For each of the graphs G shown below, with vertex v and edge e marked, draw G− eand G− v.

Page 17: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

v

e

v

e

ve

11. Directed graphs, or digraphs for short, are just like graphs except the edges areordered pairs of vertices, rather than 2-subsets of vertices. If (v, w) is an edge of adirected graph G, we draw an arrow from v to w when drawing the graph. Draw thedirected graph G = (V,E) with V = {1, 2, 3, 4} and

E = {(1, 2), (1, 3), (2, 1), (2, 3), (2, 4), (4, 2), (4, 3)}.

12. For the digraph below, list the vertex set V and the edge set E.

1

23

4

5 6

13. For an undirected graph G = (V,E), we defined edges to be 2-element subsets of V .And of course we all remember that in a set, order doesn’t matter. That is, the edge{v, w} is the same as the edge {w, v}. Also, with sets we never list the same elementmore than once; i.e. the set {v, v} is just the set {v}, which is not a 2-subset. So forundirected graphs, every edge joins two distinct vertices.

Directed graphs are different, because the edges are ordered pairs. And in orderedpairs, you can list the same element twice. So directed graphs can have edges joiningvertices to themselves! We call them loops (can you guess why?).

Draw the directed graph G = (V,E) with V = {1, 2, 3, 4} and

E = {(1, 1), (1, 2), (2, 2), (2, 3), (3, 3), (3, 4), (4, 4), (4, 1)}.

Page 18: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

9: Sets and Relations1. Let A = {1, 2, 3} and B = {x, y}. List all the elements of the Cartesian product A×B.

2. If set A has m elements and set B has n elements, how many elements does A × Bhave?

3. Suppose set A has 17 elements. ∅, of course, is the empty set. How many elementsdoes A×∅ have?

4. Let A = {1, 2, 3, 4, 5, 6, 7, 8} and let B = {2, 4, 6, 8, 10}. Define a relation R : A → Bby the rule “(a, b) ∈ R if and only if a > b.” List all the ordered pairs of this relation,and draw its digraph.

5. Let A be the set of students taking Math 235 this semester. Let B be the set of allcourses being offered at King’s College this semester. Define a relation R : A→ B bythe rule “aRb if and only if student a is currently enrolled in course b.” List all thepairs of this relation that involve you.

6. Let A = {a, b, c, . . . , x, y, z} be the set of all letters in the English alphabet, and letB = {discrete,mathematics, boring, painful}. Define a relation R : A → B as follows:“(α, β) ∈ R if and only if letter α appears at least once in word β”. How many pairsdoes this relation have? Also, why do you think I used α and β in this exercise insteadof a and b?

7. Let A = {1, 2, 3, 4}. List the ordered pairs of the relation R : A→ A whose digraph is

1 2

34

8. Let A = {1, 2, 3, 4, 5} and let R : A→ A be defined by

R = { (1,2), (3,1), (3,3), (4,4), (4,5)}

(a) Which new pairs must be added to make R reflexive?

(b) Which new pairs must be added (besides the ones you already added in part (a))to make R symmetric?

(c) Which new pairs must be added (besides the ones you already added in parts (a)and (b)) to make R transitive?

9. Determine whether the following relations are reflexive, symmetric, antisymmetric,and/or transitive.

Page 19: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

(a) R : Z→ Z defined by the rule xRy if and only if x− y ≥ 0.

(b) R : Z→ Z defined by the rule (x, y) ∈ R if and only if y = x2.

(c) R : R→ R defined by the rule xRy if and only if xy = 1.

10. Let A = {1, 2, 3, 4}. List the pairs in the relation R : A→ A whose adjacency matrixis

1 0 0 11 1 0 00 1 1 11 1 1 0

11. Let A = {1, 2, 3, 4, 5}. Define a relation R : A→ A by the rule (x, y) ∈ R if and only

if xy > 9. List the pairs, draw the digraph, and give the adjacency matrix for R.

12. Application to Data Security: Imagine you’re a breaking into a safe (or, if you’vedone this before, just think back to the last time you did it). This safe requires youto enter a four-digit PIN. Curiously, unlike more secure locks that require the thief toenter a PIN and then press an ENTER button, this lock has no ENTER button and willaccept whichever digits were entered last. You’ve got lots of time, so you figure “If Itype all possible PINS, from 0000 to 9999, eventually I’ll stumble upon the right one.But how long might that take?”

Well, that depends on how cleverly you try potential PINS. If you type 0000, andthen type 0001, and then 0002, and so on, you’re being very inefficient. Since thelock accepts the last four digits entered, you can let the potential PINS overlap. Forexample, typing 123456 actually tests three possible PINS, 1234, 2345, and 3456.

So now we’re ready to get to the real mathematics of this problem. We are looking forthe shortest possible string of digits that contains all possible substrings of length 4.This type of problem (finding the shortest sequence containing all possible subsequencesof some length) is applicable not just to hacking PIN-based locks, but also to DNAsequencing, robotics, and the design of neurological and psychological experiments.(thanks, Wikipedia!)

(a) There are 10000 potential PINS. Assuming they can be arranged so that eachPIN has three digits overlapping with the one before it and the one after it, howmany buttons do you have to push to test all of them?

(b) A more secure system would require you to press an ENTER button after eachattempted PIN. How many buttons would you have to push to test all potentialPINS under this more secure system?

This problem has a graph-theoretic solution. However, if we use the digits 0 through9, the graphs are very large. To keep things small, we’ll focus on the binary version ofthe problem. I think that once you know how to solve the binary version, you will seehow to easily extend the solution to the ten-digit version.

Page 20: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

Let A be the set of all 4-digit binary strings:

A = {0000, 0001, 0010, 0100, 1000, 0011, 0101, 0110,

1001, 1010, 1100, 0111, 1011, 1101, 1110, 1111}

Define a relation R on A by the rule xRy if and only if the last three digits of stringx equal the first three digits of the string y.

(c) Draw the digraph for this relation.

(d) Find a Hamilton cycle in the graph, and use that cycle to construct a string oflength 19 containing all 4-digit binary strings.

10: Equivalence Relations1. Let A = {1, 2, 3, 4, 5, 6}, and let R : A→ A be the relation

R = {(1, 1), (1, 2), (2, 1), (2, 2), (3, 3), (3, 4), (4, 4), (4, 5), (5, 5)}.

Explain why R is not an equivalence relation. Specifically, which of the propertiesreflexive, symmetric, and/or transitive are violated?

2. Start with the relation R : A → A from the previous exercise. Add all necessarypairs to make R an equivalence relation on A. Then draw the directed graph and theadjacency matrix of the resulting equivalence relation.

3. Let ∼ be a relation on Z defined by a ∼ b if and only if a− b is a multiple of 4.

(a) Prove ∼ is an equivalence relation.

(b) What are the equivalence classes of Z under ∼?

4. Let ∼ be a relation on Z defined by a ∼ b if and only if a− b is a multiple of 5.

(a) Prove ∼ is an equivalence relation.

(b) What are the equivalence classes of Z under ∼?

5. Fix an integer n ≥ 2, and let ∼ be a relation on Z defined by a ∼ b if and only if a− bis a multiple of n.

(a) Prove ∼ is an equivalence relation.

(b) What are the equivalence classes of Z under ∼?

6. Two fractions aband c

dare equivalent if and only if ad = bc. Prove that the equivalence

of fractions is indeed an equivalence relation.

7. Let A = Z−{0} be the set of all nonzero integers. Define a relation ∼: A→ A by therule a ∼ b if and only if ab > 0.

Page 21: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

(a) Prove ∼ is an equivalence relation.

(b) What are the equivalence classes of A under ∼?(c) Why did we exclude zero? Would this relation ∼ still be an equivalence relation

on Z?

8. Consider the partition {{2, 5}, {1, 3}, {4, 6, 7}} of the set A = {1, 2, 3, 4, 5, 6, 7}. Drawthe graph and the adjacency matrix of the equivalence relation implied by this partition.

9. The idea of an “equivalence relation” is a generalization of the more familiar idea of“equality”. Define a relation ∼: N→ N by the rule a ∼ b if and only if a = b.

(a) “Prove” that this relation (which we simply call equality) is indeed an equivalencerelation.

(b) Since N contains infinitely many elements, we can’t actually draw the whole di-graph or adjacency matrix for the equality relation. But try your best to describethem verbally.

10. Application to Voting Theory: Here’s a scenario: four entrepreneurs start a com-pany. Each founder provides some startup money, and is thereby granted a proportionalamount of decision-making votes. Amy provides $4000 and is given 4 votes. Bob pro-vides $3000 and is given 3 votes. Carol provides $3000 and is also given 3 votes. Daveprovides $1000 and is given 1 vote. Whenever an important decision – i.e. a motion– arises, the founders vote on what to do. They agree that a simple majority (6 votes)will suffice to carry a motion.

This arrangement is an example of a weighted voting system, or WVS. A WVSconsists of a set of players P1, P2, . . . , Pn who collectively vote on motions. Each playerPk has a certain weight, or number of votes, denoted wk. For simplicity the weightsare always non-negative integers, and by convention

w1 ≥ w2 ≥ · · · ≥ wn.

There is also a quota, or minimum number of votes needed for a motion to pass. Thequota q must be at least a majority of the total number of votes, but no greater thanthe total number of votes. That is,

1

2

n∑k=1

wk < q ≤n∑k=1

wk.

Any WVS can be completely described by a compact array

[ q : w1, w2, . . . , wn ].

The example we started with was [ 6 : 4, 3, 3, 1 ].

Here’s the reason we’re talking about WVS now: the actual numbers involved in aWVS (the quota and the weights) can be extremely deceptive. For example, in the

Page 22: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

system [ 6 : 4, 3, 3, 1 ], the fact that P1 has 4 votes does not make P1 any more “powerful”than P2 or P3. To reach the quota, it is only necessary that two of the players P1, P2,and P3 want to pass the motion, and it doesn’t matter which two. Also, P4 with hisone vote is absolutely powerless; there is no scenario where that one vote makes orbreaks a motion. So I repeat: the actual numbers involved in a WVS can be extremelydeceptive.

What really matters in a WVS is which coalitions – i.e. subsets of players – haveenough weight to meet or exceed the quota. In the system [ 6 : 4, 3, 3, 1 ], the winningcoalitions are

{P1, P2} {P1, P2, P3} {P1, P2, P3, P4}{P1, P3} {P1, P2, P4}{P2, P3} {P1, P3, P4}

{P2, P3, P4}

Now look at this much simpler WVS: [ 2 : 1, 1, 1, 0 ]. It has the same number of playersas our original example, and you should quickly check that it has precisely the samewinning coalitions. So even though [ 2 : 1, 1, 1, 0 ] is not the same WVS as [ 6 : 4, 3, 3, 1 ],it is effectively no different.

Two WVS are equivalent if they have the same number of players and precisely thesame winning coalitions. There are infinitely many possible WVS with n players, butthey all sort themselves into a finite number of equivalence classes. Now it’s your turn!

(a) Prove that equivalence of WVS is indeed an equivalence relation.

(b) For the WVS [ q : 5, 4, 3, 2, 1 ], what are the possible values for the quota q? Foreach “legal” value of q, find all the winning coalitions.

(c) Determine whether the following WVS are equivalent:

[ 4 : 2, 2, 1, 1, 1 ] and [ 4 : 2, 1, 1, 1, 1 ]

(d) How many inequivalent WVS with n = 3 players can you find? That is, of theinfinitely many WVS with 3 players, how many equivalence classes do they sortthemselves into?

11: Ordered Sets1. Let A = {a, b, c, d, e}. Answer the following by either listing pairs, graphing, or pro-

viding an adjacency matrix. Better yet, list, graph, and provide a matrix!

(a) Give an example of a relation on A that is antisymmetric and transitive but isnot a partial order.

(b) Give an example of a relation on A that is reflexive and transitive but is not apartial order.

Page 23: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

(c) Give an example of a relation on A that is antisymmetric and transitive but isnot a partial order.

2. Here are the Hasse diagram of three different partial orders on the set {a, b, c, d, e, f}.List all the pairs of each partial order.

a

b

c

d

e

f

a

b

c

d

e

f

a

cb d e

f

3. Let A = {1, 2} Draw the Hasse diagram of the poset (P(A),⊆).

4. Let B = {1, 2, 3, 4}. Draw the Hasse diagram of the poset (P(B),⊆).

5. If x and y are elements of a poset, we say that y covers x if x ≺ y but there is nointermediate z with x ≺ z ≺ y. In other words, we draw an edge in a Hasse diagramfrom x up to y if and only if y covers x.

(a) In the poset (Z,≤), which element(s) cover 7?

(b) Let A = {1, 2, 3, 4, 5, 6}. In the poset (P(A),⊆), which element(s) cover {1, 2}?(c) Let A = {1, 2, 3, . . . , 99, 100}. In the poset (P(A),⊆), how many elements cover{1, 2}?

6. Let A = {1, 2, 3, . . . , 20}. Define a relation R : A → A by the rule (x, y) ∈ R if andonly if y is an integer multiple of x. For example, (2, 10) ∈ R because 10 is an integermultiple of 2, but (3, 10) /∈ R because 10 is not an integer multiple of 3.

(a) Prove R is a partial order on A.

(b) Draw the Hasse diagram for this poset.

7. Application to Voting Theory: Recall some ideas about weighted voting frombefore: a WVS consists of a set of players, each with some non-negative weight (numberof votes), and a quota. Also – and this is very important here – we always list theplayers P1, . . . , Pn in decreasing order by weight. So P1 always has at least as manyvotes as P2, P2 has at least as many votes as P3, and so on.

Page 24: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

Subsets of players are called coalitions. A winning coalition is any coalition whosetotal weight meets or exceeds the quota. WVS are completely determined by theirwinning coalitions, because any two WVS with the same number of players and samewinning coalitions are equivalent. So let’s focus on the coalitions.

We say coalition A dominates coalition B if, no matter how the player weights areassigned, the total weight of A is always at least as big as the total weight of B. Forexample, the coalition {P1, P2} dominates the coalition {P2, P3}, because P1 alwayshas at least as many votes as P3 (remember: we list players in decreasing order byweight). So without even knowing what the weights are or what the quota is, we cansay definitively that {P1, P2} is always a “stronger” coalition than {P2, P3}.

(a) Prove that domination is a partial order on the set of all possible coalitions.

(b) Draw Hasse diagrams for this partial order, first for n = 2, then n = 3, and finallyn = 4. Remember: if a set has n elements, it has 2n subsets, so your diagramsshould have 4, 8, and 16 coalitions, respectively.

(c) If you find this exercise fun, you are welcome to draw the Hasse diagram for n = 5(I think that one is very pretty).

12: Functions1. Let A be the set of all King’s College students. Determine whether each of the following

relations is a function.

(a) The relation that pairs each student with his or her student ID number.

(b) The relation that pairs each student with each course that student is currentlytaking.

(c) The relation that pairs each student with any math courses that student is cur-rently taking.

(d) The relation that pairs each student with his or her age.

(e) The relation that pairs each student with the college dormitory in which he orshe lives.

2. Let A = {1, 2, 3, 4}. Below are the directed graphs of six different relations on A.

(a) Determine which of these relations are functions. For those that aren’t functions,give at least one reason why not.

(b) Redraw each graph in a bipartite fashion, with two copies of the vertex set, andedges going from the first copy (the domain) to the second copy (the codomain).

Page 25: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

1 2

34

(a) 1 2

34

(b) 1 2

34

(c)

1 2

34

(d) 1 2

34

(e) 1 2

34

(f)

3. Suppose A and B are nonempty sets. Can the Cartesian product A × B ever be afunction from A to B? Explain.

4. Let A = {1, 2, 3, 4, 5, 6} and B = {a, b, c}. Consider the function f : A → B definedby

f = {(1, b), (2, c), (3, a), (4, c), (5, b), (6, b)}.

(a) Draw the directed graph of this function.

(b) What is the image of 2?

(c) What is the image of 4?

(d) What are the preimages of a?

(e) What are the preimages of b?

5. Let f : Z→ Z be the function defined by the rule f(x) = x2.

(a) What is the image of 4?

(b) What is the image of 7?

(c) What are the preimages of 4?

(d) What are the preimages of 7?

6. Let A = {1, 2, 3, 4, 5}. Construct the adjacency matrices of the following functionsf : A→ A:

(a) f = {(1, 2), (2, 3), (3, 4), (4, 5), (5, 1)}(b) f = {(1, 1), (2, 3), (3, 2), (4, 5), (5, 4)}(c) f = {(1, 3), (2, 3), (3, 3), (4, 3), (5, 3)}

Page 26: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

7. Use the results of the previous exercise to suggest an answer to the following question:What is special about the adjacency matrices of function on a set A, as opposed tomere relations on A?

8. Find the range of the following functions f : Z→ Z:

(a) f(n) = n+ 4

(b) f(n) = 3n+ 2

(c) f(n) = |n− 7|(d) f(n) = n4

9. Almost anything in math is a function if you want to look at it that way. For example,the fundamental operations of arithmetic are functions. Take addition: when we add,we are inputting a pair of numbers and outputting a single number (their sum). Thatmeans addition is a function

add : (R× R)→ R defined by the rule add(x, y) = x+ y.

Write down the functions corresponding to the following operations: subtraction, mul-tiplication, division, taking a square root, and taking a cube root. Be careful with thedomains for division and taking a square root!

10. The floor function is the function b c : R → Z that rounds its input down to thenearest integer. For example, bπc = 3. Find real numbers x and y satisfying bxc+byc <bx+ yc.

11. The ceiling function is the function d e : R→ Z that rounds its input up to the nearestinteger. For example, dπe = 4. Find real numbers x and y satisfying dxe+dye > dx+ye.

12. This is an important exercise. It shows that every function is hiding an equivalencerelation inside it. Let A and B be sets, and let f : A→ B be a function. For x, y ∈ A,define x ∼ y if and only if f(x) = f(y).

(a) Prove that ∼ is an equivalence relation on A.

(b) Suppose A = B = {1, 2, 3, 4, 5, 6} and

f = {(1, 2), (2, 1), (3, 1), (4, 5), (5, 6), (6, 1)}.

Find all the equivalence classes.

(c) Suppose A = B = R, and f(x) = sin x. What is the equivalence class containingx = 0?

13. Application to Geometry: A transformation of the plane is any function thatmoves points around; i.e. any function of the form f : R2 → R2. Try your best todescribe the effects of the following transformations of the plane:

Page 27: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

(a) f(x, y) = (2x, y)

(b) f(x, y) = (2x, 3y)

(c) f(x, y) = (y, x)

(d) f(x, y) = (x, 0)

Isometries are a special kind of plane transformation that preserve distances. Thatis, if f : R2 → R2 is an isometry that maps the points P and Q to the points P ′ andQ′, then the distance between P and Q equals the distance between P ′ and Q′. Themost fundamental isometries are translations, rotations, and reflections.

Translation: All points shift the same distance in the same direction.

Rotation: All points rotate through some angle about some fixed central point.

Reflection: All points are reflected across some line (the axis of reflection).

(e) Find a formula f(x, y) = · · · for the translation that shifts all points five units tothe right and three units down.

(f) Find a formula f(x, y) = · · · for a 90◦ counterclockwise rotation centered at thepoint (0, 0).

(g) Find a formula f(x, y) = · · · for a reflection across the x-axis.

(h) Find a formula f(x, y) = · · · for a reflection about the y-axis.

13: Bijections1. Let A = {1, 2, 3, 4, 5} and define a function f : A→ A as

f = {(1, 3), (2, 1), (3, 4), (4, 1), (5, 5)}.

If f injective? Is it surjective?

2. Let A = {1, 2, 3, 4, 5} and define a function f : A→ Z by the rule

f(x) =

{x2 + 1 if x is even,2x− 5 if x is odd.

List the ordered pairs of f . Is f injective?

3. Consider the function f(x) = |x|. Determine (with reasons) whether f is injective andor surjective in each of the following cases:

(a) viewing f as a function f : N→ N,(b) viewing f as a function f : Z→ Z,(c) viewing f as a function f : Z→ N.

Page 28: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

4. Let A = {1, 2, 3, 4, 5}, and define a function f : P(A) → P(A) by the rule f(S) =S ∩ {1, 2, 3, 4}. Is f injective? Is f surjective?

5. Prove that the function f : R→ R defined by f(x) = 7x+ 1 is a bijection.

6. Prove that the function g : Z → Z defined by g(n) = 7n + 1 is injective but notsurjective.

7. Explain why the function f : R → R defined by f(x) = sinx is not injective. Thenrestrict the domain to as large a set as possible so as to make the function injective.

8. Recall that the addition and multiplication of real numbers are functions add, mult :(R× R)→ R.

(a) Is add injective? Is it surjective?

(b) Is mult injective? Is it surjective?

9. Is the floor function b c : R→ Z injective? Is it surjective? Explain.

10. Consider the function f : N→ Z defined by f(n) = (−1)nbn2c, where bn

2c means divide

n by 2, then apply the floor function.

(a) Compute f(n) for n = 1, 2, 3 . . . until you are convinced this function is a bijection.

(b) Since bijections essentially pair off the elements from the domain with the elementsin the codomain, the fact that there is a bijection from N to Z suggests that thesetwo sets have the same “size”, even though Z contains N as a proper subset. Doesthis bother you? Provide arguments supporting your opinion.

11. Suppose A is a set containing m elements and B is a set containing n elements.

(a) If m > n, prove that no function f : A→ B can be injective.

(b) If m < n, prove that no function f : A→ B can be surjective.

12. Informally, two graphs are isomorphic (meaning they have the “same shape”) if you canredraw one to look just like the other. Here is the formal definition: Let G1 = (V1, E1)and G2 = (V2, E2) be two graphs. An isomorphism is a bijection f : V1 → V2 withthe additional property that {x, y} ∈ E1 if and only if {f(x), f(y)} ∈ E2 (in otherwords, an isomorphism maps vertices to vertices and also maps edges to edges). Thegraphs G1 and G2 are isomorphic if there exists an isomorphism from V1 to V2.

Two of the three graphs shown below are isomorphic; the third is not isomorphic tothe other two. For the two that are isomorphic, prove it by exhibiting an isomorphismfrom one to the other.

Page 29: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

A B

CD

1 2

34

w

x

y

z

13. Application to Geometry: Recall that an isometry of the plane is a transforma-tion f : R2 → R2 that preserves distances. The fundamental types of isometry aretranslations, rotations, and reflections.

(a) Explain why any isometry must necessarily be a bijection.

(b) Give an example of a transformation f : R2 → R2 that is a bijection but not anisometry. If you have trouble finding an explicit formula, a verbal description isOK.

14: Inverse Functions1. Let A = {1, 2, 3, 4, 5} and let f : A→ A be the function

f = {(1, 2), (2, 3), (3, 4), (4, 5), (5, 1)}.

Find f−1.

2. Let A = {1, 2, 3}. There are exactly 27 different functions f : A → A. How many ofthem are invertible? List the pairs and draw the graph for each invertible function.

3. Of the invertible functions you found in the previous exercise, how many of them areequal to their own inverse?

4. Create the adjacency matrices for all the invertible functions you found in Exercise 2.Do you see anything special about the adjacency matrices of invertible functions, asopposed to the adjacency matrices of mere functions?

5. The function f : R → R defined by f(x) = 7x − 5 is a bijection and is thereforeinvertible. Find a formula for f−1.

6. Generalizing the previous exercise, the function f : R→ R defined by f(x) = ax+ b isinvertible, provided a 6= 0. Find a formula for f−1.

7. Let R∗ = R−{0}. That is, R∗ is the set of all nonzero real numbers. Let f : R∗ → R∗be the function f(x) = 1

x.

(a) Prove that f is invertible.

(b) Find a formula for f−1.

Page 30: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

8. Let G be the set of all graphs. Define a function comp : G → G by the rule comp(G) = G.In other words, this function inputs a graph and outputs its graph complement. Provethat this function is invertible, and moreover, it is its own inverse.

9. Application to Geometry: Last time we talked isometries, you (hopefully) explainedwhy isometries are bijections. That means every isometry is invertible. Describeverbally the inverses of the following isometries:

(a) A translation that shifts all points 3 units to the right and 7 units up.

(b) A 45◦ degree counterclockwise rotation centered at the origin.

(c) A reflection about the x-axis.

(d) A reflection across the line y = x.

10. Way back when we first learned about trees, we saw how computers can search forHamilton cycles by forming the search tree of a graph, and then performing a depth-first search of the tree until a Hamilton cycle is found. For reference, here is the graphand search tree we used back then:

A

B

C

D

A

B C

C D B D

D C D B

A A

Like almost everything in math, this process of creating a search tree from a givengraph can be expressed in the language of functions. Specifically, let G be the set of allgraphs, and let T be the set of all trees. When we create the search tree for a graph,we are really applying a function search : G → T . Input a graph, output its searchtree. Here’s a fun question: Is this function invertible? That is, can we recreate agraph G from its search tree T? Let’s try! Find a graph G with four vertices A, B, C,and D, whose search tree is

Page 31: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

A

B C D

C B D E C E

D E E D B E C

D B

A A

11. Keeping with the theme that almost everything in math can be expressed in the lan-guage of functions, let’s talk about that most important calculus concept: differentia-tion. You probably think of differentiation as something you do to functions, but guesswhat: differentiation is a function!

Specifically, let F denote the set of all real-valued functions of a real variable (functionsthat input a real number and output a real number; the ones you studied in Calc I andCalc II). Differentiation is a function D : F → F defined by D(f) = f ′. Every f ∈ Fhas a unique derivative f ′ ∈ F , so D satisfies the definition of function. Examples:

D(x2) = 2x, D(sinx) = cos x, D(ekx) = kekx.

The question is: is the function D : F → F invertible? Explain your reasoning clearlyand completely.

15: Function Composition1. Let A = {1, 2, 3, 4, 5} and B = {1, 2, 3, 8, 9}, and define functions f, g : A→ B by

f = {(1, 8), (3, 9), (4, 3), (2, 1), (5, 2)} and g = {(1, 2), (3, 1), (2, 2), (4, 3), (5, 2)}.

Find f ◦ g or explain why it doesn’t exist. Repeat for g ◦ f , f ◦ f , and g ◦ g.

2. Let A = {1, 2, 3, 4}, and define functions f, g : A→ A by

f = {(1, 3), (2, 2), (3, 4), (4, 1)} and g = {(1, 4), (2, 3), (3, 1), (4, 2)}.

Find the following compositions:

Page 32: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

(a) g−1 ◦ f ◦ g(b) f ◦ g−1 ◦ g(c) g ◦ f ◦ g−1

(d) g ◦ g−1 ◦ f(e) f−1 ◦ g−1 ◦ f ◦ g

3. Let f : R → Z be the floor function, and let g : R → Z be the ceiling function.Compute f ◦ g and g ◦ f .

4. Let f : R→ R be the absolute value function. Compute f ◦ f .

5. We proved that if f : A→ B and g : B → C are both injective, then their compositiong ◦ f : A → C is also injective. The converse is false. Find an example of functionsf, g such that g ◦ f is injective, but at least one of f or g is not injective.

6. Suppose f : A → B and g : B → C are surjective functions. Prove that g ◦ f is alsosurjective.

7. Find an example of functions f, g such that g ◦ f is surjective, but at least one of f org is not surjective.

8. There is an important but boring function that exists on any set. Let A be a set,and define the function ι : A → A by the rule ι(x) = x for all x ∈ A. This is theidentity function on A. It doesn’t do anything (input x, output x, no change!), butit’s important that it exists. For one thing, it is the function that results whenever youcompose an invertible function f with its inverse:

f−1 ◦ f = f ◦ f−1 = ι.

(a) Let A = {1, 2, 3, 4}. List the ordered pairs, draw the directed graph, and createadjacency matrix for the identity function on A.

(b) Let A = {1, 2, 3}, and let f, g : A→ A be defined by

f = {(1, 2), (2, 3), (3, 1)}, and g = {(1, 3), (2, 2), (3, 1)}.

Compute g−1 ◦ f−1 ◦ f ◦ g.(c) Generalizing the previous part, explain why (f ◦ g)−1 = g−1 ◦ f−1.

9. Let A = R− {0, 1}; that is, A is the set of real numbers with 0 and 1 removed. Hereare six functions on A:

ι(x) = x, f(x) = 1− 1

x, g(x) =

1

1− x, h(x) =

1

x, r(x) =

x

x− 1, s(x) = 1− x

(a) Show that f ◦ g = ι and g ◦ r = s. Complete the table, thereby showing that thecomposition of any two of these functions is another one of them.

Page 33: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

◦ ι f g h r sιf ιg shrs

(b) Which of the six given functions are invertible? Find the inverse of each invertiblefunction.

10. Define a function f : Z→ Z by the rule

f(n) =

{n− 2 if n ≥ 1000

f(f(n+ 4)) if n < 1000

(a) Find the values of f(1000), f(999), f(998), f(997), and f(996).

(b) Can you guess a simpler formula for this function?

(c) What is the range of this function?

11. When we compose a function with itself multiple times, it is customary to use expo-nents. For example, f ◦ f can be written as f 2 and f ◦ f ◦ f can be written as f 3,etc.

Let A = {1, 2, 3, 4, 5, 6}, and let f : A→ A be defined by

f = {(1, 2), (2, 3), (3, 1), (4, 4), (5, 6), (6, 5)}.

Find f 2, f 3, and f 602.

12. Let A = {1, 2, 3, 4, 5} and let g : A→ A be defined by

g = {(1, 2), (2, 3), (3, 4), (4, 5), (5, 5)}.

Find g3, g5, and g1000.

13. Grab a bunch of pennies and sort them into some stacks. For uniformity, lets agree tosort the stacks from biggest (on the left) to smallest (on the right). If, for example,you have stacks of size 5, 3, 3, and 1, I’ll represent that by the string 5331.

Now, take one penny from each stack, and make a new stack out of the pennies youtook. So if you start with 5331, you end up with 4422 (the stack with a single pennydisappears when you take one penny from each stack). Or if you start with 33322, youend up with 522211. Guess what? This is a function! Specifically, it is a function f :A→ A, where A is the set of all possible “collections of stacks of pennies” (equivalently,A is the set of all numerical strings written in non-increasing order).

Page 34: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

(a) Prove that f is not injective by finding two different strings x and y with f(x) =f(y).

(b) Prove that f is not surjective by finding a string x such that x 6= f(y) for anystring y.

(c) Find a string x satisfying f(x) = x. If you can’t (and depending on how manypennies you’re using, it might be impossible), find a string y satisfying fn(y) = yfor some n ≥ 2.

Note: A former King’s student, who is now in graduate school pursuing a PhD, con-ducted research on this function several years ago. If you find this problem interesting,let me know; there are a lot of intriguing questions here I’ve yet to pursue.

14. Application to Geometry: OK, let’s talk about isometries again (this is the lasttime, I promise). This time we’ll talk about compositions of isometries.

Let Tx,y denote the translation that shifts the plane x units horizontally and y unitsvertically. Let Rθ denote a counterclockwise rotation about the origin with angle θ(with θ measured in degrees).

(a) Compute T1,2 ◦ T3,4.(b) More generally, compute Ta,b ◦ Tc,d.(c) Does Ta,b ◦ Tc,d = Tc,d ◦ Ta,b? Draw a picture supporting your answer.

(d) Compute R30 ◦R20.

(e) More generally, compute Rα ◦Rβ.

(f) Does Rα ◦Rβ = Rβ ◦Rα? Draw a picture supporting your answer.

16: Graphs and Counting1. You should practice multiplying matrices until the technique becomes natural. Here

are a few examples to practice with:

(a) [1 23 4

]×[

5 67 8

]=

[? ?? ?

](b) [

1 −1−1 1

]×[

2 00 4

]=

[? ?? ?

](c) 2 −1 0

−1 2 −10 −1 2

× 1 2 3

1 2 31 2 3

=

? ? ?? ? ?? ? ?

Page 35: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

2. Reverse the order of the matrices in the previous exercise and multiply them again.For matrices, A×B does not usually equal B × A.

3. Consider the following graph:

1

2

3

4

(a) How many walks of length 3 are there from vertex 1 to vertex 2? Try to find themall by hand, then use matrix powers to check your answer.

(b) How many walks of length 4 start and end at vertex 1? Again, try to find themall by hand, then use matrix powers to check your answer.

(c) How many walks of length 8 are there from vertex 3 to vertex 1?

4. In a directed graph there tend to be fewer possible walks, because the streets (edges)are one-way. Here is a directed version of the graph from the previous exercise:

1

2

3

4

For k = 1, 2, 3, . . ., how many walks of length k are there from vertex 1 to vertex 4?

5. I want to show you a connection between matrix multiplication and function composi-tion. Let A = {1, 2, 3, 4} and let f, g : A→ A be functions on A defined by

f = {(1, 2), (2, 3), (3, 1), (4, 4)} and g = {(1, 3), (2, 4), (3, 1), (4, 2)}.

(a) Find the compositions f ◦ g and g ◦ f .(b) Draw the adjacency matrices for f and g. Call them Af and Ag.

(c) Compute the matrix products Af × Ag and Ag × Af .(d) If you didn’t make any mistakes, you should find that Af × Ag is the adjacency

matrix of g ◦ f and Ag × Af is the adjacency matrix of f ◦ g. Please confirm.

Page 36: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

In a nutshell: functions have adjacency matrices with only zeros and ones. Multiplyingthose matrices is the same as composing the functions. Imagine an algorithm forteaching a computer to perform function composition; all that fancy “input/output”stuff can be completely encoded in ones and zeros, addition and multiplication. Nice!

6. Recall that Km,n is the complete bipartite graph with m “red” vertices and n “blue”vertices, with every red vertex adjacent to every blue vertex.

(a) Prove that if m 6= n, then Km,n is not Hamiltonian.

(b) How many Hamilton cycles does K4,4 possess?

(c) How many Hamilton cycles does Kn,n possess?

7. If X is a finite set, |X| denotes the number of elements of X. Suppose A and B aresets with |A| = 4 and |B| = 7.

(a) How many functions are there from A to B?

(b) How many injective functions are there from A to B?

(c) Generalize the previous parts; suppose |A| = a and |B| = b. How many functionsfrom A to B are there? How many of them are injective?

8. We learned that a permutation is a bijection from a set to itself. If a set A has n ele-ments, there are exactly n! permutations of A. In some of these permutations, elementsof A will be their own images (graphically, these are the loops). A derangement isa permutation in which no element is its own image (or a permutation whose digraphhas no loops). The number of derangements of a set with n elements is

Dn = n!

(1− 1

1!+

1

2!− 1

3!+ · · ·+ (−1)n

1

n!

)We’ll prove this result later, but for now let’s just play with it.

(a) Find all possible derangements of A = {1, 2, 3}, and confirm that the aboveformula gets it right.

(b) Find all possible derangements of A = {1, 2, 3, 4}, and confirm that the formulagets it right again.

(c) I hope you haven’t forgotten the Maclaurin series for ex that you learned inCalculus 2. If you did, then look it up, and plug in x = −1. Use this seriesto show that Dn ≈ n!

e. This means Dn

n!≈ 1

e≈ 0.368. In other words, if you

randomly permute the elements of a set, there is a 36.8% chance you’ll produce aderangement. Neat!

9. Choosing which shirts to pack for a vacation is equivalent to choosing which shirts notto pack. Which “preliminary fact about the numbers

(nk

)” is this statement referencing?

10. Explain in clear and simple English why(n0

)should equal 1.

Page 37: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

11. Explain in clear and simple English why(nn

)should equal 1.

12. Grab a calculator and try to compute(1000000

2

)using the formula on Slide 82. Explain

why this formula is a terrible way to compute this number. What is a better way?

17: More CountingEach of the first 10 problems can be interpreted as selection problems, where you are selectingk objects from a set of n objects. Determine n and k, whether the order of selection matters,and whether repetition is allowed. Then find the answer; no simplifying necessary.

1. How many 4-digit numbers can you make using only odd digits?

2. If A is a set with 30 elements, how many subsets of A have exactly 12 elements?

3. Suppose you have 120 books and you want to line them up on a shelf from left to right,but the shelf only has room for 75 books. In how many ways can you fill the shelf?

4. How many triples (x, y, z) of nonnegative integers satisfy x+ y + z = 10?

5. 12 runners enter a race. The top 3 finishers earn gold, silver, and bronze medals,respectively. In how many ways can the medals be awarded?

6. How many pairs of dance partners can be selected from a group of 12 women and 20men, assuming men may only dance with women and women may only dance withmen?

7. You are packing for a vacation. Suppose you have 11 shirts, but only enough space topack 7 of them. How many combinations of shirts can you pack?

8. How many ways can you distribute 8 identical pieces of candy among 5 children,assuming you may give each child as many or as few pieces as you like?

9. Draw a 5×5 grid, and imagine that it represents a city street map. In how many wayscan you travel from the southwest corner to the northeast corner, assuming you canonly move north and east?

10. Assume you have an unlimited supply of each of 4 varieties of donut, and you eat onefor breakfast every day. How many different ways can you eat breakfast for one week(seven days)?

The next ten problems combine various counting techniques with one or more selectionscenarios. This does not mean that they are harder problems, only that they can not be soneatly categorized as the first 10 problems. Solve them however you like.

11. If we define a “word” to be any arrangement of letters, how many words can be formedby rearranging the letters of the word MISSISSIPPI?

Page 38: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

12. Draw an n×k grid, where n and k are natural numbers, and imagine that it representsa city street map. In how many ways can you travel from the southwest corner tothe northeast corner, assuming you can only move north and east? Answer the samequestion if one of the city blocks is closed off (so there is a road you can not travel on).

13. If A is a set with 9 elements, how many subsets of A have an odd number of elements?

14. 10 girls and 8 boys want to play kickball. In how many ways can you form a teamconsisting of 5 girls and 5 boys?

15. In how many ways can 4 boys and 4 girls sit in a row, if all the girls must sit together,but the boys may not sit all together?

16. How many ways can you distribute 8 identical pieces of candy among 5 children,assuming you must give each child at least one piece?

17. In how many ways can you rearrange the letters a, b, c, d, e, f, g such that the stringabc appears? For example, the arrangement abecdfg is not permitted, since the lettersa, b, and c are not all adjacent.

18. How many 4-digit numbers contain at least one repeated digit?

19. Suppose you roll a die three times in succession. In how many ways can the sum ofthe rolls equal 10?

20. How many triples of integers (x, y, z) satisfy x + y + z = 10, subject to x ≥ 1, y ≥ 2,and z ≥ 3?

18: Even More Counting!1. In how many ways can you rearrange the letters a, b, c, d, e, f, g such that the string

abc does not appear? For example, the arrangement abecdfg is permitted, since theletters a, b, and c are not all adjacent.

2. If a coin is tossed 5 times, what is the probability that it lands heads at least once?

3. If a coin is tossed 5 times, what is the probability that it lands heads at least threetimes?

4. Among the 30 students registered for a discrete math course, 15 know Java, 12 knowPython, and 5 know both of these languages.

(a) How many students know at least one of Java or Python?

(b) How many students know only Java?

(c) How many students know only Python?

(d) How many students know neither Java nor Python?

Page 39: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

5. How many integers between 1 and 500 are divisible by 3 or 5?

6. Suppose A and B are finite sets with |A ∪ B| < |A| + |B|. Prove that A and B haveat least one element in common.

7. The rule we learned for computing the size of unions is called The Principle of Inclu-sion/Exclusion, because you “include” the sets, “exclude” the intersections, “include”the triple intersections, etc. We can use this principle to justify the formula for de-rangements given in Section 16. Recall Dn denotes the number of derangements of aset of size n. We’ll derive the formula for D4, and then generalize it.

(a) Let A = {1, 2, 3, 4}. Let A1 denote the permutations of A where 1 is fixed. Let A2

denote the permutations of A where 2 is fixed. A3 and A4 are defined similarly.Justify the following formula:

D4 = 4!− |A1 ∪ A2 ∪ A3 ∪ A4|.

(b) Now use the principle of inclusion/exclusion to express the union of the Ais interms of intersections.

(c) Confirm that |Ai| = 3! for each i = 1, 2, 3, 4. Also confirm that |Ai ∩ Aj| = 2 foreach of the

(42

)possible intersections. Finally, confirm that |Ai ∩Aj ∩Ak| = 1 for

each of the(43

)triple intersections.

(d) Use the numbers from the previous part and the formula for the first part toderive the result

D4 = 4!

(1− 1

1!+

1

2!− 1

3!+

1

4!

).

(e) Try to generalize the preceding steps as a proof of the general formula for Dn.

8. Thirty buses are to be used to transport 2000 King’s students from Wilkes-Barre toSouth Bend, Indiana. Each bus has 80 seats. Assume one passenger per seat.

(a) Prove that one of the buses will carry at least 67 passengers.

(b) Prove that one of the buses will have at least 14 empty seats.

9. If there are 44 chairs positioned around 5 tables in a room, show that one table musthave at least 9 chairs around it.

10. What is the smallest number of people you can pack into a room to be certain thattwo of the people have the same first and last initials?

11. Use the Pigeonhole Principle to prove that in any graph G there must be two verticeswith equal degree.

Page 40: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

19: The Binomial Theorem1. Use the Binomial Theorem to expand (a+ 4b)5. Simplify your answer.

2. Expand and simplify(

2x3 − 1

x2

)8

using the Binomial Theorem.

3. Find the coefficient of the term containing y8 in the binomial expansion of (x+ 3y2)17.

4. Find the coefficient of x25 in the binomial expansion of(

2x− 3

x2

)58

.

5. Prove the identity (n

k

)=

(n− 1

k − 1

)+

(n− 1

k

).

This identity, by the way, is the easy way to compute the “next” row of Pascal’s triangle;add the entries diagonally above to get the new entries.

6. Show that6∑

k=2

(k

2

)=

(7

3

)and interpret this result with reference to Pascal’s triangle.

7. The previous exercise is an example of a more general identity:

n∑k=r

(k

r

)=

(n+ 1

r + 1

)for any r and n with 1 ≤ r ≤ n. This is commonly called the Hockey Stick Identity.Can you guess why? Experiment with specific small values of r and n, and interpretwith reference to Pascal’s triangle.

8. Prove the identity k(n

k

)= n

(n− 1

k − 1

).

9. Use the Binomial Theorem and the limit definition of the derivative

df

dx= lim

h→0

f(x+ h)− f(x)

h

to prove the Power Rule:d

dxxn = nxn−1 (assume n ∈ N).

10. Pascal’s triangle is full of beautiful connections. We’ve already seen that the sum ofthe entries in the nth row equals 2n. That seems curious until you remember thatbinomial coefficients count the numbers of subsets of various sizes. This next one isstraight-up crazy.

Page 41: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

Consider the powers of 11:

110 = 1 Row 0 of Pascal’s triangle . . .meh111 = 11 Row 1 of Pascal’s triangle . . . huh?112 = 121 Row 2 of Pascal’s triangle . . . huh!113 = 1331 Row 3 of Pascal’s triangle . . . wft?114 = 14641 Row 4 of Pascal’s triangle . . . omg!

This very strange pattern appears to break down in row 5, because 115 = 161051, whilethe entries in row 5 form the string 1− 5− 10− 10− 5− 1. However, there is a way tomake this fit the pattern. Can you find it? Don’t Google; that would spoil the fun! Ifyou think you found the secret, test it on the next few rows. Then, state your generalresult as clearly as possible.

11. Create the first fifteen rows of Pascal’s triangle (which is really 16 rows, because westart with row zero). Then, grab two different-colored markers (I’ll say red and blue).Color each even number blue, and color each odd number red. You should see aninteresting pattern.

Now, go online and search for "chaos game numberphile". It should be the top hit.Just in case, the exact address is https://www.youtube.com/watch?v=kbKtFN71Lfs.Watch the video. It’s cool. Tell me what you think!

20: Induction1. Prove by induction that for all n ∈ N,

n∑k=1

k3 =n2(n+ 1)2

4.

2. Use the result of the previous problem and another result from class to prove the veryawesome identity

(1 + 2 + · · ·+ n)2 = 13 + 23 + · · ·+ n3,

which is valid for any n ∈ N.

3. Prove by induction that for all n ∈ N, n3 + (n+ 1)3 + (n+ 2)3 is divisible by 9.

4. Use induction to prove the Power Rule ddxxn = nxn−1 for all n ∈ N.

5. Compute the first, second, third, etc. derivatives of the function f(x) = xex. If yousimplify after each step, you should see a pattern forming which allows you to statethe general formula for the nth derivative of f . State this formula, and prove it worksby induction.

Page 42: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

6. Repeat the previous problem for the function f(x) = x2ex. This time you have to takeextra care in simplifying after each step, otherwise the pattern may not appear to you.

7. We’ve already used a combinatorial argument to establish that if A is a set with nelements, then |P(A)| = 2n. Try to prove this fact inductively. In the induction step,let A = {1, 2, 3, . . . , n, n+ 1}. How can the subsets of A be “built” from the subsets of{1, 2, 3, . . . , n}?

8. Use induction to prove the Hockey Stick identity

n∑k=r

(k

r

)=

(n+ 1

r + 1

)This holds for any 1 ≤ r ≤ n. Induct on n; the base case is n = r.

9. A convex n-gon is a polygon with n vertices and such that the interior angles at eachvertex are less than 180◦. Prove by induction that the interior angles of any convexn-gon always sum to (n− 2) · 180◦.

10. Prove by induction that 2n > n2 for all n ≥ 5.

11. Use induction to prove the Binomial Theorem. A comment: If you get stuck on thisand Google a solution, you’ll probably see many proofs using sigma notation in waysthat seem strange or unclear. Don’t do that; this proof is much easier if you avoidsigma notation whenever possible.

21: Induction and Graph Theory1. Suppose G is a connected graph. Prove that if every vertex has degree at least 2, thenG contains at least one cycle. Note: This problem does not require induction, but theresult is useful for the next two problems.

2. Use the previous result to prove that any tree has at least one vertex of degree 1.Bonus: can you prove that every tree has at least two vertices of degree 1?

3. Suppose G is a connected graph in which every vertex has even degree. Prove G hasan Euler circuit.

4. Let G be a graph with 2k vertices and no triangles. Prove by induction on k that G hasat most k2 edges. Hint: In the induction step, let v1 and v2 be adjacent vertices. SinceG contains no triangles, there are no vertices adjacent to both v1 and v2. Remove v1and v2 (and any incident edges), use the induction hypothesis, then reinsert v1 and v2(and any incident edges). How many extra edges appear when v1 and v2 are reinserted?

5. Give an example of a graph with 2k vertices, k2 edges, and no triangles. This exerciseshows that the inequality from the previous problem is sharp, meaning there areexamples meeting the bound.

Page 43: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

6. Recall Brooks’ Theorem, which says that every graph G has χ(G) ≤ ∆G + 1, whereχ(G) denotes the chromatic number of G and ∆G denotes the largest degree of all thevertices of G. Prove this fact by induction on the number of vertices in G. Do notattempt to prove the more difficult part of Brooks’ Theorem, which says that the onlygraphs satisfying χ(G) = ∆G are complete graphs and odd cycles.

7. Start with a rectangle, and chop it up by drawing straight lines from one point on theboundary to another. If you draw a lot of lines, the rectangle ends up divided into alot of smaller polygons. For example:

Now pretend that the rectangle is a country, and the little polygons are the states.Prove by induction that maps of this type are always properly 2-colorable, meaningthe states can be colored using only two colors so that states with some length ofcommon border are colored differently.

8. In class we proved that every planar graph G has χ(G) ≤ 6. We can actually do better,though the proof is more difficult. Let’s prove that every planar graph has χ(G) ≤ 5.

This fact is obvious if G has 5 or fewer vertices. Suppose it’s true for all planar graphswith n vertices, and consider a planar graph G with n + 1 vertices. We know that Ghas a vertex v of degree at most five. Deleting v leaves a graph with n vertices; byhypothesis, this graph can be colored with at most five colors. Our task is to re-insertv and properly color it with one of the five available colors, which completes the proof.

(a) First suppose v has degree ≤ 4. In this case, the proof is easy. Why?

(b) So suppose v has degree 5. Here are v and the five vertices adjacent to v:

v

A

B

C D

E

Page 44: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

Explain why, under the given hypotheses, the vertices A, B, C, D, and E can’tall be pairwise adjacent to one another.

(c) Therefore, there must be two vertices adjacent to v (without loss of generality,say A and B) that are not adjacent to each other. From here, explain how tocolor G using at most five colors.

(d) Combine the previous parts and write a complete, coherent proof of the result.

22: Recursion1. Find a closed-form solution for the sequence defined recursively by f(1) = 1 andf(n) = 3f(n− 1) for n ≥ 2. Prove your solution works by induction.

2. Find a closed-form solution for the sequence defined recursively by f(1) = 1 andf(n) = 2f(n− 1) + 1 for n ≥ 2. Prove your solution works by induction.

3. Consider the sequence defined by f(1) = 1, f(2) = 0, and for n ≥ 3,

f(n) = 4f(n− 1)− 4f(n− 2).

Prove that f(n) = 2n(1− n

2

)for all n ∈ N.

4. Find a closed-form solution for the sequence defined recursively by f(1) = 0, f(2) = 1,and for n ≥ 3, f(n) = 4f(n− 2). Note: you’ll want to use a piecewise formula.

5. Consider the sequence defined recursively by f(1) = 0, and f(n) = n3 + f(n − 1) forn ≥ 2. Prove by induction that the closed form of this sequence is

f(n) =(n− 1)(n+ 2)(n2 + n+ 2)

4for n ≥ 1.

6. An arithmetic sequence is any sequence f(n) where the difference between any twosuccessive terms is always the same; i.e. f(n) − f(n − 1) = d for some constantd. We call the constant d the common difference of the sequence. For example,4, 7, 10, 13, 17, . . . is an arithmetic sequence with common difference d = 3.

(a) For an arithmetic sequence whose first term is a and whose common difference isd, prove that the nth term is a+ (n− 1)d.

(b) Prove the sum of the first n terms of an arithmetic sequence is n2

[2a+ (n− 1)d].

(c) An arithmetic sequence begins 5, 9, 13, 17, . . .. What is the 100th term of thissequence? Also, what is the sum of the first 100 terms?

7. A geometric sequence is any sequence f(n) where the ratio between any two suc-cessive terms is always the same; i.e. f(n)/f(n− 1) = r for some constant r. We callthe constant r the common ratio of the sequence. For example, 1, 3, 9, 27, 81, . . . is ageometric sequence with common ratio r = 3. More generally, all geometric sequenceshave the shape a, ar, ar2, ar3, . . ., with the nth term being arn−1.

Page 45: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

Assuming r 6= 1 (which is reasonable, because a geometric sequence with r = 1 is justa constant sequence), prove that the sum of the first n terms of a geometric sequenceis

a(1− rn)

1− r.

8. The number Φ =1 +√

5

2is very curious. Among its many properties is the fact that the

geometric sequence 1,Φ,Φ2,Φ3, . . . satisfies the recurrence f(n) = f(n− 1) + f(n− 2).That means every term in the sequence is the sum of the two preceding terms. Establishthis fact.

9. Consider the sequence whose recursive rule is

f(n) =

{f(n− 1)/2 if f(n− 1) is even,3f(n− 1) + 1 if f(n− 1) is odd.

The behavior of this sequence depends upon its initial value f(1).

(a) Investigate the sequence with f(1) = 1. Summarize briefly how the sequencebehaves.

(b) Now use the initial value f(1) = 5. Again, summarize the sequence’s behavior.

(c) Now use the initial value f(1) = 9. Summarize the sequence’s behavior.

(d) Based upon the previous parts, would you care to offer any conjectures about thissequence? Test your conjecture with the initial value f(1) = 27. Have patience(and a calculator) for this one!

10. Let f0(x) = x/(x + 1). For n ∈ N, define fn(x) = f0 ◦ fn−1. In other words, we aredefining a sequence of functions by repeatedly composing f0 with itself. Compute f1,f2, etc., until you spot a pattern (be sure to clean up after each step!). Then, statethe general formula for fn, and prove it works by induction.

11. Repeat the previous problem for f0(x) = 1/(2− x).

23: Divisibility1. Suppose a, b ∈ N with a | b and b | a. What can you conclude about a and b?

2. We proved that the divides relation is a partial order on N. But if we expand ourattention to Z, then “divides” is not a partial order. Why not? Specifically, whichproperty or properties of partial orders (reflexivity, antisymmetry, transitivity) failwhen we put the divides relation on the set Z?

3. Let A = {1, 2, 4, 8, 16, 32, 64, 128, 256}. Draw the Hasse diagram for A, ordered by |.

Page 46: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

4. Many students have trouble remembering how 0 fits in with the divides relation. Oneof the following statements is true, and the other is false. Which is which? Pleasejustify your choices.

(a) 0 | n for all n ∈ Z.(b) n | 0 for all n ∈ Z.

5. Find the unique quotient q and remainder r when a is divided by b:

(a) a = 500, b = 17

(b) a = 17, b = 500

(c) a = 5286, b = 19

(d) a = 19, b = 5286

(e) a = 98764, b = 4789

6. Using the Division Algorithm is a little more tricky when negative numbers are in-volved. Remember that the remainder must satisfy 0 ≤ r < |b|; the absolute valuearound b is important! Find the unique quotient q and remainder r when a is dividedby b:

(a) a = −500, b = 17

(b) a = 500, b = −17

(c) a = −500, b = −17

(d) a = 5286, b = −19

(e) a = −19, b = 5286

7. Fix a natural number b ≥ 2, and define a function f : Z→ Z by mapping each a ∈ Zto the quotient when a is divided by b. That is, f(a) = q, where a = qb + r with0 ≤ r < b.

(a) Is f injective?

(b) Is f surjective?

Explain your answers.

8. Fix a natural number b ≥ 2, and define a function f : Z→ Z by mapping each a ∈ Zto the remainder when a is divided by b. That is, f(a) = r, where a = qb + r with0 ≤ r < b.

(a) Is f injective?

(b) Is f surjective?

Explain your answers.

Page 47: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

9. Find the base 2, base 3, and base 8 representations of the following numbers:

(a) 100

(b) 1024

(c) 4034

10. Let n ∈ Z. Prove that n2 − 2 is never divisible by 4.

11. Suppose a and b are integers that leave the same remainder when divided by somenatural number n. Prove that n | (a− b).

12. Suppose a and b are integers with a > 1. Also suppose a | (11b+ 3) and a | (55b+ 52).Find a.

13. True or false? In each case, provide a proof or a counterexample.

(a) If a | b and c | b, then ac | b.(b) If a | b and a | c, then a | ac.(c) If a | b and c | d, then ac | bd.

14. Write down any six natural numbers. Verify that there is a string of consecutivenumbers in your list (possibly a string of just one number) whose sum is divisible by6. Prove that this must always be the case.

24: The Primes1. Determine whether the following numbers are prime or composite:

(a) 157

(b) 9831

(c) 9833

2. Find the prime factorization of the following numbers:

(a) 856

(b) 2323

(c) (28 − 1)20

3. Prove that, for all n ≥ 1, the number 14n never terminates in a 0.

4. Let A = N− {1} (i.e. A is the set of all natural numbers except 1). Define a functionf : A→ N by mapping each n ∈ N to its largest prime factor.

(a) Find the range of f .

Page 48: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

(b) Is f injective?

(c) Is f surjective?

(d) Why didn’t we define f as a function f : N→ N? Explain.

5. Prove that the sum of two odd primes is never prime. Also, demonstrate that if youremove the word “odd” from the previous sentence, it is no longer true.

6. Let a and b be integers, and let p be a prime. Answer true or false and explain:

(a) If p | a11, then p | a.(b) If p | a and p | (a2 + b2), then p | b.(c) If p | (a9 + a17), then p | a.

7. One of the great achievements of 19th century mathematics was the proof of the PrimeNumber Theorem, which approximates how many prime numbers there are up toany particular value. Let π : N → N denote the prime counting function, where π(n)equals the number of primes ≤ n (here, π is the name of the function, not the familiarconstant). For example, π(5) = 3, because there are three primes ≤ 5, and π(20) = 8,because there are 8 primes less than or equal to 20.

The Prime Number Theorem states that

limn→∞

π(n)

n/ lnn= 1,

meaning that as n increases, the prime counting function π(n) grows roughly as fastas the more-easily-computed function n/ lnn.

(a) Use the Prime Number Theorem to estimate the number of primes less than onethousand, less than one million, and less than one trillion.

(b) Check online for the actual values of π(n) for n = one thousand, one million, andone trillion. Compute the ratios π(n)

n/ lnn, and confirm that they are indeed getting

closer to 1.

8. The main thing about prime numbers that has long fascinated humans is the way theydefy predictability. One consequence of the Prime Number Theorem is that they “thinout” as n increases (graph the function f(x) = x/ lnx if you don’t see why). But thereare infinitely many primes, so they never completely stop appearing as we travel alongthe number line.

But here is one neat trick: for any n ∈ N, it is easy to find a string of n consecutivecomposite integers. For example, consider n = 5. Look at the five numbers startingwith 6! + 2. Note 6! + 2 can’t be prime, because it’s divisible by 2. The next numberis 6! + 3, which isn’t prime because it’s divisible by 3. Similar arguments hold for thenext three consecutive integers.

Page 49: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

Generalize the argument in the preceding paragraph to prove that for any n ∈ N, thereexists a string of n consecutive composite integers.

9. A Mersenne prime is any prime number of the form 2p− 1, where p is itself a primenumber. For example, 7 is a Mersenne prime, because 7 = 23 − 1, as is 31 = 25 − 1.These numbers are named after Father Marin Mersenne (1588 – 1648), who was veryinterested in numbers of the form 2n − 1.

(a) Use high-school algebra to show that 215 − 1 is not prime.

(b) Show that if 2n − 1 is prime, then n itself must be prime.

(c) Show by example that if p is prime, then 2p − 1 may be composite. You mayGoogle this one.

(d) Are there infinitely many Mersenne primes? Nobody knows! This is a famousopen question. As of this writing, the largest known prime number is a Mersenneprime. What is it? Again, Google is OK.

10. Without explicitly listing all the factors, how many distinct factors do the followingnumbers have:

(a) 60

(b) 300

(c) 10100

11. Imagine a hallway with 100 light switches each connected to an overhead lamp. Ini-tially, all the lamps are off. Then, 100 people walk down the hall. The first personflips every switch. The second person flips every second switch (the second, the fourth,etc.). The third person flips every third switch (the third, the sixth, etc.). This con-tinues until all 100 people have walked down the hall. At the end of all this weirdness,which lights are on?

12. The sieve of Eratosthenes is an ancient algorithm for finding prime numbers. Startby listing all the numbers from 2 up to 100 (a 10 × 10 grid works nicely). Circle 2,then cross out every second number after 2 (so cross out 4, 6, etc.). Then circle 3 andcross out every third number after 3. Some of these numbers will already be crossedout; that’s fine. Next circle 5 and cross out every fifth number after 5. And finally,circle 7 and cross out every seventh number after 7. At this point, any number thathasn’t been crossed out is prime, so we’ve found all the primes less than 100.

(a) Why does this work? In particular, after crossing out the multiples of 2, 3, 5, and7, how do you know all the remaining numbers are prime?

(b) If we wanted to find all primes up to, say, 200, would it suffice to cross out onlythe multiples of 2, 3, 5, and 7? Explain.

Page 50: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

13. Application to Programming: Prime numbers appear in a lot of fun recreationalprogramming problems. Here’s a relatively-simple one: Find the sum of all primenumbers less than 10000. One standard approach is to implement a sieve (as in theprevious problem) to find all the prime numbers less than 10000, then sum them. Ifyou are confident in your programming skills, try this one out!

25: The Euclidean Algorithm1. Find gcd(1800, 756).

2. Find integers x and y satisfying 154x+ 260y = 2.

3. Find integers x and y satisfying 7x+ 5y = 17.

4. Suppose a is a nonzero integer.

(a) What’s gcd(a, a)?

(b) What’s gcd(a, 0)?

(c) What’s gcd(0, 0)?

5. If a and b are relatively prime integers, prove that gcd(a+ b, a− b) = 1 or 2.

6. Suppose a, b, and c are integers such that a | bc. Prove that if a and b are relativelyprime, then a | c.

7. Suppose a, b, and c are nonzero integers with a and b relatively prime. Prove thatgcd(a, bc) = gcd(a, c).

8. Let a, b ∈ N with a > b. Prove that gcd(a, a+ b) = gcd(a, b).

9. Use the result of the previous problem to prove that for any n ∈ N, there exists apair of integers (a, b) for which the Euclidean algorithm takes exactly n steps to findgcd(a, b).

10. Prove that if a | c and b | c and a and b are relatively prime, then ab | c.

11. Suppose that p is a prime and a, b ∈ N with gcd(a, p2) = p and gcd(b, p3) = p2, find

(a) gcd(ab, p4)

(b) gcd(a+ b, p4)

12. Let a, b ∈ N. The least common multiple of a and b, denoted lcm(a, b), is the uniquepositive integer satisfying

• lcm(a, b) is a multiple of both a and b, and

• if c is any other number that is a multiple of both a and b, then lcm(a, b) < c.

Page 51: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

Since the definitions of gcd(a, b) and lcm(a, b) are so similar, you might expect analgorithm for computing lcm(a, b) analogous to the Euclidean algorithm. Turns out,you don’t need anything extra other than the following fact:

gcd(a, b) · lcm(a, b) = ab,

which holds for all nonzero integers a, b.

(a) Use the above formula and the Euclidean algorithm to compute lcm(63, 273) andlcm(56, 200).

(b) Prove that gcd(a, b) | lcm(a, b) for all nonzero integers a and b.

(c) Try to prove gcd(a, b) · lcm(a, b) = ab. Probably the quickest way is to deter-mine how the prime factorizations of gcd(a, b) and lcm(a, b) relate to the primefactorizations of a and b.

13. Let A = {1, 2, 3, 4, 5, 6, 7}, and consider the permutation f : A→ A defined by

{(1, 2), (2, 3), (3, 1), (4, 5), (5, 6), (6, 7), (7, 4)}.

If you draw the digraph of f , you’ll quickly see that there are two disjoint cycles, oneof length 3 and the other of length 4.

(a) Recall that fn means f composed with itself n times. Explain why f 12 = ι (theidentity function), and why fn 6= ι for any n < 12.

(b) Explain why f 15 = f 3.

(c) What is the inverse of f 8?

26: Modular Arithmetic1. Find a (mod n) in each of the following cases:

(a) a = 1286, n = 39

(b) a = 43197, n = 333

(c) a = 125, n = 400

2. Carry out the indicated calculations, giving the answer mod n.

(a) 17123 + 12948, n = 6

(b) 17123 · 12948, n = 6

(c) (17123)50, n = 6

(d) 104, 108, 1012, 1020, 1024, n = 7

(e) 4, 42, 43, 44, 45, 46, 47, 48, 49, 410, n = 11

Page 52: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

3. Fix n ≥ 2, and consider the function f : Z → Z defined by f(x) = x2 (mod n). Forexample, with n = 4, we’d have f(3) = 1, because 32 = 9 and 9 (mod 4) = 1. Ourgoal is to find the range of f , for several choices of n.

(a) Even though the domain is Z, we can find the range simply by computing theoutputs for x = 0, 1, . . . , n − 1. Why are these n inputs sufficient to completelydetermine the range?

(b) Find the range when n = 11.

(c) Find the range when n = 12.

(d) Find the range when n = 13.

(e) You may have noticed similar patterns for n = 11 and n = 13, but when n = 12,something slightly different occurs. Why do you think that is? If you think yousee why, state a conjecture and test it for other values of n, then report whatyou’ve discovered.

4. In class we proved that a ≡ b (mod n) if and only if n | (a − b). Use this result toprove the remaining theorems from that same slide. Specifically, suppose a, b, c, andn are integers with n ≥ 2. Prove the following:

(a) If a ≡ b (mod n), then a± c ≡ b± c (mod n).

(b) If a ≡ b (mod n), then ac ≡ bc (mod n).

(c) If a ≡ b (mod n), then ac ≡ bc (mod n), provided c > 0.

It is important to spend some time proving these theorems, because they justify allthe slick tricks of modular arithmetic. The first result (a ≡ b (mod n) if and only ifn | (a− b)) is the key; use it to prove all the others.

5. If a ≡ b (mod n), show that gcd(a, n) = gcd(b, n).

6. Prove that a number is divisible by 11 only if the alternating sum of the number’sdigits is divisible by 11.

7. One of the exercises in Chapter 2 of the Math 127 textbook is to prove the following:If n is even, then n2 − 6n + 5 is odd. Back then, the approach was to let n = 2k,where k ∈ Z, and prove that n2− 6n+ 5 = 2j + 1 for some j ∈ Z. Modular arithmeticstreamlines this argument. Restate the theorem in the language of modular arithmetic,and prove it (it should be a one-line proof).

8. Suppose a, b ∈ Z and 3 | (a2 + b2). Show that 3 | a and 3 | b.

9. In Math 127 you (hopefully) saw a proof that√

2 is irrational. Modular arithmeticonce again provides a much quicker proof. The quicker proof starts the same way: tothe contrary, suppose

√2 = a

b, where a, b ∈ N and a, b have no common factors. Now

use the result of the previous problem to finish the proof.

Page 53: Math 235 Homefun Exercises - WordPress.com · 8/17/2017  · Application to Chemistry: One of the earliest uses of graphs was to enumerate ... Planar Graphs and Euler’s Polyhedron

10. Prove that every prime p ≥ 3 is congruent to 1 or 5 modulo 6.

11. Prove that p2 − 1 is divisible by 24 for all primes p ≥ 5.

12. Application to Information Science: Every book published since roughly 1970has a unique identification number, called an International Standard Book Number,abbreviated ISBN. Originally, these numbers consisted of ten digits, but in 2007 theyexpanded ISBNs to 13 digits. We’ll only discuss ISBN-10.

A major consideration for identification numbers is that people (and machines) canmake mistakes. What if a bookstore orders one thousand copies of a book, but theperson placing the order types in the wrong ISBN? Does the bookstore end up receiv-ing 1000 calculus books instead of 1000 Harry Potter books? That would be tragic!The smart people who designed the ISBN system built in a safeguard against suchcalamities: one of the ten digits in a book number is a check digit that ensures thenumber is a legitimate ISBN. And further, the system is able to detect some commonmistakes, such as mistyping a single digit or transposing (switching the order of) twoadjacent digits.

Here’s how it works. Denote the ten digits by the vector a = (a1, a2, . . . , a10). The firstnine digits are in the range 0− 9. The tenth digit (the check digit) is chosen from therange 0− 10 so that

a1 + 2a2 + 3a3 + · · ·+ 9a9 + 10a10 ≡ 0 (mod 11).

If the calculation forces a10 to equal 10, it is recorded as an X.

(a) If the first nine digits of an ISBN-10 are 093603103, what will the check digit be?

(b) If a single digit of an ISBN-10 is copied incorrectly, a computer can easily detectthat a mistake has been made. For example, a popular discrete math textbook’sISBN-10 is 0130920002. Explain why, if any single digit of this ISBN is changed,an error will be detected.

(c) Show by examples that if two digits are changed in an ISBN-10, the errors mayor may not be detected. You can use the ISBN from the previous part.

(d) Another common mistake when a number is copied is a transposition error, mean-ing two consecutive digits are accidentally switched (for example, typing 1426instead of 1246). Show that the ISBN-10 system can detect transposition errors.Hint: Let a = a1 + 2a2 + · · ·+ kak + (k+ 1)ak+1 + · · ·+ 10a10 be a correct ISBN.Let b be the same number with the digits ak and ak+1 transposed. Consider a− b.