Uploaded by Thanh Phung

toan mad

advertisement
Choose 1 answer
A.(I)
B.(IV)
C.None of the other choices is correct
D.(III)
E. (II)
Find the negation of proposition
∃π‘₯∀𝑦(𝑃(π‘₯, 𝑦) → 𝑄(π‘₯, 𝑦)).
(i) ∀π‘₯∃𝑦(¬π‘ƒ(π‘₯, 𝑦) ∧ 𝑄(π‘₯, 𝑦)).
(ii) ∀π‘₯∃𝑦(𝑃(π‘₯, 𝑦) ∧ ¬π‘„(π‘₯, 𝑦)).
(iii) ∃π‘₯∀𝑦(¬π‘ƒ(π‘₯, 𝑦) ∧ 𝑄(π‘₯, 𝑦)).
A.(iii)
B.(ii)
C.(I)
Find a proposition with the given truth table
A.1024
B.516
C.625
D.1250
p q ?
T T F
T F F
F T T
F F T
(I) (¬π‘ ∧ π‘ž) ∨ (¬π‘ ∧ ¬π‘ž)
(II) ¬π‘ ∧ π‘ž
(III) π‘ž ∨ (¬π‘ ∧ ¬π‘ž)
Give the algorithm
Procedure LT(n, x : integer)
n=(π‘Žπ‘˜ π‘Žπ‘˜−1 … π‘Ž0 )2 { the binary expansion of n}
p:=1;
for i:=0 to k do
if π‘Žπ‘– = 1 then
p:=p*x;
x:=x*x;
Print(p)
If n = 5, x = 4, what is the output of the algorithm
A.8
B.None of the other choices is correct
C.11
D.10
E.7
F.9
What is the position of the letter f when using the
inorder traversal
A
B
C
H
E
D
F
G
L
J
K
I
M
A.(IV)
B.(II)
C.(I)
D.(III)
Let a = 137 mod 31 and b = -137 mod 31.
Find b – a
N
O
P
Which graph has Hamilton circuits but no Euler
circuits?
(𝐼) 𝐾4 (𝐼𝐼)𝑄4 (𝐼𝐼𝐼)𝐢4 (𝐼𝑉)𝐾3
A.
B.
C.
D.
E.
A.
B.
C.
D.
A.
B.
C.
D.
E.
5
-7
23
-13
17
1 and 1
0 and 0
1 and 0
0 and 1
g
h
g and h
f and g
None of the other choices is correct
Let π‘Ž1 , π‘Ž2 … 𝑏𝑒 π‘‘β„Žπ‘’ π‘ π‘’π‘žπ‘’π‘’π‘›π‘π‘’
0,1,1,0,0,0,1,1,1,1,…
Find π‘Ž99 π‘Žπ‘›π‘‘ π‘Ž100 .
Let N = {0,1,2,3,…}
Which of the following functions are onto from N to N
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)
b. (III)
c. None of the choices is correct
d. (I)
Determine the complexity of the algorithm in tems of
the number of comparisons
Procedure thuattoan(π‘Ž1 , π‘Ž2 … , π‘Žπ‘› : π‘–π‘›π‘‘π‘’π‘”π‘’π‘Ÿπ‘ )
k:=0
for i:=1 to n do
if π‘Žπ‘– < 0 the k:=k+1
Print(k)
(I) O(n)
A.
B.
C.
D.
E.
5
8
9
None of the other choices is correct
6
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)
B. (iii)
C. (iv)
D. None of the other choices
E. (v)
F. (ii)
a.
b.
c.
d.
(ii)
(i)
None of the other choices is correct
(iii)
a.
b.
c.
d.
(ii)
(iii)
(i)
(iv)
A.
B.
C.
D.
E.
(ii)
(iii)
None of the other choices is correct
(i)
(iv)
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
B. 1
C. 2
D. 0
(II) O(logn)
(III) O(1)
Give the recursive algorithm
---------------------------------------------------------Procedure T(a: real number, n: nonnegative integer)
if n=0 then
return 1
else
return a*T(a,n-1)
----------------------------------------------------------------Find output if a = 2, n = 3.
Let p and q be propositions. Which proposition is
logically equivalent to ¬π‘ → π‘ž ?
(i) ¬π‘ → π‘ž
(ii) 𝑝 → π‘ž
(iii) 𝑝 ∨ ¬π‘ž
(iv) 𝑝 ∨ π‘ž
(v) 𝑝 ∧ π‘ž
Which of the following is a function?
(i) 𝑓: 𝑁 → 𝑁, 𝑓(𝑛) = √𝑛
(ii) 𝑓: 𝑁 → 𝑅, 𝑓(𝑛) = √𝑛
(iii) 𝑓: 𝑅 → 𝑁, 𝑓(𝑛) = √𝑛
Which of the following sets is the power set {a, ∅}
(i) {∅, {π‘Ž}, {∅, π‘Ž}}
(ii) {∅, {π‘Ž}, {∅}, {π‘Ž, ∅}}
(iii) {∅, {π‘Ž}, {∅}, {π‘Ž, {∅}}}
(iv) {∅, {π‘Ž, ∅}}
Find the postfix notation for the expression
(π‘₯ − 𝑦)2 + π‘₯(𝑦 + 5)
(i) π‘₯𝑦 − 2 ↑ π‘₯𝑦5 +∗ +
(ii) +↑ −π‘₯𝑦2 ∗ π‘₯ + 5𝑦
(iii) π‘₯ − 𝑦 ↑ 2 + π‘₯ ∗ 𝑦 + 5
(iv) +↑ −π‘₯ 𝑦 2 ∗ π‘₯ + 𝑦 5
Let M be the incidence matrix of the given graph that
vertices indexed by v1, v2, v3, v4, and the columns
indexed by e1, e2, e3, e4. What is the sum of the
entries in the fourth row of M?
e1
v1
e2
v3
A.3
B.8
C.6
D. None of the choices is correct
E. 7
A. None of the other choices is correct
B. (iv)
C. (i)
D. (iii)
E. (ii)
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
b. 1
c. 0
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}
b. {1,2,3,4,5,}
c. {1,2,3,4,5,8}
d. {0,1,2,3,4,5,6}
e3
v2
e4
v4
Let m = 210 + 29
Find 3π‘š π‘šπ‘œπ‘‘ 11
Find the binary expansion of the 243
(i) (11110010)2
(ii) (11100010)2
(iii) (11010011)2
(iv) (11110011)2
Find the smallest integer n such that the following
function is 𝑂(π‘₯ 𝑛 )
[π‘₯ log π‘₯] + [π‘₯ + log π‘₯]
Let
A={0,2,4,6,8,10}, B={1,2,3,4,5,6} and
C={1,2,3,4,5,7,8,9}.
Find (𝐴 ∪ 𝐡) ∩ 𝐢.
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.
E.
A.
B.
C.
D.
E.
{c,f,g,h,j}
None of the other choices is correct
(iv)
(ii)
(iii)
(i)
None of the other choices is correct
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
b. 110000
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)
Find the negation of the proposition
∃π‘₯(𝑃(π‘₯) → 𝑄(π‘₯))
(i) ∀π‘₯(𝑄(π‘₯) → 𝑃(π‘₯))
(ii) ∀π‘₯(¬π‘„(π‘₯) → 𝑃(π‘₯))
(iii) ∀π‘₯(¬π‘„(π‘₯) ∧ 𝑃(π‘₯))
(iv) ∀π‘₯(¬π‘„(π‘₯) ∧ ¬π‘ƒ(π‘₯))
Find the value of the expression
(101101 ∨ 110001) ⨁ 001101
a.
b.
c.
d.
e.
27
26
28
None of the other choices
25
Find 𝑓(5), if 𝑓(𝑛) is defined recursively by
𝑓(0) = −1, 𝑓(1) = 2
and
𝑓(𝑛 + 1) = 𝑓(𝑛) + 5𝑓(𝑛 − 1) π‘“π‘œπ‘Ÿ 𝑛 = 1,2,3, …
a.
b.
c.
d.
e.
(iii)
(ii)
(iv)
(i)
None of the other choices
Let P(n) be the statement ”3n=0”. The domain consists
of all non-negative integer.
A proof of ∀𝑛𝑃(𝑛) is as follows:
(i) P(0) is clearly true.
(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 ≤ 𝑖, 𝑗 ≤
π‘˜
(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
∀𝑛𝑃(𝑛).
How many edges in a full 3-ary tree with 101
leaves?
a. 102
b.
c.
d.
e.
a.
b.
c.
d.
150
None of the other choices is correct
101
97
(iii)
(ii)
(i)
(iv)
a. All n> 2 and odd
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)
b. (i)
c. (ii)
d. None of the other choices is correct
e. (iii)
A.
B.
C.
D.
E.
None of the other choices is correct
(iii)
(iv)
(ii)
(i)
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);
Let T(n) be an increasing function such that T(n)
=2T(n/2) + 1
Chosen the best answer.
(i) T(n)=O(n)
(ii) T(n)=O(logn)
(iii) T(n)=O(𝑛2 )
(iv) T(n)=O(𝑛3 )
For which n>2 does the graph π‘Šπ‘› have Euler circuits
Let
P(x)=”x is a freshman”
Q(x)=”x takes Dmath 1”,
where the consists of all students in a university.
Translate the sentence into logical expression:
“Every freshman must take Dmath 1”.
(i) ∀π‘₯(𝑃(π‘₯) ∧ 𝑄(π‘₯))
(ii) ∀π‘₯(𝑃(π‘₯) → 𝑄(π‘₯))
(iii) ∃π‘₯(𝑃(π‘₯) ∧ 𝑄(π‘₯))
Given the set 𝑆 ⊆ 𝑍 defined recursively as follows:
Basis step: 4,6 ∈ 𝑆 ,
−π‘š ∈ 𝑆
Recursive step: If π‘š, 𝑛 ∈ 𝑆 π‘‘β„Žπ‘’π‘› {
π‘š+ 𝑛 ∈ 𝑆
(i)
𝑆 = { π‘Ž πœ– 𝑍 ∣ π‘Ž 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 2}
(ii)
𝑆 = {π‘Ž ∈ 𝑍 ∣ π‘Ž 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 3}
(iii)
𝑆 = {π‘Ž ∈ 𝑍 ∣ π‘Ž 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 4
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)
b. (iv)
c. (iii)
d. None of the other choices is correct
e. (i)
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)
Let m,n be integer. Translate the sentence into a
logical expression
“ Each integer is either odd or even”
(I) ∀π‘š ∀𝑛[(π‘š = 2𝑛 + 1) ∨ (π‘š = 2𝑛)]
(II) ∀π‘š ∃𝑛[(π‘š = 2𝑛 + 1) ∨ (π‘š = 2𝑛)]
(III) ∃π‘š ∃𝑛[(π‘š = 2𝑛 + 1) ∨ (π‘š = 2𝑛)]
(IV)∃π‘š ∀𝑛[(π‘š = 2𝑛 + 1) ∨ (π‘š = 2𝑛)]
c.
d.
e.
a.
b.
c.
d.
e.
a.
b.
c.
d.
e.
(iii)
(iv)
None of the other choices is correct
None of the other choices is correct
3
6
12
2
None of the other choices is correct.
123
127
121
125
Given 𝑋 = {∅, {∅}, {π‘Ž, 𝑏}, 𝑐}, π‘Œ = {π‘₯, {𝑧, 𝑧}, π‘₯}
How many one-to-one functions are there from Y to X
Given a sequence {π‘Žπ‘› } satisfying the recurrence
relation.
π‘Ž0 = − 1, π‘Žπ‘› = π‘Žπ‘›−1 + 2𝑛 π‘“π‘œπ‘Ÿ 𝑛 = 1,2, …
Find π‘Ž6
Download