Name_ Sample Exam 1 CS 336
General Instructions: Do all of your work on these pages. If you need more space, use the backs (to ensure the grader sees it, make a note of it on the front). Make sure your name appears on every page. Please write large a
Sample Exam 1 CS 336
General Instructions: Do all of your work on these pages. If you need more space, use the backs (to ensure the grader sees it, make a note of it on the front). Make sure your name appears on every page. Please write legibly and show y
Exam #2
Put your name on every page you hand in, and show all your work. Note:
all graphs are nite without self-loops and without parallel edges.
1. For the graphs given on the board, let V denote the vertex set, let E
denote the edge set, and so the grap
Exam 3, CS 336
April 16, 2012
Solutions by Tandy Warnow
1. Give the formula for n choose k, written as C (n, k ).
Solution:
n!
(nk)!k!
2. Evaluate C (10, 8).
Solution:
10!
8!2!
= 90/2 = 45
3. Let P (n, k ) denote the number of ways you can select k people
Exam 3, CS 336
April 16, 2012
NOTE: For problems 5-7, provide at least some English explanation of how you
obtain your answers to each question.
all graphs are nite and simple (no self-loops or multiple edges).
G = (V, E ) denotes a graph with vertex se
CS 336 Analysis of Programs - Fall 2012
Homework #2 Solutions
o
o
CS 336 Analysis of Programs - Fall 2012
o
cfw_x + | x 2 > 5
o
cfw_ f : | a s.t. f ( a ) = a
o
cfw_ f : | x0 s.t. f ( x0 ) = x0 and x , x x0 f ( x) x
o
cfw_ S | x S , 2
o
cfw_S R | x > 100
CS 336 Analysis of Programs - Spring 2012
Homework #3 Solutions
Problem 1.
This problem is similar to the version of the rock game, the difference being that the players
have one more option, namely to remove two rocks from the same pile. Instead of const
CS 336 Analysis of Programs - Fall 2012
Homework #4 Solutions
Problem 1.
(a) Let A = [ a1 , a 2 ,., a m ] and B = [ b1 , b2 ,., bn ]. Let Ai [a1 , a 2 ,., ai ] (the array containing
the first i elements of A) and B j [b1 , b2 ,., b j ] (the array containi
CS 336 Analysis of Programs - Fall 2012
Homework #5 Solutions
Problem 32, page 330.
We will prove that 3 | n 3 2n, n * by induction.
Basis Step. For n=1, 3 | 3 13 2 1 .
Inductive Step. Assume 3 | n 3 2n for some n * . We will prove that 3 | (n 1) 3 2(n 1)
Homework #7
March 23, 2012
Problem 1
y B, x A s.t. f (x) = y
x A s.t. f (x) = x
x A, y B, f (x) = y <=> g (y ) = x
S X, |S | = 1
S1 , S2 X, S1 S2 = S1 S2 S2 S1
Problem 2
Y
Y
Y
Y
= cfw_S X | |cfw_x S |x > 0| = |cfw_x S |x < 0|
= cfw_S X | s S, s 0
= cfw_S
Homework #8
March 24, 2012
Problem 1
We will prove that a graph with maximum degree at most d can be properly
vertex-colored using d + 1 colors by induction on the number of vertices in
the graph. (We will hold d constant.)
Basis Step. A graph with a sin
CS 336 Analysis of Programs - Fall 2012
Exam #1 Solutions
1. Let T(n) be a function defined for n = 1, 2, , by
T(1) = 7
T(n) = 3 T(n-1) + 1
Prove that T (n) 3 n for all integers n 1 , using induction.
Solution.
We will prove that T (n) 3 n for all integer
CS 336
Homework 1 Solutions
1. Section 1.1, 12: Let P: You have the u, Q: You miss the nal exam, R: You pass the
course
Express each of the following propositions as an English sentence.
a) P Q
If you have the u, then you will miss the nal exam.
b) q r
No
CS336
Homework Assignment 2 Solutions
Section 2.2
2. A = set of sophomores in your school, B = set of students in discrete math at your school.
Let the Universe U = the set of all students at your school
a) The set of sophomores taking discrete math at yo
Sample Exam 1CS 336
General Instructions: Do all of your work on these pages. If you need more space, use the backs (to ensure the grader sees it, make a note of it on the front). Make sure your name appears on every page. Please write legibly and show yo
8/24/10
Whatwellcover
CS 336
Lecture1
Theoperation Reviewofpredicates
ThePeople
Instructor: Dr. Maggie Myers [email protected] Office hours: TTH, and extra hours as announced Office: Aces 2.112 Phone: 471-9533 TAs:
ThePeople
Reza Mahjourian Gabriel E
CS336
Homework Assignment 8 Solutions
Section 8.1, 6
a) Let sn be the number of such sequences. Any string ending in n must be a string ending
in some value less than n, followed by n. So
sn = sn1 + sn2 + . + s1 .
b) s1 = 1
c) sn = 2n2 for n 2.
Section 8.
CS 336 - homework 8
Staple the pages of your solution set together, and put your name and EID on the top of
the rst page. Answer each question clearly. The logic you use to produce your answers is
the most important thing.
1. Let binary relation R on set
CS336
Homework Assignment 7 Solutions
1. 6.2, 4.
A bowl contains 10 red balls and 10 blue balls. A woman selects balls at random
without looking at them.
a) How many balls must she select to be sure of having at least 3 balls of the same
color?
The colors
CS336
Homework Assignment 6 Solutions
1. For each of the following sets, determine if it is nite, countably innite, or uncountable.
Prove your answer, using the denitions given in class (not in the book).
(a) The set of integers greater than 10: A = cfw_1
CS336
Homework Assignment 5 Solutions
Section 2.3
4.
Domain is listed rst, followed by range
a) N, cfw_0, 1, ., 9
b) Z+ , Z2
c) cfw_0, 1, N
d) cfw_0, 1, N
6.
a) Z+ Z+ , Z+
b) Z+ , Z+
c) cfw_0, 1, Z
d) Z+ , Z+
e) cfw_0, 1, cfw_1
12a-c.
For each function f
CS336
Homework Assignment 3 Solutions
Section 1.5
20. U = Z, N (x) : x is negative, P (x) : x is positive
a) xy [N (x) N (y ) P (xy )]
b) xy [P (x) P (y ) P ( x+y ]
2
c) xy [N (x) N (y ) N (x y )]
d) xy [|x + y | |x| + |y |]
36 abd
a) U = all people, P(x)
Homework #9
March 24, 2012
Problem 1
(a) 22N , since X has cardinality 2N .
(b) 22N 1
(c) 2N +1 1
Let M be the set of men and W be the set of women. We know that
|M | = |W | = N , so the number of subsets that are entirely men is 2N . Similarly, the numbe
Homework #13
April 11, 2012
Problem 1
C (n, k ) =
n!
k!(nk)!
Problem 2
C (10, 8) =
10!
8!(108)!
=
10!
8!2!
=
910
2
= 9 5 = 45
Problem 3
cfw_x, y A, (x, y ) E
Problem 4
S = cfw_A V |cfw_x, y A, (x, y ) E
1
Problem 5
X = cfw_x R|3 < x 5 or 9 < x
Problem
Homework #14, Solutions by Andrei Margea
April 27, 2012
Problem 4, Page 432
In the rst day, the student can pick a sandwich of any of the 6 types,
i.e. the student has 6 options. For each option he picks in his/her rst day,
the student has 6 options in th
CmSc 175 Discrete Mathematics
Lesson 11: SETS IDENTITIES
Using the operation unions, intersection and complement we can build expressions over
sets.
Example:
A - set of all black objects
B - set of all cats
A B - set of all black cats
The set identities a
ICS 141: Discrete Mathematics I (Fall 2014)
1.7 Introduction to Proofs
A proof is a valid argument that establishes the truth of a statement.
Types of Proofs
Trivial proof: Prove q by itself
Vacuous proof: Prove p by itself
Direct proof: Assume p is tr
i
WELCOME
Discrete Mathematics consists of material from this booklet, Lecture Notes, and from the
booklet, Tutorials and Practice Classes: Questions. Each of the 24 sections in these notes is
approximately equivalent to one lecture and you should aim to
Logic and proof
Basic proof styles - suggested problems - solutions
All of the proofs below dont require any specific knowledge in a particular area, other than some
basic facts about numbers:
An even integer can be expressed in the form 2k, where k is a