• 沒有找到結果。

(15%) Explain if the following description is correct or not

N/A
N/A
Protected

Academic year: 2022

Share "(15%) Explain if the following description is correct or not"

Copied!
4
0
0

加載中.... (立即查看全文)

全文

(1)

• Please give details of your calculation. A direct answer without explanation is not counted.

• Your answers must be in English.

• Please carefully read problem statements.

• During the exam you are not allowed to borrow others’ class notes.

• You are not allowed to use any electronic device, including cell phones, calcu- lators, etc.

• Try to work on easier questions first.

1. (15%) Explain if the following description is correct or not.

Let Σ be the alphabet of a Turing machine. We consider any infinite binary sequence such as

10101111...

Any such sequence is in Σ. Using the diagonalization method, the set of all infinite binary sequences is uncountable. Therefore, Σ is uncountable.

2. (15%) We define Primality = {n ∈ N | n is a prime}. Explain if the following description is correct or not.

We can test whether a number n is a prime by dividing n by 1, 2, 3, . . . ,√

n.

√n = n12 = O(n2). Therefore Primality ∈ P.

3. (15%) Is EQDFA ∈ P or not?

4. (20%) Answer if the following statement is correct or not. Explanation is needed. You cannot just say yes or no.

(a) If f (n) = 2O(t(n)), then f (n)2 = 2O(t(n)). (b) If f (n) = o(22n), then f (n) = o(2n)

1

(2)

5. (15%) We know that small-o is defined in the following way: f (n) = o(g(n)) if

n→∞lim f(n) g(n) = 0.

From the definition of limit, this means

∀c > 0, ∃N, ∀n ≥ N,f(n) g(n) < c.

If

f(n) = n and g(n) = 3n, how do you find N to make the above statement correct?

6. (15%) We define co-NP = {L | L ∈ NP}.

Is Primality ∈ co-NP ?. You can not use the fact “ Primality ∈ P” in your explanation.

7. (a) (5%) Calculate 5281 × 77773 = ?

(b) (Bonus 5%) p ≤ q are primes and p × q = 203447, find p and q.

2

(3)

1. This description is incorrect. Any element in Σ is a finite sequence.

Common mistakes

• We are not asking you to prove Σ is countable

• We asked you if “the description is right or not,” so you should point out where the error is

2. This description is incorrect. Time complexity is defined based on the input length(log2n) not it’s value(n). Then # of operations ≥ 212log2n. The time complexity of this algorithm is exponential, so this description does not imply that primality is P.

Common mistakes:

• While this description is wrong, you then cannot imply “primality /∈ P .” Indeed primality is P .

3. Yes, EQDFA∈ P . Given DFA A and DFA B, we can construct C with L(C) = (L(A) ∩ L(B)) ∪ (L(A) ∩ L(B))

In constructing the DFA C, complement operation can be done by interchanging accepting states. For union and intersection operations, they also can be done in polynomial time by Theorem 1.25. All construction procedure is finished in polynomial time. And test whether L(C) = φ (i.e. L(A) = L(B)) by the method mentioned in the proof of Theorem 4.4. Let n = # of states of C (polynomial size of A and B), we know that # step 2 ≤ n, and the cost for each step 2 is less than n2. Hence, testing L(C) = φ is polynomial.

Therefore we get a TM decide EQDFA running in polynomial time.

Common mistakes:

• You need to explain why constructing C is polynomial!

• Don’t come to me if you didn’t analyze the complexity of each step

4. (a) Yes. As f (n) = 2O(t(n)), there exists c, N0 ≥ 0 such that ∀n ≥ N0, f (n) ≤ 2ct(n). Then we can find a c0 = 2c such that ∀n ≥ N0, f2(n) ≤ (2ct(n))2 = 22ct(n) = 2c0t(n). Therefore, f2(n) = 2O(t(n))

(b) No, consider f (n) = 3n. We know that

n→∞lim 3n 22n = 0 1

(4)

n→∞lim 3n 2n = ∞

Therefore f (n) = o(22n), but 3n 6= o(2n), a counterexample for this argument.

Common mistakes

• f (n)2 = 2O(t(n))· 2O(t(n)). This is not rigorous

• f (n)2 = (2O(t(n)))2 = 22O(t(n)). This is not rigorous 5.

f (n) g(n) = n

3n < 2n 3n = (2

3)n.Let N = max(dlog2

3 ce, 1). Then

∀n > N,f (n) g(n) = n

3n < 2n 3n = (2

3)

n

< (2 3)

N

= (2

3)log23c= c.

Common mistakes:

• N must be related to c.

• Cannot choose N = 1. If c = 1/9, we don’t have f (2)

g(2) = 2 9 < 1

9.

6. Primality = {n ∈ N | n is a composite}. A polynomial verifier for Primality is the factorization of n. Therefore, Primality ∈ NP, and Primality ∈ co-NP.

Common mistakes:

• You can have a verifier or NTM. However, you cannot use your verifier to do the job of NTM. For example, NTM nondeterministically divides n by 1, . . . ,√

n. You cannot use your verifier to sequentially do this job and claim you have a polynomial verifier.

• You cannot use the number of operations calculated in problem 2 to prove that primality is NP. An algorithm with an exponential number of operations may not be NP.

7. (a) 5281 × 77773 = 410719213 (b) p = 389, q = 523

Common mistakes:

• Cannot use p = 1, q = 203447 as p and q are not a prime.

2

參考文獻

相關文件

• Consider an algorithm that runs C for time kT (n) and rejects the input if C does not stop within the time bound.. • By Markov’s inequality, this new algorithm runs in time kT (n)

• Consider an algorithm that runs C for time kT (n) and rejects the input if C does not stop within the time bound.. • By Markov’s inequality, this new algorithm runs in time kT (n)

 Sender Report: used by active session participants to relay transmission and reception statistics.  Receiver Report: used to send reception statistics from those

Give an open cover of [0, 1) which does not have any finite subcover.. Prove from the definition (i.e., using ²-δ) that f

So we check derivative of f and g, the small one would correspond to graph (b) and the other to (c)(i.e.. Moreover, f is

(18%) Suppose that in the following week you have 12 hours each day to study for the final exams of Calculus 4 and English.. Let C be the number of hours per day spent studying

This surface does not intersect the -plane at all, so the axis of the hyperboloid is the -axis and the graph is

17) Consider a cell made up of two half cells consisting of the same metal in solutions of the metal ion of different concentrations.. A piece of the coffin is analyzed by