meljun cortes itc 16
TRANSCRIPT
-
7/27/2019 MELJUN CORTES ITC 16
1/3
JOSE RIZAL UNIVERSITY Computer Science Department
ITC 16 Discrete Structures
LABORATORY EXERCISES
FIRST PRELIMINARY PERIOD
EXERCISES
Set Concepts
1. Draw the full binary tree with four levels four times and draw the paths in this tree withexactly one edge moving to the left.
2. Draw the Pascal Triangle as far as the fourteenth row and underline all the even entries.
3. Draw the Pascal Triangle as far as the thirteenth row and underline all the multiples of 3.
4. Make a table of factorials n! for 0 < n < 40.
5. Prove the statements by induction:a. 2 + 4 + 6 + + 2n = n ( n +1)b. 2 + 5 + 8 + + ( 3n-1 ) = n ( 3n-1 )
2
6. Represent the following binary vectors as paths in the full binary tree:i. a. (1, 1, 0, 1) b. ( 0, 1, 0, 1, 0)
7. Using the Standard Gray Code, list the binary vectors of length a) five b) six.
8. Solve the Knapsack Problem by using the Standard Gray Code, in the following cases:
a. n1 = 6, n2 = 7, n3 = 16, n4 = 18, N= 32
n1 = 10, n2 = 11, n3 = 14, n4 = 26, N= 46
MIDTERM PERIODEXERCISES
1. Compute the Fibonacci numbers Fn for 0 < n < 20.
2. Compute the Lucas numbers Ln for 0 < n < 20.
3. Compute the Tribonacci numbers Tn for 0 < n < 20
4. Find the following Bernoulli numbers :a. B5 b.B6 b.B7 d.B8
5. Find all the terms of the Collatz sequence for the following values of C [0]:a. C[0] = 7 Hint: you should compute at l6 terms
b. C[0] = 39 Hint: you should compute at 34 terms
Page 1 of 3
-
7/27/2019 MELJUN CORTES ITC 16
2/3
JOSE RIZAL UNIVERSITY Computer Science Department
ITC 16 Discrete Structures
LABORATORY EXERCISES
6. Sketch the Fibonacci tree with seven levels.
7. Use the difference table to find the next term of each of the following sequences.
a. 2, 5, 10, 17, 26, 37, 50b. 3, 7, 13, 21, 31, 43, 57
8. Use Euclidean Algorithm to compute the greatest common divisor and the least commonmultiple of each of the following pairs of integers, and to write the greatest common divisor
in the form gcd (m,n) = Am + Bn.
a. (m,n) = (64, 28)b. (m,n) = (59, 37)
9. Use the Fermat Factorization Algorithm to factor the following integers.a. N = 2,183 b. N = 5,429
10. Use the approximation formula given in this section to find the following Fibonacci numbers
and Lucas numbers.
11. Find the inverse of each function.
i. f (x) = 2x + 3
ii. h(x) = 3x -1
12. For the sequence s defined by c, d, d, s, d, c. Find
a) s1 b) s4 c) Write s as a string
13. For the sequence t defined by tn = 2n 1, n > 1. Finda) t3 b) t7 c) t100
14. List all strings over X = { 0,1}of length a) 2 b) 3
FINAL TERM PERIODEXERCISES
1. Write the relation as a table.
a. R = { (a,6), (b,2), (a,1), (c,1) }b. R = { (Lester, Art), (Noli, IT), (Roel, Music ), (Val,Law) }
2. Draw the diagraph of the relation
a. R = { (a,6), (b,2), (a,1), (c,1) }
b. R = { (Lester, Art), (Noli, IT), (Roel, Music ), (Val,Law) }
3. List the inverse of each relation.
a. R = { (a,6), (b,2), (a,1), (c,1) }
b. R = { (Lester, Art), (Noli, IT), (Roel, Music ), (Val,Law) }
Page 2 of 3
-
7/27/2019 MELJUN CORTES ITC 16
3/3
JOSE RIZAL UNIVERSITY Computer Science Department
ITC 16 Discrete Structures
LABORATORY EXERCISES
4. Assuming that p and r are false and that q and s are true; find the truth value of each
proposition.
a. p q c) ( p q ) ( r q )_ _
b. b)p q d) ( p q ) r
5. Formulate the symbolic expression in words using
p: Today is Monday,
q: It is raining,r: It is hot.
_
6. a) p q b) q (r p) c) ( p q ) r d) ( p q ) ( r q)
7. Tell whether the statement is a propositional function
a. ( 2n + 1)2 is an odd integer.b. Let x be a real number
c. 1 + 3 =4
d. For every n, P(n).e. For some n, P(n).
8. Use Venndiagram to verify the following identities in a Boolean algebra. Let A and B besubsets of a set S, let x= A and y= B,
a. x + x = x
b. x + 1 =1c. x + xy = x
Page 3 of 3