Indicate the option which most accurately completes the sentence.

Similar documents
CPS 102: Discrete Mathematics. Quiz 3 Date: Wednesday November 30, Instructor: Bruce Maggs NAME: Prob # Score. Total 60

γ(ɛ) (a, b) (a, d) (d, a) (a, b) (c, d) (d, d) (e, e) (e, a) (e, e) (a) Draw a picture of G.

STUDENT NUMBER: MATH Final Exam. Lakehead University. April 13, Dr. Adam Van Tuyl

MC 302 GRAPH THEORY 10/1/13 Solutions to HW #2 50 points + 6 XC points

Practice Final. Read all the problems first before start working on any of them, so you can manage your time wisely

DO NOT RE-DISTRIBUTE THIS SOLUTION FILE

Discrete Structures. Fall Homework3

Figure 4.1: The evolution of a rooted tree.

Discrete Mathematics Exam File Fall Exam #1

Fall Recursion and induction. Stephen Brookes. Lecture 4

CSE 20 DISCRETE MATH. Winter

Notebook Assignments

Solution : a) C(18, 1)C(325, 1) = 5850 b) C(18, 1) + C(325, 1) = 343

1KOd17RMoURxjn2 CSE 20 DISCRETE MATH Fall

2. CONNECTIVITY Connectivity

Math 454 Final Exam, Fall 2005

CMPSCI 250: Introduction to Computation. Lecture #22: Graphs, Paths, and Trees David Mix Barrington 12 March 2014

CS1800 Discrete Structures Fall 2016 Profs. Aslam, Gold, Ossowski, Pavlu, & Sprague December 16, CS1800 Discrete Structures Final

CS1800 Discrete Structures Final Version A

Computer Science 280 Fall 2002 Homework 10 Solutions

Lecture 22 Tuesday, April 10

MATH 139 W12 Review 1 Checklist 1. Exam Checklist. 1. Introduction to Predicates and Quantified Statements (chapters ).

Prelim One Solution. CS211 Fall Name. NetID

CSE 20 DISCRETE MATH. Fall

Assignment 4 Solutions of graph problems

Proof Techniques Alphabets, Strings, and Languages. Foundations of Computer Science Theory

CS1800 Discrete Structures Final Version B

CS1800 Discrete Structures Fall 2016 Profs. Aslam, Gold, Ossowski, Pavlu, & Sprague December 16, CS1800 Discrete Structures Final

Definition: A graph G = (V, E) is called a tree if G is connected and acyclic. The following theorem captures many important facts about trees.

r=1 The Binomial Theorem. 4 MA095/98G Revision

Discrete Mathematics for CS Spring 2008 David Wagner Note 13. An Introduction to Graphs

University of Illinois at Chicago Department of Computer Science. Final Examination. CS 151 Mathematical Foundations of Computer Science Fall 2012

ASSIGNMENT 4 SOLUTIONS

Exam 1 February 3, 2015

CHAPTER 2. Graphs. 1. Introduction to Graphs and Graph Isomorphism

CSE505, Fall 2012, Midterm Examination October 30, 2012

Computer Science 236 Fall Nov. 11, 2010

It is important that you show your work. There are 134 points available on this test.

CS473-Algorithms I. Lecture 13-A. Graphs. Cevdet Aykanat - Bilkent University Computer Engineering Department

(a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are rational they can be written as the ratio of integers a 1

Notes for Recitation 8

Solutions to Quiz 1. (a) (3 points) Vertices x and y are in the same connected component. Solution. P (x, y)

CSE 331: Introduction to Algorithm Analysis and Design Graphs

Math 221 Final Exam Review

4 Basics of Trees. Petr Hliněný, FI MU Brno 1 FI: MA010: Trees and Forests

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao,David Tse Note 8

MC302 GRAPH THEORY SOLUTIONS TO HOMEWORK #1 9/19/13 68 points + 6 extra credit points

Induction and Recursion. CMPS/MATH 2170: Discrete Mathematics

CS 373: Combinatorial Algorithms, Spring 1999

Solutions to In-Class Problems Week 4, Fri

Discrete mathematics

Cardinality Lectures

We will show that the height of a RB tree on n vertices is approximately 2*log n. In class I presented a simple structural proof of this claim:

COT 3100 Spring 2010 Midterm 2

THE UNIVERSITY OF MANITOBA

Description of grading scheme and advice for final exam (and HW, quizzes, etc).

Lamé s Theorem. Strings. Recursively Defined Sets and Structures. Recursively Defined Sets and Structures

CSE 505, Fall 2008, Midterm Examination 29 October Please do not turn the page until everyone is ready.

1 Algorithm and Proof for Minimum Vertex Coloring

5 Graphs

Integers and Mathematical Induction

Math 485, Graph Theory: Homework #3

Discrete mathematics , Fall Instructor: prof. János Pach

Answers to specimen paper questions. Most of the answers below go into rather more detail than is really needed. Please let me know of any mistakes.

Reference Sheet for CO142.2 Discrete Mathematics II

Graphs and Isomorphisms

Module 11. Directed Graphs. Contents

Foundations of Computer Science Spring Mathematical Preliminaries

Recursive Definitions Structural Induction Recursive Algorithms

Math 187 Sample Test II Questions

Triangle Congruence Packet #3

Prelim 2. CS 2110, November 20, 2014, 7:30 PM Extra Total Question True/False Short Answer

Graph Theory Part Two

Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1

Section Summary. Introduction to Trees Rooted Trees Trees as Models Properties of Trees

CS 350 Final Algorithms and Complexity. It is recommended that you read through the exam before you begin. Answer all questions in the space provided.

1 Variations of the Traveling Salesman Problem

CS 2336 Discrete Mathematics

CSE 373 Autumn 2010: Midterm #1 (closed book, closed notes, NO calculators allowed)

Ma/CS 6b Class 13: Counting Spanning Trees

Graphs and trees come up everywhere. We can view the internet as a graph (in many ways) Web search views web pages as a graph

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Midterm 1

11.9 Connectivity Connected Components. mcs 2015/5/18 1:43 page 419 #427

Recursive definition of sets and structural induction

Lecture 6: Graph Properties

U.C. Berkeley CS170 : Algorithms, Fall 2013 Midterm 1 Professor: Satish Rao October 10, Midterm 1 Solutions

Lecture 10: Strongly Connected Components, Biconnected Graphs

Recursion defining an object (or function, algorithm, etc.) in terms of itself. Recursion can be used to define sequences

Chapter 11: Graphs and Trees. March 23, 2008

These are not polished as solutions, but ought to give a correct idea of solutions that work. Note that most problems have multiple good solutions.

Lecture 20 : Trees DRAFT

1. Suppose you are given a magic black box that somehow answers the following decision problem in polynomial time:

Lecture 2 : Counting X-trees

Do not turn this page until you have received the signal to start. In the meantime, please read the instructions below carefully.

Math236 Discrete Maths with Applications

Recursively Defined Functions

Chapter Summary. Mathematical Induction Recursive Definitions Structural Induction Recursive Algorithms

In this lecture, we ll look at applications of duality to three problems:

Elements of Graph Theory

UCSD CSE 101 MIDTERM 1, Winter 2008

Transcription:

Discrete Structures, CSCI 246, Fall 2015 Final, Dec. 10 Indicate the option which most accurately completes the sentence. 1. Say that Discrete(x) means that x is a discrete structures exam and Well(x) mean that I did well on exam x. Which best describes the statement x (Well(x) Discrete(x)) (3 pts.) a. I do well whenever it is a discrete structures exam b. All exams are discrete structures exams and I do well on them c. If I did well on the exam then it was a discrete structures exam d. I did well on the exam only if it was a discrete structures exam e. None of the above 2. Let R be a relation on the set of all web pages where (a, b) R if and only if there is at least one common link on web page a and web page b. Which best describes the relation R? (3 pts.) a. reflexive b. symmetric c. transitive d. reflexive and symmetric e. none of the above 3. Which best describes what is mean by an undirected graph G being k-vertexconnected. (3 pts.) a. The graph remains connected after any k-1 vertices are removed from the graph b. The graph remains connected after any k vertices are removed from the graph c. The graph is no longer connected when any k-1 vertices are removed from the graph d. The graph is no longer connected when any k vertices are removed from the graph e. None of the above 4. An equivalent way of writing p q is (3 pts.) a. q p b. p q c. p q d. p q e. All of the above 5. The function f(x) = x 2-9 on the real numbers is (3 pts.) a. is a bijection b. is 1-1 but is not onto c. is onto but is not 1-1 d. is not 1-1 and is not onto e. is not a function 1

6. How many functions are there from a five-element set {a, b, c, d, e} to the two element set {t, f}. Please give a numeric answer and show your work. 2 5 =32 Five positions, two choices for each 7. There are 17 questions on this exam (don t count the extra credit). Say that you get 15 of these questions correct and two wrong. How many patterns of 15 correct and 2 incorrect are possible? Please give a numeric answer and show your work. C(17, 15) = C(17, 2) = 136 ways 8. How many strings of four decimal digits do not contain the same digit twice? Please give a numeric answer and show your work. 10*9*8*7 = 5,040 strings 9. What is the coefficient of x 7 in (2-x) 10? Giving a formula for the answer is sufficient. You do not need to arrive at a final numerical answer. The term will be C(10,7) * 2 10-3 * (-x) 7, so the coefficient will be C(10,7)*2 7 *(-1) 7 = 120 * 128 * -1 = - 15,360 2

10. Is the relation = { (a, b) a and b have the same parents} an equivalence relation? Why or why not? It is an equivalence relation because it is reflexive (a person has the same parents as itself), symmetric (if a and b have the same parents then b and a have the same parents) and transitive (if a and b have the same parents, and b and c have the same parents, then a and c have the same parents) 11. Draw a picture of G+ for the digraph: 12. Give the spanning tree of the following graph when starting at vertex A and doing a depth-first search. 3

13. Let W(x) be the statement x is working properly and A(x) be the statement x has access to the world wide web where the domain consists of all computers. Express the following in English. x(w(x) A(x)) There is a computer which, if it is working properly, does not have access to the world wide web. This is tricky 14. Tell if the following proof is valid. If the proof is not valid carefully explain why not. Every postage of three cents or more can be formed using just three-cent and fourcent stamps. Basis step: We can form postage of three cents with a single three-cent stamp and we can form postage of four cents using a single four-cent stamp. Inductive step: Assume that we can form postage of j cents for all nonnegative integers j with j k using just three-cent and four-cent stamps. We can then form postage of k+1 cents by replacing one three-cent stamp with a four-cent stamp or by replacing two four-cent stamps by three three-cent stamps. This proof is not valid. This proof says that every postage of thee cents or more can be formed using just three-cent and four-cent stamps, however, 5 cannot be formed using just 3 cent and 4 cent stamps. The problem with the proof is that there are not necessarily two four-cent stamps to remove. This might be better as an extra credit problem but it is a very easy extra credit. 4

15. A computer network consists of six computes. Each computer is directly connected to at least one of the other computers. Show that there are at least two computers in the network that are directly connected to the same number of other computers. (10 pts.) Let the boxes of the Pigeonhole Principle be the number of connection a computer has, that is, the number of other computers the computer is connected to. Since each computer must be connected to at least one other computer, the possibilities are 1, 2, 3, 4, or 5 connections. Since there are 6 computers (pigeons), and only 5 possible connection numbers (boxes), the Pigeonhole Principle tells us that two computers must have the same number of connections. 5

16. Prove the theorem of unique paths in trees. Theorem: There is a unique path between every pair of vertices in a tree. (10 pts.) This will be proved by contradiction. Suppose, by way of contradiction, that the proof is not true. Then there is not a unique path between every pair of vertices. It must be true that either there is not a path, or the path is not unique. Case 1: There is not a path between two sets of vertices. This is impossible because trees are connected. Thus this is not the case. Case 2: The path between a pair of vertices is not unique. Then there must be at least two paths between a pair of vertices. This would create a circuit. Since trees do not contain circuits, there cannot be two of more paths between a pair of vertices. Since both cases create a contradiction, the proof must be true. 6

17. Following is a recursive algorithm for finding the product of the first n positive integers. int recproduct(n) { if (n<=1) return 1; else return n * recproduct(n-1); } Use mathematical induction to prove that the recursive algorithm is correct. Note that more partial credit will be given if you define a shortcut P(n), tell what you are going to prove, tell how you are going to prove it, prove the statement stating all assumptions clearly, and end with a statement that you have proved what you intended to prove. (20 pts.) Let P(n): recproduct(n) returns Prove P(n) for n 1. n i=1 This will be proven using mathematical induction Proof: Basis: Show that P(1) holds. Statement Reason 1. recproduct(1) returns 1 See code (Definition of recproduct) n 2. " returns i=1 i Property or definition of product Induction: Assume P(n) holds for n 1 Show P(n+1) holds i Statement 1. recproduct(n+1) returns (n+1) * recproduct(n) n 2. " returns (n+1) * i i=1 Reason Definition ofrecproduct Inductive hypothesis n+1 3. " returns i=1 i Definition of product Thus by the Principle of Mathematical induction, P(n) holds for n 1. 7

Extra Credit 18. Prove that a forest with c components and n vertices has n-c edges. Assume n c. (Hint: the base case will have n=c.) This will be proven using mathematical induction. Let P(n) stand for the statement: In a forest with c components and n vertices, # edges = n-c Prove that P(n) holds for n c Basis: Show P(n) for n=c. A forest with c components and n vertices, where n=c, is simply n isolated vertices. Since all vertices are isolated, there are no edges. Thus #edges = 0 = n-n = c-n Induction: Assume P(n) for n c Show P(n+1). We are assuming P(n), that in a forest with c components and n vertices, # edges = n-c We need to show P(n+1), that in a forest with c components and n+1 vertices, # edges = (n+1)-c Consider a forest with c components and n+1 vertices. I want to remove one vertex from this forest. There are two possibilities: Case 1: If there is an isolated vertex, remove it. Case 2: If there is no isolated vertex, all trees have at least 2 vertices. Remove a leaf from one of the trees. In case 1, an isolated vertex was removed, creating a smaller tree with one less component (since the isolated vertex was itself a component) and one less vertex. By the induction hypothesis: # edges in smaller tree = ((n+1)-1) - (c-1) Since no edges were removed when creating the smaller tree, the number of edges in the original tree will be the same as the number of edges in the smaller tree. Thus, # edges in original tree = ((n+1)-1) - (c-1) = n (c-1) =(n+1) c 8

In case 2, a leaf was removed from one of the trees, causing both a vertex and an edge to be removed. This created a smaller tree with one less edge and the same number of components. By the induction hypothesis: # edges in smaller tree = ((n+1)-1) - c Since one edge was removed when creating the smaller tree, the number of edges in the original tree will be one more than the number of edges in the smaller tree. Thus, # edges in original tree = 1+ ((n+1)-1) - c = (n+1) c Thus, by the Principle of Mathematical Induction, P(n) holds for n c. 9