1.
Section 2.3
The validity of the argument foilows from the results in the last row. (The rst seven rows
may be ignored.)
The validity of the argument follows from the results in rows 1, 2, and 5 of the table. The
results in the other ve rows may b
Discrete Mathematics for Computing
Fall 2014
Chapter 5: Relations and Functions
= cfw_0, 1, 2, 3, : Set of nonnegative integers
+ = cfw_1, 2, 3, : Set of positive integers
= cfw_ , 3, 2, 1,0, 1, 2, 3, : Set of all integers
= cfw_ | , : Set of all rati
9.
10.
11.
CHAPTER 3
SET THEORY
Section 3.1
They are all the same set.
All of the statements are true except for part (f).
All of the statements are true except for parts (1) and (d).
All of the statements are true except for parts (a) and (b).
(a) cfw_0,
MATH 190
Fall 2014
Textbook: R. Grimaldi, Discrete and Combinatorial Mathematics: An
Applied Introduction, Pearson. Fifth Edition
Weeks 5 & 6
Chapter 3: Set Theory
Dear Students,
In order to better understand and improve your skills in the topics covered
MATH 190
Fall 2014
Textbook: R. Grimaldi, Discrete and Combinatorial Mathematics: An
Applied Introduction, Pearson. Fifth Edition
Weeks 7 & 8
Chapter 4: Properties of the Integers: Mathematical Induction
Dear Students,
In order to better understand and im
Answers
1. Basic Properties of Modular Arithmetic
Exercise 1:
a. = 10
b. = 8
c. = 0
d. = 9
e. = 6
f. = 11
Exercise 2:
a. = 15
b. = 7
c. = 140
Exercise 3: 76, 51, 26, 1, 24, 49, 74, 99.
Exercise 4:
a. No
b. No
c. Yes
d. No
Exercise 5:
a. 13
b. 6
Exercise 6
CSCE 411: Design and Analysis of Algorithms
Exam 1
October 15, 2014
Name:
Instructions:
1. This is a closed book exam. Do not use any notes or books, other than your own 8.5-by-11
inch review sheet (double-sided is OK). Do not confer with any other person
CSCE 411
Design and Analysis
of Algorithms
Set 11: NP-Completeness
Prof. Jennifer Welch
Fall 2016
CSCE 411, Fall 2016: Set 11
1
Polynomial Time Algorithms
Most of the algorithms we have seen
so far run in time that is upper
bounded by a polynomial in the
.
.
Set 7: Induction and
Recursion
CSCE 222-200: Discrete Structures for Computing,
Honors
Jennifer L. Welch
Department of Computer Science & Engineering
Texas A&M University
Spring 2015
Spring 2015
CSCE 222-200: Set 7: Induction and Recursion
1/
101
1/10
CSCE 411
Design and Analysis
of Algorithms
Set 9: Randomized Algorithms
Prof. Jennifer Welch
Fall 2016
CSCE 411, Fall 2016: Set 9
1
Quick Review of Probability
Refer to Chapter 5 and Appendix C of the textbook
sample space
event
probability distribution
i
CSCE 411: Design and Analysis of Algorithms
Notes on Max Flow
Fall 2016
(Based on the presentation in Chapter 26 of Introduction to Algorithms, 3rd Ed. by Cormen,
Leiserson, Rivest and Stein.)
1
Motivation and Basic Definitions
Consider applications that
CSCE 411
Design and Analysis
of Algorithms
Set 12: Undecidability
Prof. Jennifer Welch
Fall 2016
CSCE 411, Fall 2016: Set 12
1
Sources
Theory of Computing, A Gentle
Introduction, by E. Kinber and C.
Smith, Prentice-Hall, 2001
Automata Theory, Languages an
CSCE 411
Design and Analysis
of Algorithms
Set 10: Lower Bounds
Prof. Jennifer Welch
Fall 2016
CSCE 411, Fall 2016: Set 10
1
What is a Lower Bound?
Provides information about the best possible
efficiency of ANY algorithm for a problem
Tells us whether we
CSCE 411: Design and Analysis of Algorithms
Expected Running Time of Randomized Quicksort
Fall 2016
Reference: Our textbook (Cormen, Leiserson, Rivest and Stein, Introduction to Algorithms, 3rd Ed.)
The running time of quicksort is proportional to the num
CSCE 411-200, Fall 2016
Homework 4 Solutions
Problem 1: Exercise 17.4-3 (p. 471): Suppose that instead of contracting a table by halving its size when
its load factor drops below 1/4, we contract it by multiplying its size by 2/3 when its load factor drop
CSCE 411: Design and Analysis of Algorithms
Optimality of Huffmans Algorithm
October 19, 2016
This proof is a little different than the one in the textbook (pp. 433435) and is drawn from Algorithms
from P to NP, Vol. 1, Moret and Shapiro, Benjamin/Cumming
(1 pt) Briefly explain the main idea of the aggregate method of amortized analysis?
Brute Force Analysis
(1 pt) Briefly explain the main idea of the accounting method of amortized analysis?
assign costs to each operation so that it is easy to sum them up
CPSC 211 Data Structures & Implementations
(c) Texas A&M University [ 221]
Trees
Important terminology:
root
edge
node
parent
child
leaf
Some uses of trees:
model arithmetic expressions and other expressions
to be parsed
model game-theory approaches to so
CSCE 411-200, Fall 2016
Homework 2 Solutions
Problem 1: Here is an attempt at a decrease-and-conquer algorithm to determine if an undirected graph G
with n vertices is connected. Assume G is represented using an n-by-n adjacency matrix A, with columns
ind
CSCE 411-200, Fall 2016
Homework 6 Solutions
Problem 1: Draw the decision tree for bubble-sort with n = 3. Use the code for bubble-sort on page 40 of
the textbook.
Bubblesort(A) / A.length = n
for i = 1 to n - 1
for j = n downto i + 1
if A[j] < A[j-1]
exc
CSCE 411-200, Fall 2016
Homework 1 Solutions
Problem 1: Suppose you are given an n n boolean matrix, which is the adjacency matrix representation
of an undirected graph with n vertices. Design a brute force / exhaustive search algorithm that determines
wh
CSCE 411-200, Fall 2016
Homework 3 Solutions
Problem 1: Transform the following word problem into a linear program. Farmer Fred has 10 acres of land,
on which he can grow cotton and soybean. For tax purposes, he needs to farm at least 7 acres. He has $120
CSCE 629: Design and Analysis of Algorithms
Amortized Analysis of Dynamic Table
Spring 2017
(Based on Introduction to Algorithms, 2nd and 3rd Eds., by Cormen, Leiserson, Rivest and Stein.)
1
Problem Definition
Here is a more extensive example of amortized
CSCE 411-200, Fall 2016
Homework 5 Solutions
Problem 1: Exercise 24.3-8 (p. 664): Let G = (V, E) be a weighted, directed graph with nonnegative
weight function w : E cfw_0, 1, . . . , W for some nonegative integer W . Modify Dijkstras algorithm to
comput
In order to count the number of paths of some fixed length k in a graph between all
pairs of vertices, we can use the transform and conquer paradigm. What problem do
we transform to?
Sol: Adjacency matrix A to the kth power gives number of paths of length
CSCE 411
Design and Analysis of Algorithms
Andreas Klappenecker
Motivation
In 2004, a mysterious billboard showed up
- in the Silicon Valley, CA
- in Cambridge, MA
- in Seattle, WA
- in Austin, TX
and perhaps a few other places.
Remarkably, the puzzle on
Divide and Conquer
Andreas Klappenecker
The Divide and Conquer Paradigm
The divide and conquer paradigm is important general technique
for designing algorithms. In general, it follows the steps:
- divide the problem into subproblems
- recursively solve t
The Fast Fourier Transform
Andreas Klappenecker
!
Motivation
There are few algorithms that had more impact on modern society
than the fast Fourier transform and its relatives.
The applications of the fast Fourier transform touch nearly every
area of scie