Mathematics for Algorithm and System Analysis


Similar documents
1.1 Logical Form and Logical Equivalence 1

Foundations of Logic and Mathematics

STAT 360 Probability and Statistics. Fall 2012

WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology

Edward A. Bender S. Gill Williamson


Discrete Mathematics Problems

Discrete Mathematics. Hans Cuypers. October 11, 2007

2. (a) Explain the strassen s matrix multiplication. (b) Write deletion algorithm, of Binary search tree. [8+8]

Catalan Numbers. Thomas A. Dowling, Department of Mathematics, Ohio State Uni- versity.

Data Structure [Question Bank]

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Alabama Department of Postsecondary Education

Answer: (a) Since we cannot repeat men on the committee, and the order we select them in does not matter, ( )

1. Nondeterministically guess a solution (called a certificate) 2. Check whether the solution solves the problem (called verification)

MATH BOOK OF PROBLEMS SERIES. New from Pearson Custom Publishing!

Institute of Actuaries of India Subject CT3 Probability and Mathematical Statistics

Chapter 2: Systems of Linear Equations and Matrices:

Why? A central concept in Computer Science. Algorithms are ubiquitous.

Lecture 16 : Relations and Functions DRAFT

Current Standard: Mathematical Concepts and Applications Shape, Space, and Measurement- Primary

Discrete Mathematics & Mathematical Reasoning Chapter 10: Graphs

Midterm Practice Problems


Functions CHAPTER 2. Introduction. 2.1 Some Basic Terminology. Terminology for Sets

Algebra I Credit Recovery

2.3 Scheduling jobs on identical parallel machines

Social Media Mining. Graph Essentials

Utah Core Curriculum for Mathematics

V. Adamchik 1. Graph Theory. Victor Adamchik. Fall of 2005

Math 1050 Khan Academy Extra Credit Algebra Assignment

Sequence of Mathematics Courses

Cartesian Products and Relations


Mathematics (MAT) MAT 061 Basic Euclidean Geometry 3 Hours. MAT 051 Pre-Algebra 4 Hours

In mathematics you don t understand things. You just get used to them. (Attributed to John von Neumann)

096 Professional Readiness Examination (Mathematics)

A 2-factor in which each cycle has long length in claw-free graphs

Fundamental Computer Science Concepts Sequence TCSU CSCI SEQ A

Outline. NP-completeness. When is a problem easy? When is a problem hard? Today. Euler Circuits

Sets and Cardinality Notes for C. F. Miller

Graph Theory Problems and Solutions

Complexity Classes P and NP

College Algebra. Barnett, Raymond A., Michael R. Ziegler, and Karl E. Byleen. College Algebra, 8th edition, McGraw-Hill, 2008, ISBN:

Chapter 3. Distribution Problems. 3.1 The idea of a distribution The twenty-fold way


A Course in Discrete Structures. Rafael Pass Wei-Lung Dustin Tseng

Exponential time algorithms for graph coloring

Lecture 15 An Arithmetic Circuit Lowerbound and Flows in Graphs

Handout #Ch7 San Skulrattanakulchai Gustavus Adolphus College Dec 6, Chapter 7: Digraphs


MTH304: Honors Algebra II

Thnkwell s Homeschool Precalculus Course Lesson Plan: 36 weeks

Expression. Variable Equation Polynomial Monomial Add. Area. Volume Surface Space Length Width. Probability. Chance Random Likely Possibility Odds

Overview of Math Standards

Discrete Math for Computer Science Students

Home Page. Data Structures. Title Page. Page 1 of 24. Go Back. Full Screen. Close. Quit

Florida Math for College Readiness



BookTOC.txt. 1. Functions, Graphs, and Models. Algebra Toolbox. Sets. The Real Numbers. Inequalities and Intervals on the Real Number Line

Tree-representation of set families and applications to combinatorial decompositions



Induction Problems. Tom Davis November 7, 2005

10. Graph Matrices Incidence Matrix

Just the Factors, Ma am

Binary Search Trees CMPSC 122

An Introduction to Combinatorics and Graph Theory. David Guichard

Introduction to Algorithms. Part 3: P, NP Hard Problems

SIMS 255 Foundations of Software Design. Complexity and NP-completeness

Mathematical Induction. Lecture 10-11

Guessing Game: NP-Complete?

Exam study sheet for CS2711. List of topics

The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge,


1 A duality between descents and connectivity.

Small Maximal Independent Sets and Faster Exact Graph Coloring

Curriculum Map Statistics and Probability Honors (348) Saugus High School Saugus Public Schools

Lecture 17 : Equivalence and Order Relations DRAFT

Induction. Margaret M. Fleck. 10 October These notes cover mathematical induction and recursive definition

Sets, Relations and Functions

Complexity Theory. IE 661: Scheduling Theory Fall 2003 Satyaki Ghosh Dastidar

Examination paper for MA0301 Elementær diskret matematikk

ML for the Working Programmer

DRAFT. Algebra 1 EOC Item Specifications

On the k-path cover problem for cacti

Lecture 7: NP-Complete Problems

Many algorithms, particularly divide and conquer algorithms, have time complexities which are naturally

Spring 2007 Math 510 Hints for practice problems

Zachary Monaco Georgia College Olympic Coloring: Go For The Gold

Master of Arts in Mathematics

Graphs without proper subgraphs of minimum degree 3 and short cycles

MyMathLab ecourse for Developmental Mathematics

This unit will lay the groundwork for later units where the students will extend this knowledge to quadratic and exponential functions.

L - Standard Letter Grade P - Pass/No Pass Repeatability: N - Course may not be repeated

The Language of Mathematics

PES Institute of Technology-BSC QUESTION BANK



Mathematics for Algorithm and System Analysis for students of computer and computational science Edward A. Bender S. Gill Williamson c Edward A. Bender & S. Gill Williamson 2005. All rights reserved.

Preface Discrete mathematics is an essential tool in almost all subareas of computer science. Interesting and challenging problems in discrete mathematics arise in programming languages, computer architecture, networking, distributed systems, database systems, AI, theoretical computer science, and other areas. The course. The University of California, San Diego, has a lower-division two-quarter course sequence in discrete mathematics that includes Boolean arithmetic, combinatorics, elementary logic, induction, graph theory and finite probability. These courses are core undergraduate requirements for majors in Computer Science, Computer Engineering, and Mathematics-Computer Science. This text, Mathematics for Algorithm and System Analysis, was developed for the second quarter and A Short Course in Discrete Mathematics was developed for the first quarter. Because some students transfer into the second quarter of the course without having taken the first quarter, there is some overlap between the two texts and, with appropriate students, this text could be used without the first. This book consists of four units of study (Counting and Listing CL; Functions Fn; Decision Trees and Recursion DT; and Basic Concepts of Graph Theory GT), each divided into four sections. Each section contains a representative selection of problems. These vary from basic to more difficult, including proofs for study by mathematics students or honors students. The first three sections in units CL and Fn are primarily a review of material in A Short Course in Discrete Mathematics needed for this course. The review questions. Multiple Choice Questions for Review appear at the end of each unit. The explanatory material in this book is directed towards giving students the mathematical language and sophistication to recognize and articulate the ideas behind these questions and to answer questions that are similar in concept and difficulty. Many variations of these questions have been successfully worked on exams by most beginning students using this book at UCSD. Students who master the ideas and mathematical language needed to understand these review questions gain the ability to formulate, in the neutral language of mathematics, problems that arise in various applications of computer science. This skill greatly facilitates their ability to discuss problems in discrete mathematics with other computer scientists and with mathematicians. iii

Table of Contents Asterisks (stars) are used in the text to mark more difficult material that is not needed in later sections. Unit CL: Basic Counting and Listing Section 1: Lists with Repetitions...CL-1 set, list, multiset, sequence, word, permutation, k-set, k-list, k-multiset, k-lists with repetition, rule of product, Cartesian product, lexicographic order (lex order), dictionary order, rule of sum, composition of a positive integer Section 2: Lists Without Repetition..... CL-9 k-lists without repetition, Stirling s formula for approximating n!, circular arrangements, words from a collection of letters Section 3: Sets......CL-13 set intersection, set union, set difference, set complement, symmetric difference, set product (Cartesian product), binomial coefficients, generating functions, binomial theorem, full house (card hand), two pairs (card hand), rearranging words, multinomial coefficients, card hands and multinomial coefficients, recursions, set partitions, Stirling numbers of the second kind (S(n, k)), straight (card hand), Bell numbers B n Section 4: Probability and Basic Counting....CL-28 sample space, selections done uniformly at random, event, probability function, combining events, Venn diagrams, odds, hypergeometric probabilities, fair dice, geometric probability, principle of inclusion exclusion, birthday problem Multiple Choice Questions for Review... CL-41 Unit Fn: Functions Section 1: Some Basic Terminology... Fn-1 direct product, intersection, union, symmetric difference, domain, range, codomain, one-line notation, surjection, onto, injection, one-to-one, bijection, permutation, relation, functional relation, two-line notation Section 2: Permutations...Fn-7 composition, cycle, cycle form of permutation, involution, permutation matrices, derangements v

Section 3: Other Combinatorial Aspects of Functions.....Fn-14 image, inverse image, coimage, image size and Stirling numbers, strictly increasing, strictly decreasing, weakly increasing, weakly decreasing, monotone, multisets, lists without repetition, restricted growth functions and partitions Section 4: Functions and Probability... Fn-21 random variable, probability function, event, probability distribution function, expectation, covariance, variance, standard deviation, correlation, independent events, independent random variables, product spaces, generating random permutations, joint distribution function, marginal distributions, binomial distribution, Poisson distribution, normal distribution, standard normal distribution, cumulative distribution, central limit theorem, normal approximation to binomial, Poisson approximation to binomial, Tchebycheff s inequality Multiple Choice Questions for Review.....Fn-41 Unit DT: Decision Trees and Recursion vi Section 1: Basic Concepts of Decision Trees....DT-1 decision trees, vertices, root, edges, degree of vertex, down degree, child, parent, leaves, internal vertex, height of leaf, path to vertex, traversals of decision tree, depth first vertices, depth first edges, breadth first, preorder, postorder, lengthfirst lex order, dictionary order, permutations in lex order, partial permutation, rank of leaf, direct insertion order for permutations, backtracking, Latin squares, domino coverings, strictly decreasing functions, unlabeled balls into boxes, isomorph rejection Section 2: Recursive Algorithms.... DT-15 recursive algorithm, simplest case reduction, recursive algorithm for 0-1 sequences, sorting by recursive merging, recursive approach, recursive solutions, local description for permutations in lex order, recursive description of Towers of Hanoi, decision tree for Towers of Hanoi, recursion and stacks, configuration analysis of Towers of Hanoi, abandoned leaves and RANK, characteristic functions and subsets, Gray code for subsets, decision tree for Gray code for subsets, local description of Gray code, Towers of Hanoi with four poles Section 3: Decision Trees and Conditional Probability.....DT-27 conditional probability, independent events, Venn diagrams, probabilities of leaves, probabilities of edges, probabilistic decision trees, decision trees and Bayesian methods, Bayes theorem, multiplication theorem for conditional probabilities, sequential sampling, the SAT problem, first moment method, tournaments, gambler s ruin problem Section 4: Inductive Proofs and Recursive Equations... DT-40 induction, recursive equations, induction hypothesis, inductive step, base case, prime factorization, sum of first n integers, local description, recurrence relation,

binomial coefficients C(n, k), Stirling numbers S(n, k), guessing solutions to recurrences, linear two term recurrence, constant coefficients, characteristic equation, two real roots, one real root, complex roots, recursion for derangements, Fibonacci recurrence relation, recurrence relation for derangements Multiple Choice Questions for Review.....DT-52 Unit GT: Basic Concepts in Graph Theory Section 1: What is a Graph?....GT-1 computer network example, simple graph, graph, vertices, edges, set theoretic description of graph, pictorial description of a graph, incidence function, vertices joined by an edge, adjacent vertices, edge incident on a vertex, simple graphs are graphs, form of a graph, equivalence relations, equivalence classes, blocks, binary relations, reflexive, symmetric, transitive, equivalent forms, isomorphism of graphs, graph isomorphism as an equivalence relation, degree of a vertex, loops, parallel edges, isolated vertices, degree sequences and isomorphism, random graphs Section 2: Digraphs, Paths, and Subgraphs.... GT-13 flow of commodities, directed graph, digraph, simple digraph, simple graphs as simple digraphs, directed loops, digraphs and binary relations, symmetric binary relations and simple graphs with loops, complete simple graphs, path, trail, walk, vertex sequence, walk implies path, restrictions of incidence functions, subgraphs, subgraph induced by edges, subgraph induced by vertices, cycles, connected graphs, connected components and equivalence classes, connectivity in digraphs, Eulerian trail, Eulerian circuit, Hamiltonian cycle, Hamiltonian graph, bicomponents of graphs, bipartite graphs, oriented simple graphs, antisymmetry, order relations, Hasse diagrams, covering relations, counting trees Section 3: Trees.......GT-24 tree, alternative definitions of a tree, rooted graph, rooted tree, parent, child, sibling, leaf, internal vertices, unique paths in trees, rooted plane tree, RP-tree, traversing RP-trees, depth first sequences, breadth first sequences, spanning trees, minimum spanning trees, greedy algorithms, Prim s algorithm, Kruskal s algorithm, lineal or depth-first spanning trees, algorithm for depth-first spanning trees, bipartite graphs and depth first spanning trees, degree sequences of trees, binary trees, full binary trees, height and leaf restrictions in binary trees Section 4: Rates of Growth and Analysis of Algorithms... GT-37 comparing algorithms, machine independence, example of finding the maximum, Θ notation, O notation, properties of Θ and O, Θ as an equivalence relation, sufficiently large, eventually positive, asymptotic, little oh notation, using Θ to compare polynomial evaluation algorithms, average running time, tractable, intractable, graph coloring problem, traveling salesman problem, clique problem, N P-complete problems, NP-hard, NP-easy, chromatic number of a graph, almost good algorithms, almost correct algorithms, close algorithms, polynomial time, exponential time, Θ and series, Θ and logs vii

Multiple Choice Questions for Review.....GT-51 Solutions to Exercises Notation Index Subject Index viii