Sie sind auf Seite 1von 6

IST 230 Spring 2016 Chapter 1-13 Final Exam (Show/Explain all Work for non True/False questions)

DUE Friday, April 29, 2016 11:59 P.M. ET


Chapter 1
1.
a.

State in English the converse of If it is raining, then my lawn is wet. (5 points)


If my lawn is wet, then it is raining.

b.

State in English the contrapositive of If it is raining, then my lawn is wet. (5 points)


If my lawn is not wet, then it is not raining.

Let the domain of discourse be the set of people in our IST 230 class. Define the following
predicate:
S(x): x is less than five feet tall.
Translate the following English statement into a logical expression with the same meaning.
(5 points)
It is not the case that someone in our class is at least five feet tall.
c.

x S(x)

Chapter 2
2. True or False: If A = {1, 2, 3} and B = {Turtle, Wax}, then (1, 2) is an element of AxB (where x indicates
the cross product). (5 points)
False.

IST 230 Spring 2016 Chapter 1-13 Final Exam (Show/Explain all Work for non True/False questions)
DUE Friday, April 29, 2016 11:59 P.M. ET
Chapter 3
3a. Let the function f from the positive integers to the positive integers be defined by f(x) = x*x (where *
is ordinary integer multiplication). Explain why f is or is not onto. (5 points)
The function f is not onto, because the not all elements of the positive integers are mapped to by f. In
particular, 5 is a positive integer that is not mapped to by f; that is, there is no natural number whose
square is 5.
3b. Let sets A and B be defined as follows: A = {a1} and B = {b1, b2}. List as set(s) of ordered pairs all the
functions from A to B (each such function should be listed as one set of ordered pairs), and explain
whether any function from A to B is onto. (5 points)
f1 = {(a1,b1)}
f2 = {(a1,b2)}
There are no onto functions from A to B, because above are all the functions from A to B, and none of
them is onto, because for each of them there is some element in B that does not get mapped to by the
function.
3c. Let A = {a1, a2} and B = {b1, b2, b3}. Let the function f:A B be given by the following set of ordered
pairs: f = {(a1,b2),(a2,b3)}. (10 points)
List as a set of ordered pairs a function g: BA with the property that for all a in A g(f(a)) = a, and show
that this property holds. Note that since the domain of g is B, you need to make sure your function g
maps each element in B to some element in A.
One such function is g = { (b1,a1), (b2,a1,), (b3,a2) }.
Chapter 5
5. Let the set A be defined as A = {a, b, c, d}, and let the relation R on the set A be defined by
R = { (d, a), (a, b), (a, a), (b, c) }.
Explain why R is or is not symmetric, and why R is or is not reflexive. (Don't confuse the two!) (5 points)
R is not symmetric because there exist some x,y in A such that xRy but not yRx. Specicially, take b,c in A;
then bRc but it is not the case that cRb.
R is not reflexive because it is not the case that for all x in A we have xRx; specifically, R does not contain
(b,b).

IST 230 Spring 2016 Chapter 1-13 Final Exam (Show/Explain all Work for non True/False questions)
DUE Friday, April 29, 2016 11:59 P.M. ET

IST 230 Spring 2016 Chapter 1-13 Final Exam (Show/Explain all Work for non True/False questions)
DUE Friday, April 29, 2016 11:59 P.M. ET
Chapter 6
6. What is the value of the variable count after all the loops in the following pseudocode execute? (5
points)
count:=0
For i= 1 to 2
For j=1 to 2
count:=2j(count-1)
End-for
End-for
count = 0 to start
i=1
j=1
j=2

count = 2*1*(0-1) = -2
count = 2*2*(-2-1) = -12

i=2
j=1
j=2

count = 2*1*(-12-1) = -26


count = 2*2*(-26 -1) = -108

The value of the variable count after all the loops in the above pseudocode execute is -108.

Chapter 7
7. Find the next three terms (terms a 2, a3, a4) of the sequence defined as follows
a1 = 0
ak = 3 + 2ak-1 for k >= 2
(5 points)
a2 = 3 + 2(a1) = 3 + 2(0) = 3 + 0 = 3
a3 = 3 + 2(a2) = 3 + 2(3) = 3 + 6 = 9
a4 = 3 + 2(a3) = 3 + 2(9) = 3 + 18 = 21

IST 230 Spring 2016 Chapter 1-13 Final Exam (Show/Explain all Work for non True/False questions)
DUE Friday, April 29, 2016 11:59 P.M. ET
Chapter 8
8a. Show calculations and determine how many digits are needed to represent the base 5 expansion of
4096 (where 4096 is in base 10). Then write the base 5 expansion of 4096. (5 points)
The number of digits to represent the base 5 expansion of 4096 (in base 10) is ceil(log 5(4096+1)) =
ceil(log5 4097) = 6.
The base 5 expansion of 4096 (base 10) is 112341 5.
8b. Explain why a multiplicative inverse of 7 mod 13 does or does not exist. If one does exist, calculate it,
and explain why there is or is not only one such multiplicative inverse. If one does not exist, explain why
not. (5 points)
A multiplicative inverse of 7 mod 13, is an integer s such that s*7 mod 13 = 1. One such integer is 2, since
2*7 mod 13 = 14 mod 13 = 1. Restricting possible values of s to just the ring Z 13, the multiplicative
inverse of 7 mod 13 is unique, by the fact that 7 and 13 are relatively prime and by the claim in the
zyBook text following Definition 8.4.1 (that the number (s mod n) is the unique multiplicative inverse of x
in Zn).
Chapter 9
9. A husband and wife and their two children line up for a photo. How many ways are there for these
four people to line up so that the husband and wife are next to each other? (10 points)
The number of ways for the wedding party to line up so that the bride is next to the groom is 12.
H W C1 C2
H W C2 C1
W H C1 C2
W H C2 C1
C1 H W C2
C2 H W C1
C1 W H C2
C2 W H C1
C1 C2 H W
C2 C1 H W
C1 C2 W H
C2 C1 W H

Chapter 11
11. An experiment is performed to flip a fair coin 10 times and observe the outcome of each flip: heads
(labeled 'H') or tails (labeled 'T'). For instance, one outcome, written as a 10-tuple, might be
(H,T,T,T,T,T,T,H,H,H). What is the probability of obtaining an outcome that has exactly one heads? (10
points)
10/1024.

IST 230 Spring 2016 Chapter 1-13 Final Exam (Show/Explain all Work for non True/False questions)
DUE Friday, April 29, 2016 11:59 P.M. ET

Chapter 12
12. Let vertex sets V1 and V2 be defined by V1= {1, 2, 3} and V2 = {a, b, c}. Let E1 = { { 1, 2}, {2, 3} }, and
let E2 = { {a, b}, {b, c} } be the edge sets corresponding to the vertex sets V1 and V2, respectively. Write
a function f:V1V2 as a set of ordered pairs that is a bijection from V1 to V2. (10 points)
f = { (1,a), (2,b), (3,c) }

Chapter 13
13. Let V = {a, b, c, d, e} be a vertex set and E = { {a,b}, {b,c}, {c,d}, {d,e}, {e,c}} be the edge set
corresponding to V. (5 points)
True or False: The pair (V, E) is a tree. (Hint: draw it and see what it looks like.)
False

Das könnte Ihnen auch gefallen