Вы находитесь на странице: 1из 17

No.

Ex
Page
Solution
1
8
17
a) If you have the flu, you will miss the final examination.
b) You will pass the course if and only if you dont miss the final examination.
c) If you miss the final examination, you will not pass the course.
d) You have the flu or you miss the final examination or you pass the course.
e) If you have the flu, you will not pass the course or if you miss the final examination, you
will not pass the course.
f) You have the flu and you miss the final examination, or you dont miss the final
examination and you pass the course.
2
10
17
a)
b)
c)
d)
e)
f)

r q
p q r.
r p.
p ( q ) r .
(p q) r.
r ( p q).
3
12
17

a)
b)
c)
d)

True
False
True
False
4
22
18

You get an A in this course if and only if you learn how to solve discrete mathematics problems.

You will be informed if and only if you read the newspaper every day.

It rains if and only it is a weekend day.You can see the wizard if and only if he is not in.

5
26
19
a) 4 rows
b) 8 rows
c) 64 rows
d) 32 rows
6
28
19
a)
p
0
0
1
1

p
1
1
0
0

p p
1
1
0
0

p
0
0
1
1

p
1
1
0
0

p p
0
0
0
0

b)

c)
p

(p q)

0
0
1
1

0
1
0
1

0
1
1
1

(p

q)
0
1
0
0

d)

e)

( p q)

( p q)

0
0
1
1

0
1
0
1

0
0
0
1

0
1
1
1

( p q ) ( p q)
1
1
1
1

q p
)

( p q)

0
0
1
1

0
1
0
1

1
1
0
0

1
1
1
0

1
0
0
1

( p q)

( p q)

0
0
1
1

0
1
0
1

1
0
1
0

(q p)( p q)
1
0
0
0

f)

1
0
0
1

( p q ) ( p q)

0
1
1
0

1
1
1
1

7
30
19
a)
p

p p

0
0
1
1

0
0
0
0

b)
p

0
0
1
1

1
1
0
0

p
1
1
1
1

c)
p

p q

0
0
1
1

0
1
0
1

1
0
1
0

1
0
0
1

d)
p

p q

p q

0
0
1
1

0
1
0
1

1
1
0
0

1
0
1
0

0
1
1
0

e)
p

pq

p q

0
0
1
1

0
1
0
1

0
1
1
0

1
0
0
1

pq

p q

0
0
1
1

0
1
0
1

0
1
1
0

1
0
0
1

( p q)( p q)
1
1
1
1

f)

( p q)( p q)
0
0
0
0

8
6
28

p q

0
0
1
1

0
1
0
1

1
1
0
0

1
0
1
0

p q

( p q)

p q

0
0
0
1

1
1
1
0

1
1
1
0

9
8
28
a) Kwame will not take a job industry and will not go to graduate school which simplifies to
Kwame will not take a job industry nor go to graduate school.
b) Yoshiko does not know Java or does not know calculus.
c) James is not young or is not strong, which simplifies to James is old or weak.
d) Rita will not move to Oregon and will not move to Washington.

10
18
29

p
0
1
0
1

q
1
0
0
1

NAND
1
1
1
p 0 q

p q

0
0
1
1

1
1
0
0

0
1
0
1

q p

p q

1
0
1
0

1
1
0
1

1
1
0
1

11
20
29

0
0
1
1

0
1
0
1

pq

( p q)

0
1
1
0

1
0
0
1

pq
1
0
0
1

12
22
29

( p q ) ( p r )
( p q ) ( p r ) expression for implication
p ( q r ) distributivelaw
p ( q r ) expression for implication

a)

p q

b)

p(q ( r F ) )

c)

( p q) (q T )

13
34
29

14
46
29

p
0
1
0
1

NOR
0
0
1
0

1
0
0
1

15
48
29
16
8
47
a)
b)
c)
d)

If an animal is a rabbit, then that animals hops.


Every animal is a rabbit and hops.
There exists such an animal that if it is a rabbit then it hops.
There exists one animal that is a rabbit and it hops.

17
12
47
a.
b.
c.
d.
e.
f.

True
True
False
True
False
True
g. False
18
30
48
a.
b.
c.
d.

P(1,3) P(2,3) P(3,3)


P(1,1) P(1,2) P(1,3)
~(P(2,1) P(2,2) P(2,3))
~(P(1,2) P(2,2) P(3,2))
19
26
61

a)
b)
c)
d)
e)
f)
g)
h)
i)

False, 1 + 11-1.
True, 2 + 0=2-0.
False, 1 + y1-y.
False, x+2 x-2.
True, 2 + 0=2-0.
True, x + 0=x-0.
True, x + 0=x-0.
False, x+2 x-2.
False, 1+2 1-2.

20
14
73
a. a(x):student is in this class,"
b(x):student owns a red convertible,"
c(x): student has gotten a speeding ticket."
x (a(x) c(x))
b. a(x):members are in room
b(x):member has discrete mathematics"
c(x): member can take a course in algorithms"
x (b(x) c(x))
21
20
74
a) This is false. It relies on what Rosen calls the fallacy of affirming the conclusion.
b) This is correct use of modus ponens and universal instantiation.

22
1
85
Let m and n be two odd integers. Then there exists a and b such that n = 2a + 1 and m = 2b +1
n + m = 2a +1 + 2b + 1
= 2a + 2b + 2
= 2(a + b + 1)
Since this represents n + m as 2 times a + b + 1, we conclude that n + m is even, as desired.

23
2
85
Let m and n be two even integers. Then there exists a and b such that n = 2a and m = 2b
n + m = 2a + 2b
= 2(a + b)
Since this represents n + m as 2 times a + b, we conclude that n + m is even, as desired.

24
20
85
(n is positive integers n is even) 7n+4 is even
Assume n is even integer => n = 2a.

7n+4 = 7(2a)+4 = 14a + 4 = 2(7a +2)


2(7a+2) is even integer => that is true.
Assume n is odd integer => n = 2a +1
7n +4 = 7(2a+1) +4 = 14a +7 +4 = 14a + 10 + 1 = 2(7a+5) +1
2(7a+5) + 1 is odd integer => 7n+4 is odd, that is opposite with 7n+4 is even => that is false
25
26
85
Proof: The statement given is of the form p q , where p: n is even, q: 7n + 4 is even.
Thus we have to show

p qq p .

p q ( by direct proof ) :
n is even

n=2 i for some integer i.

Thus 7n + 4 = 7(2i) + 4 = 2(7i + 2) = even integer.

q p ( by indirect proof , show not p not q ) :


not p nis odd n=2 i+ 1 for some integer i.
Thus 7n + 4 = 7(2i + 1) + 4 = 14i + 11 = 14i + 10 + 1 = 2(7i + 5) + 1 = odd = not q.

26
8
120
a)
b)
c)
d)
e)
f)
g)

True
True
False
True
True
True
False

27
9
120
a) True

b)
c)
d)
e)
f)

True
False
True
True
False

28
19
120
a)

P ( { a } )={ , { a } }

b)

P ( { a , b } )={ , { a } , {b } , {a ,b } }

c)

P ( { ,{ } })={ , { } , { { } } , { , { } } }
29
21
120

a) Since the set has 3 elements, the power set has 23 = 8.


b) Since the set has 4 elements, the power set has 24 = 16.
c) Since the empty set has 0 elements, P() has 20 = 1 element.
And since P() has 1 element, P(P()) has 21 = 2 elements.

a)

A B={a ,b , c , d ,e , f , g ,h }

b)

A B={a , b , c , d , e }

c)

AB={}

d)

B A={f , g , h }

30
4
130

31
10
130
32
14
130
A = {1,3,5,6,7,8,9}
B = {2,3,6,,9,10}

33
20

131
Let P(x) be the proposition whose truth set is the set A
Let Q(x) be the proposition whose truth set is B

[ 1 ] A=x U , P ( x ) By definition

[ 2 ] B=x U , Q ( x ) By definition

[ 3 ] ( A B )=x U , P ( x ) Q ( x ) By [ 1 ] [ 2 ]

[ 4 ] B=x U , Q ( x ) By definition

[ 5 ] ( A B )=x U , P ( x ) Q ( x ) By [ 1 ] [ 4 ]
[ 6 ] ( A B ) ( A B )=x U , ( P ( x ) Q ( x ) ) ( P ( x ) Q ( x ) ) By [ 3 ] [ 5 ]
[ 7 ] ( A B ) ( A B )=x U , P ( x ) ( Q ( x ) Q ( x ) ) By [ 6 ]DeMorga n' s Law

[ 8 ] ( A B ) ( A B )=x U , P ( x ) T By [ 7 ] theComplement Law


[ 9 ] ( A B ) ( A B )=x U , P ( x ) By [ 8 ]the Identify Law

AB={ x| x A x B}
{ x| x A x B x C }

[ 10 ] ( A B ) ( A B ) =A By [1]

34
24
131
( AB ) C={ x| x ( AB) x C }
AC= { x| x A x C }

( AB ) ( BC )={ x| x ( AC ) x (BC) }
( AB )C=( AB )( BC )
35
45
131
a)

i=1 n A i=A n= {1,2,3, , n }


b)

i=1 n A i=A 1={1}


36

BC={ x| x B x C }

{ x| x A x B x C }

46
131
a)

i=1 n A i=A n= { ,21,0, 1, 2,3, , n }


b)

i=1 n A i=A 1={ ,2,1, 0,1 }


37
48
131

a)

i=1 Ai ={ 1,2,3, , }
i=1 Ai =
b)

i=1 Ai ={ 0,1, 2, , }
i=1 Ai ={0 }
c)

i=1 Ai =the positive real numbers without the integerszero


i=1 Ai =

d)

i=1 Ai ={ 1, }
i=1 Ai =
38
2
146
a) This is not a function because the rule is not well-defined. We do not know whether

f ( n )=nf ( n )=n . For a function, it cannot be both at the same time.


b) This is a function. For all integers n,

(n2 +1)

is well-defined real number.

c) This is not a function with domain Z, since for n = 2 and n = -2 the value of
defined by the given rule. In other words,

f (n) is not

f (2) and f (2) are not specified since division

by 0 makes no sense.

39
3
146
40
16
147
a)

f ( n )=2 n

b)

n
f ( n )=
2

c)

f ( n )= n+1if nis even


n1 if n is odd

d)

f ( n )=1

41
18
147
a)
b)
c)
d)

This function is both one-to-one and onto, therefore it is a bijection.


This function is neither one-to-one nor onto, therefore it is not a bijection.
This is not a function at all since it does not map the value -2.
This function is both one-to-one and onto, therefore it is a bijection.

42
36
147
a)

Suppose b f ( S T ) . Then there is some a S T such that f ( a ) =b . Since S T , either a Sa T . If a

Now supposethat b f ( S ) f ( T ) .That b f ( S ) b f (T ) . If b f ( S ) ,then there is some a S such that f ( a


b)

Suppose b f ( S T ) . Then there is some a S T such that f ( a )=b . Since S T , a Sa T . Since a S ,


43
2
160

a)

2 =128

b) 7
8

c)

1+ (1 ) =2

d)

(2 )8=256

a)

a0 =(2 )0 =1

a1= (2 )1=2

b)

a0 =3

c)

a0 =7+4 0=8

d)

a0 =2 + (2 ) =2

a1=3

a2=3

44
4
161
a2= (2 )2=4

a3 =(2 )3=8

a2=7+4 2=23

a3 =7+4 3=71

a3 =3

a1=7 +4 1=11
1

a1=2 + (2 ) =0

a2=2 + (2 ) =8

a3 =2 + (2 ) =0

45
10
161
a) The first term is 3, and the nth term is obtained by adding 2n 1 to the previous term.
Alternatively, the nth term is 2n + 2.
b) Start with 7, keep adding 4.
c) Binary counting starting with (1)2
d) One 1, three 2s, five 3s, seven 5s,The first two value 1 and 2. Each subsequent value is the
sum of the previous two. The number of times a value repeats increases by two for each new
value.
e) From Table 1(Page 228), this is 3n 1.
f) Each integer evenly divides the next, and the multipliers are 3,5,7,9,11,and so on
g) One 1, two 0s, three 1s, four 0s, five 1s,
h) Start with 2. Each subsequent term is the square of the previous term.

a)
b)
c)

j=1+3+ 5+7=16

46
14
161

j S

j2=12 +32 +52 +7 2=1+9+25+ 49=84


j S

35 21 15 176
+
+
+
=
( 1j )= 11 + 13 + 15 + 17 = 105
105 105 105 105 105
j S

d)

1=1+1+1+1=4
j S

47
13
178
a) Note that n = 8 and x = 9.
Procedure linear_search(x: integer; a1,a2,,an: integer)
i:= 1
while (i 8 and (i 8 and 9 ai)
i:= i + 1
The while loop is executed as long as i 8 and the i st element is not equal to 9.
i = 1, a1 = 1; 9 1
i = 2, a2 = 3; 9 3
i = 3, a3 = 4; 9 4
i = 4, a4 = 5; 9 5
i = 5, a5 = 6; 9 6
i = 6, a6 = 7; 9 7
i = 7, a7 = 7; 9 = 9
Therefore the body of the loop is not executed( so I is still equal to 7) and control passes beyond
the loop.
if i n then location := i
else location := 0
The else clause is not executed. This completes the procedure, so location has the correct value,
namely 7, which indicates the location of the element x in the list: 9 is the seventh element.
b) Procedure binary_search(x: integer; a1,a2,,an: increasing integer)
i:= 1
j:= 8
while i< j
the while step is executed, first

m=

1+ 8
=4
2

Then since x (=9) is greater than a4 (=5), the statement i:= m + 1 is executed, so i has the value 5.

i=4 +1=5, m=

5+8
=6 x ( 9 ) >a6 ( 6 )
2

i=6+1=7,m=

7+ 8
=7 x ( 9 ) > a7 ( 9 ) fails thus
2

At this point

j m , so j 7

ij , the condition x = a is true, location is set to 7, as it should be, and algorithm


i

is finished.

48
24
178
Let f : A B be the given function. Let A = {a 1,,an}. For each i form 1 to n and each j
from 1 to i, (nested loop), if f(ai) = f(aj) output false. Otherwise output true.

49
6
191
(x3 + 2x)/(2x + 1) (x3 + 2x3)/(2x) = 3/2 x2
So, (x3 + 2x) / (2x + 1) is O(x2) with k = 1, C = 3/2
50
8
191
a) f(x) = 2x^2 + x^3 log x < 2x^2 + x^(3+a) for any a > 0 (and suff. large x) which is
O(x^(3+a)). Since we want an integer exponent, the minimal such exponent occurs when
a = 1. ==> f(x) is O(x^4).
b) 3x^5 + (log(x))^4 < 3x^5 + (x^a)^4 for suff. large x = 3x^5 + x^(4a) Choosing a so
that (4a) is a minimal integer, we use a = 1/4. So, 3x^5 + (log(x))^4 < 3x^5 + x, which is
O(x^5). Hence, f(x) is O(x^5).
c) Note that for x > 1 (x^4 + x^2 + 1) / (x^4 + 1) < (x^4 + x^4 + x^4) / (x^4 + 1) <
3x^4/x^4 < 1 Hence, f(x) is O(x^0) = O(1).
d) Similarly, (x^3 + 5 log x) / (x^4 + 1) < (x^3 + 5x^a) / x^4 < (x^3 + 5x)/x^4. Since the
numerator is O(x^3), f(x) is thus O(x^3/x^4) = O(x^(-1)).
51
12
191
52
22
191
Functions from Exercise 1
a) f(x)=10
b) f(x)=3x + 7
c) f(x)=x2 + x + 1
d) f(x)=5 log x
e) f(x)= x

f) f(x)= x/2
53
10
200
a.
b.
c.
d.

(2*102 + 210)*10-9
(2*202 + 220)*10-9
(2*502 + 250)*10-9
(2*1002 + 2100)*10-9
54
6
208
Clear you mean a 0.
Heres the proof, assuming a 0, b 0.
Since a | c, there exist k such as that c = a.k
Since b | d, there exist l such that d = b.l

So, cd = (ak)(bl) = ab(kl), which implies that ab | cd.

55
12
209
Assume a b( mod m). This means that m|a b, that is a b = mc for some c. So that a =
b + mc. Lets compute a mod m. We know that b = qm + r for some r < m, therefore we
have a = qm + r + mc = m(q + c) + r. By denition, this means that a mod m = r
56
20
209
57
31
209
f (p) = (p + 3) mod 26 (the Caesar cypher).
The encrypted message is GR QRW SDVV JR.
b) f (p) = (p + 13) mod 26.
The encrypted message is QB ABG CNFF TB.

c) f (p) = (3p + 7) mod 26.


The encrypted message is QX UXM AHJJ ZX.
58
32
209
a) BLUE JEANS
b) TEST TODAY
c) EAT DIM SUM

59
20
218
a) 2^2 3^3 5^2
b) 2 3 11
c) 17
d) 1
e) 5
f) 2 3 5 7
60
26
218
The product of the greatest common divisor and the least common multiple of two numbers is
the product of the two numbers. Therefore the answer is (2^7 3^8 5^2 7^11)/(2^3 3^4 5) = 2^4
3^4 5 7^11.

Вам также может понравиться