464
Test Bank Questions and Answers
TEST BANK
Questions for Chapter 1
What is the negation of the propositions in 13? 1. Abby has more than 300 friends on facebook. 2. A messaging package for a cell phone costs less than $20 per month. 3. 4.5 + 2.5 = 6 In
Sample Tests
405
Sample Tests
This section of the Instructor's Guide contains sample tests for an introductory course in discrete mathematics. Two tests are included for each chapter of the text. The problems on these tests were used on examinations given
CS 40
Lecture 8: PERFORMANCE
You Are Not Alone
Just go on and faith will return.
JeanBaptiste le Rond dAlembert
About infinitesimals
aka dx and dy
They are a little suspect, arent
they?
The Pessimist View
Nobody knows anything.
Not one person in t
CS 40
Lecture 4: SETS
Challenge
How many ways to break up a candy
bar into 1/4 size pieces?
Like
etc.
,
,
Same as dividing measure into
quarter notes
Like
etc.
Getting Tired of This?
Synonyms
Antonyms
(Harder)
(Easier)
Factor out
Plug in
Parameterize
H
CS 40
Lecture 7: Bigo notation
Feedback
Selfexamination
Turings halting proof
Plugging output back to input
Collatz sequence
Recursion
Fibonacci sequence
With Numbers
The doubling
machine
Exponential
growth
Blows up
Like an amplifier
x
2x
2x
W
CS 40
Lecture 3: PREDICATES
Roz Chast
1979 The New Yorker
Challenge
Let C(n) = the number of expressions
that contain balanced parentheses
()
()()
()()()
()()
So C(3) is 5
Find C(n) for n = 4, 5, 6
()()
Propositional Logic
Makes claims about specific
CS 40
Lecture 9: Induction
Most Common Mistake
1.1.14c
you get an A on the final
p:
r: you get an A in the class
get an A in the class, you must
To
get an A on the final
pr pr
Which is it?
The Sad Truth
To get an A in the class, you must get an A on
CS 40
Lecture 10: Induction 2
no!
Subset of V V
Whats it to you?
An unordered bunch of ordered pairs.
A mapping of V V cfw_0, 1
cfw_(1,1), (2,1), (3,2)
i.e. f : (a,b) cfw_0, 1
A matrix of cfw_T, F
?
0
1
2
3
0
F
T
F
T
1
T
F
T
F
2
F
T
F
T
3
T
F
T
F
Prof. Du
University of California, Santa Barbara
CMPSC 40 SPRING 2016, MIDTERM EXAM
B
Tuesday, May 3, 2016, 11:0012:15
This exam has 25 questions for a total of 50 points. SHOW YOUR WORK.
NAME:
0 1
]
o
3
z
2
4
o
5
2
A
2
6
r
z
7
\ [
8
9
10
_
7
u
o
12
X
~\
;
CS 40: Final Examination
Department of Computer Science University of California, Santa Barbara ClosedBook, 3 hours Winter 2011
Instructions
Before you answer any questions, print your name and perm number. Read each question carefully. Make sure that y
38
Chapter 2
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
CHAPTER 2 Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
SECTION 2.1 Sets
2. There are of course an infinite number of correct answers. a) cfw_ 3n  n = 0, 1,
Cs 40
Lecture 2: equivalences
Gahan Wilson
1997 The New Yorker
Thats equivalent to twentyone in dog years, pal.
Who Are We?
Lecturer: Andrew Duncan
Office hours: TBD
[email protected]
TA: Nataly Moreno
Office hours: TBD
TA: Can Kizilkale
Office hour
CS 40
Lecture 5: FUNCTIONS & COuntINg
Functions
Remember the
function
machine?
Rule that
assigns a
unique result
(image) to an
input value
Formalities
We will (usually) call our input set A
Output set is B
f maps (all of) A to B
f:AB
a A, b B, f(a)
CS 40 Winter 2017
Page 6
1 of 6
7
Practice Midterm
Name _
Perm # _
1. Explain in words why p q is the negation of the exclusive or.
Halfcredit for a truth table or a derivation.
2. Give an example of the following kinds of sets.
a) Countably infinite
b)
4v>
CS Ho
i
KUA
I.L1 CS\ V'crf"' O. DfOOOi
1
WOTO prpo s/hin cs ftlvs
K
&)
\e
pfDpoSiHW)
(Vor~
1

T"\
l.H'0 (or
l
<v
\Xr&
"Thex oe
4 ml
c
4
Aor" fnW.)
CQVe
nor
i
'vefuj
(5 o oi
G
'*
" )
fU/m ~.
16/
"fas /f"7
r>or
'N
pAfccr 50g
'JsC
np T>rct
K;
Name
Page 1 of 6
Real Midterm
CS 40 Winter 2017
Perm #
1. Give three English sentences that express p > q. For example, If
p, then q. (Of course now you cannot use that one.)
t'P
p irr\plici
p fs
Purnor p
2. For the expression p > q, write (in sym
1.1 Propositional Logic
Definition 1:
Let p be a proposition. The negation of p is denoted by , is the statement: It is not the case that p. The
proposition is read not p. The truth value of the negation of p, , is the opposite of the truth value of p.
De
CS 40 Winter 2017
Practice Final
Name _
Page 5
1 of 5
6
Perm # _
1. Let S = cfw_Adam, Bree, Chris, Diane They are going to do pairprogramming. How many different pairs can you choose?
2. You are issuing license plates with five characters, each taken from
CS 40 Winter 2017
Real Final Solutions
Name _
1.
Page 8
1 of 8
8
Perm # _
Match the synonyms between left and right columns.
Discrete
Continuous
Uncountable
Factor out
Hardcode
Discreet
Careful
Countable
Parameterize
Plug in
2. Prove that at a party wher
CS 40
Lecture 6: Growth
Discrete = Countable
Synonyms
Antonyms
Discrete
Continuous
Countable
Uncountable
Algebra
Calculus
(Analysis)
Finite Always Countable
1
4
5
3
2
Size = 5
Countably Infinite
Yes: theyre what we use to count!
Do we say that + is count
Section 1.1
Propositional Logic
1
CHAPTER 1 The Foundations: Logic and Proofs
SECTION 1.1 Propositional Logic
2. Propositions must have clearly defined truth values, so a proposition must be a declarative sentence with no free variables. a) This is not a
CS 20
Final Exam
Fall 2008
Analysis
Recursion
Binary Search Trees
BST Implementation
Heaps
Heap Implementation
Sorting
Hash Tables
General
/15
/25
/25
/20
/20
/20
/11
/30
/70
Total
/236
Analysis:
(15) Derive the bigO notation of the following snippets of
University of California, Santa Barbara
CMPSC 40 SUMMER 2009
HOMEWORK ASSIGNMENT III
Due 9:30 am, Monday August 24 in CS 40 HW box in 2108 HFH or the beginnging of lecture.
Solve the following problems. The sections refer to Discrete Mathematics and Its A
University of California, Santa Barbara
CMPSC 40 SUMMER 2009
HOMEWORK ASSIGNMENT II
Due 9:30 am, Monday August 17 in CS 40 HW box in 2108 HFH or the beginnging of lecture.
Solve the following problems. The sections refer to Discrete Mathematics and Its Ap
University of California, Santa Barbara
CMPSC 40 SUMMER 2009
HOMEWORK ASSIGNMENT I
Due 9:30 am, Monday August 10 in CS 40 HW box in 2108 HFH.
Solve the following problems. The sections refer to Discrete Mathematics and Its Applications, Kenneth H. Rosen,
University of California, Santa Barbara
CMPSC 40 SUMMER 2009 QUIZ V
NAME: 1. Let an denote the number of regions into which the plane is divided when we draw n ovals so that any two intersect in exactly two points and no three intersect at a point. (a) Wr
University of California, Santa Barbara
CMPSC 40 SUMMER 2009 QUIZ IV
NAME: 1. Suppose b is a positive integer. What is a pseudoprime to the base b?
Denition 1, page 240 of the text.
2. Let fn be the nth Fibonacci number. Show by induction on n that for n
University of California, Santa Barbara
CMPSC 40 SUMMER 2009 QUIZ III
NAME:
1. Suppose b is a positive integer. What is a pseudoprime to the base b?
Denition 1, page 240 of the text.
2. Suppose we are doing arithmetic with octal (base 8) numbers. Is the f