Chapter 2 Sections 3 & 4
Section 2.3
8.
e. 3
f. -2
g. 1
h. 2
12.
a. True
b. True
c. False
d. True
36.
f(g) = (x+2)2 + 1
g(f) = (x2 + 1) + 2
= x2+4x+5
= x2 + 3
Section 2.4
4
a. an = -2n
cfw_1, -2, 4, -8
b. an = 3
cfw_3
c. an = 7 + 4n
cfw_8, 11, 23, 71
d. a
52
1 [The Foundations: Logic and Proofs
enrolled (s, c) to represent that professor p is the instructor of course c and that student 5
is enrolled in course c, respectively. For example, the Prolog facts in such a program might
include: '
instructor(cha
Section 1.1
1. (4 points) Construct a truth table for the following compound proposition.
(p q) (p q)
Section 1.2
2. (4 points) Let p be it is cold and let q be it is raining. Translate the following sentences into
propositional logic.
a)
b)
c)
d)
It is n
Applications of
Propositional Logic
Section 1.2
Applications of Propositional Logic:
Summary
Translating English to Propositional Logic
System Specifications
Boolean Searching
Logic Puzzles
Logic Circuits
Translating English Sentences
Steps to convert an
Section: 12.3 Logic gates:
Problem# 2: Find the output of the given circuit
x
( x y ) = x +
x y
x
y
y
y
Problme #4:
x y z
x
X
( x y z ) = x+ y + z
y
( x+ y + z ) ( x + y+ z )
z
x
x
x + y+ z
y
z
z
Problem # 6: Construct Circuits from inverters, AND gates,
Section 11.1:
Problem 4: Answer these questions about the rooted tree
illustrated.
(4a). Which vertex is the root?
Solution: a is the root.
(4b). Which vertices are the internal?
Solution: b, d, e, g, h, I, o are internal vertices.
(4c). Which vertices ar
Counting
SECTION 6.1: The Basics of Counting
problem 8:
How mant different three-letter initials with none of letters repeated can people have?
Solution:
The three different letters can be made without replacement using product rule is;
26 25 24 = 15600 w
Chapter 1: Logic and Proof
problem 18: chapter 1.1
Determine whether each of these conditional statement is True or False.
(18a). If 1 + 1 = 3, then unicorn exists. - Is True statement.
(18b). If 1 + 1 = 3, then dogs can fly.- Is True statement.
(18c). If
Chapter 3:Alogorathums
problem 6: chapter 3.1
Describe an alogorithm that takes as input a list of n integers and finds the number of negative
integers in the list.
Let (b1 , b2 , b3 , , bn ) be the list of n integers and k be the number of negative integ
FUNCTIONS
problem 8: chapter 2.3
Find these values.
8e).d2.99e
Solution: d2.99e = 3
8f ).d2.99e
solution:d2.99e = 2
8g).b 12 + d 21 ec
Solution:b 12 + d 12 ec = b 12 + 1c
b1.5c = 1
8h).db 21 c + d 12 e + 12 e
Solution: db 21 c + d 12 e + 12 e = d0 + 1 + 0
COT3103 Chapter 1 Written
1. (4 points)
a)
p
q
q
p q
pq
(p q) (p q)
T
T
F
F
F
F
T
F
T
T
T
T
F
T
F
T
T
T
F
F
T
T
F
T
2. (4 points)
a) p
b) p q
c) p q
d) p q
3. (8 points)
p
q
pq
(p q)
pq
T
T
F
T
T
T
F
T
F
F
F
T
T
F
F
F
F
F
T
T
Compare the 4rd and 5th colum
Questions 1 and 2 refer to this graph:
Note: This is the same graph from the Chapter 11 homework assignment, but on the final exam
we are considering vertex B to be the root of the spanning tree.
1 (7 points) Using alphabetical ordering with vertex B as r
6.
Procedure negatives(list n)
int a=0
int i = 1
while (i < n)
cfw_
if i < 0
a+;
i+;
return a (total number of negative values in the list)
34.
First pass:
6
2
3
1
5
4
2
6
3
1
5
4
2
3
6
1
5
4
Second Pass:
2
3
1
5
4
6
2
1
3
5
4
6
Third Pass:
2
1
3
4
5
6
1
Chapter 2
Korinne Martin
Section 1
20.
a. 0
b. 2
c. 1
d. 3
42.
b. x Z (x + 1 > x) True
For some elements of x which are elements of Z (the set of numbers that are integers), x
plus 1 is greater than x. This can be proved by using x = 0. 0 + 1 > 0
d. x Z (
Section 1.1
18
a.
b.
c.
d.
F
F
F
T
32
c.
p
T
q
T
pq
T
p (p q)
F
T
F
F
T
T
T
F
T
F
F
F
F
d.
p
T
T
F
F
q
T
F
T
F
pq
T
T
T
F
pq
T
F
F
F
(p q) (p q)
T
F
F
F
Section1.2
8
a. The user has paid the subscription fee, but does not enter a valid password
(p r)
b. A
Chapter 2 Section 2.5 2.6
2.5
2.
a. countably infinite
b. countably infinite
c. finite
d. uncountable
e. countably infinite
2.6
4
a.
-1
0
1
1
1
-2
0
0
0
4
-7
4
-1
-5
0
-7
8
7
b.
10
a.
b.
c.
d.
e.
f.
Defined; 3x5
Undefined
Defined; 3x4
Undefined
Undefined
Chapter 4 Section 1 & 2
S 4.1
22
a. -2, 87
b. -99, 0
c. 10, 309
d. 122,122, 1,334
28
a. Yes, 3 * 10 = 30 + 7(mod) = 37
b. No, 3 * 22 = 66 + 0(mod) = 66; not congruent
c. No, 3 * -7 = -21 + 4(mod) = -17, not congruent
d. No, 3 * -23 = -69 + 2(mod) = -67; n
Final Exam Computational Analysis
1) A 2) A
/ / \
B B F
/ / \
D D G
/ \ |
F H H
/ / \
C C E
/
E
Theron Lord
3) Using pigeonhole method, there are 5 boxes (A-F), every 5 students fills each box.
Therefore, 4 * 5 = 20