0% found this document useful (0 votes)
31 views8 pages

Finnal 10

Uploaded by

Đặng Phong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views8 pages

Finnal 10

Uploaded by

Đặng Phong
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Choose 1 answer Find the negation of proposition

A.(I) ∃ x ∀ y ( P ( x , y ) →Q ( x , y ) ) .
B.(IV) (i) ∀ x ∃ y ( ¬ P ( x , y ) ∧ Q ( x , y ) ) .
C.None of the other choices is correct
(ii) ∀ x ∃ y ( P ( x , y ) ∧¬ Q ( x , y ) ) .
D.(III)
E. (II) (iii) ∃ x ∀ y ( ¬ P ( x , y ) ∧ Q ( x , y ) ) .

A.(iii) Find a proposition with the given truth table


B.(ii)
C.(I) p q ?
T T F
T F F
F T T
F F T
(I) ( ¬ p ∧ q ) ∨ ( ¬ p ∧¬ q )
(II) ¬ p ∧ q
(III) q ∨ ( ¬ p ∧¬ q )
A.1024 Give the algorithm
B.516 Procedure LT(n, x : integer)
C.625 n=( a k ak−1 … a0 ) 2 { the binary expansion of n}
D.1250 p:=1;
for i:=0 to k do
if a i = 1 then
p:=p*x;
x:=x*x;
Print(p)

If n = 5, x = 4, what is the output of the algorithm

A.8 What is the position of the letter f when using the inorder
B.None of the other choices is correct traversal
C.11 A
D.10
E.7
F.9 B C

H
E F
D G

J L
K
I

M O P
N
A.(IV) Which graph has Hamilton circuits but no Euler circuits?
B.(II) ( I ) K 4 ( II ) Q4 ( III ) C 4 ( IV ) K 3
C.(I)
D.(III)
Let a = 137 mod 31 and b = -137 mod 31. Find b –
a
A. 5
B. -7
C. 23
D. -13
E. 17
A. 1 and 1 Let a 1 , a2 … be the sequence
B. 0 and 0 0,1,1,0,0,0,1,1,1,1,…
C. 1 and 0 Find a 99∧a100 .
D. 0 and 1
A. g Let N = {0,1,2,3,…}
B. h Which of the following functions are onto from N to N
C. g and h
D. f and g
E. None of the other choices is correct

How many strings of three decimal digits have


exactly two digits that are 4s
a. 27
b. 28
c. 29
d. 30
How many cut vertices and cut edges in this
graph?
a. 5 and 5
b. 5 and 6
c. 6 and 6
d. 7 and 6

Decode the message 110111010 encode by the


scheme
f: 10, p: 110, t: 1110
a. ptf
b. fpt
c. tpf
d. pft
e. None of the other choices is correct
a. (II) Determine the complexity of the algorithm in terms of the
b. (III) number of comparisons
c. None of the choices is correct Procedure thuattoan(a 1 , a2 … , an :integers )
d. (I) k:=0
for i:=1 to n do
if a i < 0 the k:=k+1
Print(k)
(I) O(n)
(II) O(logn)
(III) O(1)
A. 5 Give the recursive algorithm
B. 8 ----------------------------------------------------------
C. 9 Procedure T(a: real number, n: nonnegative integer)
D. None of the other choices is correct if n=0 then
E. 6 return 1
else
return a*T(a,n-1)
-----------------------------------------------------------------
Find output if a = 2, n = 3.
How many divisions are needed when using
Euclidean algorithm to find the greatest common
3111 and 3135
A. 4
B. 5
C. 6
D. 7
A. (i) Let p and q be propositions. Which proposition is logically
B. (iii) equivalent to ¬ p → q ?
C. (iv) (i) ¬ p → q
D. None of the other choices (ii) p → q
E. (v) (iii) p ∨¬ q
F. (ii) (iv) p ∨q
(v) p ∧q
a. (ii) Which of the following is a function?
b. (i) (i) f : N → N , f ( n )= √ n
c. None of the other choices is correct (ii) f : N → R , f ( n )= √ n
d. (iii) (iii) f : R → N , f ( n )= √ n
a. (ii) Which of the following sets is the power set {a, ∅ }
b. (iii) (i) { ∅ , { a } , { ∅ , a } }
c. (i) (ii) { ∅ , { a } , { ∅ } , { a , ∅ } }
d. (iv)
(iii) { ∅ , { a } , { ∅ } , { a , { ∅ } } }
(iv) { ∅ , { a , ∅ } }
A. (ii) Find the postfix notation for the expression
B. (iii) ( x− y )2 + x ( y+ 5 )
C. None of the other choices is correct (i) xy−2 ↑ xy 5+ ¿+¿
D. (i) (ii) +↑− xy 2∗x+5 y
E. (iv) (iii) x− y ↑ 2+ x∗y +5
(iv) +↑− x y 2∗x + y 5
Using Prim’s to find a minimal spanning tree.
What is the list of edges chosen?
a. CE,BC,AB,DZ,EZ
b. CE,BC,AB,BD,DZ
c. None of the other choices is correct
d. AB,BC,CE,BD,DZ
e. CE,BC,AB,EZ,DZ
A. 3 Let M be the incidence matrix of the given graph that
B. 1 vertices indexed by v1, v2, v3, v4, and the columns indexed
C. 2 by e1, e2, e3, e4. What is the sum of the entries in the
D. 0 fourth row of M?
v1 e1 v2

e2 e4
e3

v4
v3

A.3 Let m = 210 +29


B.8 Find 3m mod 11
C.6
D. None of the choices is correct
E. 7
A. None of the other choices is correct Find the binary expansion of the 243
B. (iv) (i) ( 11110010 )2
C. (i) (ii) ( 11100010 )2
D. (iii) (iii) ( 11010011 )2
E. (ii)
(iv) ( 11110011 )2
a. 13
b. None of the other choices is correct
c. 11
d. 9
e. 8
Find the length of the shortest path from a to z
What is the maximum height of a full binary tree
with 101 vertices
a. 50
b. 100
c. 6
d. 101
e. None of the other choices is correct
a. 2 Find the smallest integer n such that the following function
b. 1 is O ( x n )
c. 0 [ x log x ] + [ x+ log x ]
d. 3
e. 4
Find a if LCM(a,4200)=58800 and
GCD(a,4200)=280
a. 11760
b. 784
c. 1960
d. 3920
a. {1,2,3,4,5,6,8} Let
b. {1,2,3,4,5,} A={0,2,4,6,8,10}, B={1,2,3,4,5,6} and
c. {1,2,3,4,5,8} C={1,2,3,4,5,7,8,9}.
d. {0,1,2,3,4,5,6}
Find ( A ∪ B ) ∩ C .
Let U={a,b,c,d,e,f,g,h,I,j}. Let P be the subset of U
whose bit string representation is the subset of U
whose bit string representation is 0100110111.
Find the intersection of P and
A. {b,e,h,i}
B. {b,e,h,I,j}
C. {c,f,g,j}
D. {c,f,g,h,j}
E. None of the other choices is correct
A. (iv) Find the negation of the proposition
B. (ii) ∃ x ( P ( x ) →Q ( x ) )
C. (iii) (i) ∀ x ( Q ( x ) → P ( x ))
D. (i)
(ii) ∀ x (¬ Q ( x ) → P ( x ) )
E. None of the other choices is correct
(iii) ∀ x (¬ Q ( x ) ∧ P ( x ) )
(iv) ∀ x ( ¬ Q ( x ) ∧¬ P ( x ) )
Which number is congruent to 10 modulo 17
a. 90
b. 80
c. 85
d. 95
e. None of the other choices is correct
a. None of the other choices is correct Find the value of the expression
b. 110000 ( 101101∨110001 ) 001101
c. 111101
d. 101100
e. 001101
Let G be a simple graph whose vertices are of
degree 3. If G has 15 edges, how many vertices
a. 10
b. 20
c. 5
d. 25
e. Such G does not exist
a. (i)
b. None of the other choices is correct
c. (ii)
d. (iv)
e. (iii)
a. 27 Find f ( 5 ), if f ( n ) is defined recursively by
b. 26 f ( 0 )=−1 , f ( 1 )=2
c. 28 and
d. None of the other choices f ( n+ 1 )=f ( n ) +5 f ( n−1 ) for n=1, 2 , 3 , …
e. 25
a. (iii) Let P(n) be the statement ”3n=0”. The domain consists of all
b. (ii) non-negative integer.
c. (iv) A proof of ∀ nP ( n ) is as follows:
d. (i) (i) P(0) is clearly true.
e. None of the other choices (ii) Assume that P(0),…,P(k) are true for some non-
negative integer k.
(iii) Write k+1=i+j for some integer, j with 0 ≤ i, j ≤ k
(iv) We have:
3(k+1)=3i+3j=0+0=0, as P(i), P(j) are true. So
P(k+1)=0. By strong induction, we conclude ∀ nP ( n ) .
How many edges in a full 3-ary tree with 101
leaves?
a. 102
b. 150
c. None of the other choices is correct
d. 101
e. 97
a. (iii) Let T(n) be an increasing function such that T(n) =2T(n/2) +
b. (ii) 1
c. (i) Chosen the best answer.
d. (iv) (i) T(n)=O(n)
(ii) T(n)=O(logn)
(iii) T(n)=O(n2 )
(iv) T(n)=O(n3 )
a. All n> 2 and odd For which n>2 does the graph W n have Euler circuits
b. All>2
c. All n>2 and even
d. None of the other choices is correct
Which sequence can be the degree sequence of a
simple graph?
A. 2,2,3,3,4,4
B. 2,2,4,4,5,5
C. 0,1,2,3,4,5
D. 1,1,1,2,2,2
E. 1,1,2,2,4,4,6
a. (iv) Let
b. (i) P(x)=”x is a freshman”
c. (ii) Q(x)=”x takes Dmath 1”,
d. None of the other choices is correct where the consists of all students in a university.
e. (iii) Translate the sentence into logical expression:
“Every freshman must take Dmath 1”.
(i) ∀ x ( P ( x ) ∧ Q ( x ) )
(ii) ∀ x ( P ( x ) → Q ( x ))
(iii) ∃ x ( P ( x ) ∧Q ( x ) )
A. None of the other choices is correct Given the set S ⊆ Z defined recursively as follows:
B. (iii) Basis step: 4,6 ∈ S ,
C.
D.
(iv)
(ii) Recursive step: If m , n∈ S then {m+
−m∈ S
n∈S
E. (i) (i) S={a ϵ Z ∣a divisible by 2}
(ii) S={a ∈ Z ∣a divisible by 3 }
(iii) S={a ∈ Z ∣a divisible by 4

Given the Binary search algorithm


Input = 2,4,5,7,8,9,10,13 and x = 11, after the third
time of diving into sublists. The sublist to be
considered is_______
a. 13
b. 10
c. 9. 10
d. 10. 13
Given the recursive algorithm that computes the
n-th Fibonacci number
Procedure F(n: natural number)
If n = 0 then F(n):=0
Else
If n = 1 then F(n):= 1
Else F(n):= F(n-1) +F(n-2);
How many additions are used if n = 6?
a. 8
b. 7
c. 9
d. 12
e. None of the other choices is correct
Which of the following is NOT a circuit in this
graph?
a. A-B-C-D-F-B-A
b. C-D-E-F-B-A-C
c. B-A-D-E-F-B
d. E-F-B-A-D-E
e. D-B-F-E-D
What is the average number of bits used for one
character when using Huffman coding to encode
message “mathematic”?
a. 2.8
b. 2.2
c. 2.6
d. None of the other choices is correct
e. 2.4
a. (ii) Let m,n be integer. Translate the sentence into a logical
b. (iv) expression
c. (iii) “ Each integer is either odd or even”
d. None of the other choices is correct (I) ∀ m ∀ n [ ( m=2 n+1 ) ∨ ( m=2n ) ]
e. (i) (II) ∀ m∃ n [ ( m=2 n+1 ) ∨ ( m=2 n ) ]
(III) ∃ m∃n [ ( m=2 n+1 ) ∨ ( m=2n ) ]
(IV) ∃ m ∀ n [ ( m=2 n+1 ) ∨ ( m=2 n ) ]
Consider the argument with the hypotheses:
“ I will be happy if your project succeeds.
Your project can become successful only if you
change the method.”
And the conclusion:
“ Therefore, if you change the method, then i will
very happy.”
Chosen the right answer.
a. The argument is valid using hypothetical
syllogism
b. The argument is invalid
c. The argument is valid using modus tollens
d. The argument is valid using simplification
e. The argument is valid using modus
ponens
Using depth-first search to produce a spanning
tree for the given simple graph and assume that
the vertices are ordered alphabetically. Choose
the vertex A as the root of this spanning tree.
What is the spanning tree that we obtain?
a. (i)
b. (ii)
c. (iii)
d. (iv)
e. None of the other choices is correct
a. None of the other choices is correct Given X ={ ∅ , { ∅ } , { a , b } , c } , Y = { x , { z , z } , x }
b. 3 How many one-to-one functions are there from Y to X
c. 6
d. 12
e. 2

a. None of the other choices is correct. Given a sequence { an } satisfying the recurrence relation.
b. 123 n
a 0=−1 , an=an−1 +2 for n=1 ,2 , …
c. 127
Find a 6
d. 121
e. 125

You might also like