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 myers@cs.utexas.edu 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
2/29/2016
Setsymbolsofsettheory(,U,cfw_,.)
Home > Math > Mathsymbols >Setsymbols
SetTheorySymbols
Listofsetsymbolsofsettheoryandprobability.
Tableofsettheorysymbols
Symbol
Meaning/
definition
SymbolName
Example
set
acollectionofelements
A=cfw_3,7,9,14,
B=
Proving Set Identities
July 14, 2009
Let
X
be the universe. Prove that
A (B \ A) = A B .
By the Set Dierence Law, we have that A (B \ A) = A (B Acfw_ ). By the Commutative Law, we obtain
A (Acfw_ B). By the Distributive Law, we obtain (A Acfw_ ) (A B). By
SET THEORETIC PROOFS & IDENTITIES
Useful Definitions
For A, B subsets of universal set U:
xA B
xA B
xAB
x AC
(x, y) A B
Subset Proofs: A
To Prove:
xAxB
xAxB
xAxB
xA
xAyB
A
B
B
Proof:
Suppose x A. [x is a particular but arbitrarily chosen element of A]
ded
Chapter 4
Set Theory
A set is a Many that allows itself to be thought of as a One.
(Georg Cantor)
In the previous chapters, we have often encountered sets, for example,
prime numbers form a set, domains in predicate logic form sets as well.
Defining a set
Math 2534 Homework 6 (proofs sec. 4.6 (3.6)
Prove the following or give a counterexample. Put all work on another sheet. Do not use ink.
Problem 1: Proof by contrapositive: ( p q q p )
Theorem: For all integers n, If 5n3+ 4 is even, then n is even.
Proof