Prove

$$\frac{1}{2\ln 2} + \frac{1}{3\ln 3} + \ldots + \frac{1}{n\ln n} = \ln\ln n + O(1)$$

and

$$\frac{1}{1^{1.1}} + \frac{1}{2^{1.1}} + \ldots \frac{1}{n^{1.1}} = O(1).$$


Order the following functions by asymptotic growth. Place $f$ before $g$ if $f(n) = O(g(n))$.

* $n^n$
* $\sqrt{n}$
* $\log\log n$
* $0.001n^7$
* $5000n$
* $e^n$
* $2^{\log^2 n}$
* $10^{10^{10}}$
* $n!$
* $2^{2^n}$


Let $\Sigma = \{0, 1\}$. Let language

$$L = \{w \in \{0, 1\}^* : w \text{ has an unequal number of 0's and 1's}\}.$$

Prove $L^* = \Sigma^*$.


Use first-order Peano arithmetic formulas to express "$m = 2^n$".


Prove P is closed under Kleene star. In other words, if a language $L$ belongs to P, then so does $L^*$.


Let

$$L_1 = \{(\alpha, x) : \text{TM } M_\alpha \text{ accepts input } x\},$$

and

$$L_2 = \{\alpha : \text{TM } M_\alpha \text{ halts on the empty input}\}.$$

Prove that $L_1 \leq_T L_2$.


Define the problem QUADEQ as follows: given m quadratic equations in n variables over the finite field GF(2),

$$p_1(x_1, x_2, \ldots, x_n) = 0,$$
$$p_2(x_1, x_2, \ldots, x_n) = 0,$$
$$\vdots$$
$$p_m(x_1, x_2, \ldots, x_n) = 0,$$

determine whether there exists at least one solution. Prove that QUADEQ ∈ NP.


Prove if L is NP-hard and L ∈ P, then P = NP.


Prove that $L_1 \leq_P L_2$ and $L_2 \in$ NP, then $L_1 \in$ NP.


Construct a function $T(n)$ that satisfies $n \leq T(n) \leq n^2$ and is not time-constructible.


Define the *low-degree clique* (LDC) problem as follows: Given a graph $G = (V, E)$ and an integer $k$, determine whether $G$ contains a clique of size at least $k$ consisting solely of vertices whose degree does not exceed the median vertex degree of $G$. Prove that LDC is NP-complete.


Let

$$\text{DOUBLE-SAT} = \{\langle \varphi \rangle \mid \text{formula } \varphi \text{ has at least two satisfying assignments}\}.$$

Prove that DOUBLE-SAT is NP-complete.


Design a finite automaton that accepts the following language

$$L = \left\{ w \in \{0, 1\}^* \mid w = w_1w_2 \cdots w_n \text{ such that } \sum_{i=1}^{n} w_i 2^{n-i} \equiv 0 \pmod{5} \right\}.$$

In other words, the language $L$ is the set of all binary strings that represent multiples of 5, written with the most significant bit first (MSB). Draw the state diagram of the finite automaton.


Design a finite automaton that recognizes the following language

$$L = \{w \in \{0, 1\}^* : w \text{ does not contain substring } 10\}.$$

Draw its state diagram.


Use the definition of big-O notation to prove the following:

1) If $f_1 = O(g_1)$ and $f_2 = O(g_2)$, then $f_1f_2 = O(g_1g_2)$.

2) If $f_1 = O(g)$ and $f_2 = O(g)$, then $f_1 + f_2 = O(g)$.


Define a *backward-read DFA* as a deterministic finite automaton that processes its input string from right to left. Prove that a language is regular if and only if it can be accepted by some backward-read DFA.


Give a regular expression for language

$$L = \{w \in \{0, 1\}^* : \text{ the number of 1's in } w \text{ is even, and the number of 0's is even}\}.$$


Construct NFAs corresponding to the following regular expressions:

* $0^+ \cup (01)^*$;
* $(0 \cup 1^+)0^*1^+$.


The input is two binary numbers, $x$ and $y$ (with the most significant bit on the left), separated by a symbol #, for example, 100#100⊔. (Assume there are no leading zeros unless the number is zero.) Accept if $x$ and $y$ are equal.

Draw the state diagram of the corresponding Turing machine and submit its source code on eLearning.


Let language

$$L = \{0^n : n \text{ is a Fibonacci number}\}.$$

Design a Turing machine that decides L. Draw the state diagram of the corresponding Turing machine and submit its source code on eLearning.


In the definition of the Turing machine, the head can move left or right. A Turing machine whose head can move left, right, or stay in place is called a *Turing machine with a stationary move*, or more formally:

$$\delta : Q \times \Gamma \to Q \times \Gamma \times \{L, R, S\}.$$

Prove that if a language $L$ can be decided by a Turing machine with stationary moves, then $L$ can also be decided by a standard Turing machine.


Define a *two-dimensional* Turing machine to be a TM where each of its tapes is an infinite grid (and the machine can move not only Left and Right but also Up and Down).

Show that if language L can be decided in time T(n) by a two-dimensional TM then L ∈ DTIME(T(n)2).


Define a *one-tape two-head Turing machine* as a Turing machine equipped with a single tape but two independent heads operating on it. Each head can read, write, and move simultaneously and independently of the other. Both heads may read the same tape cell at the same time. Conflicts are resolved as follows:

* If both heads attempt to write to the same cell simultaneously, the first head goes first, and the second head overwrites any previous content.

* If the first head tries to write while the second head tries to read the same cell, the first head goes first, and the second head reads the updated content.

* If the first head tries to read while the second head tries to write the same cell, the first head goes first, reading the old content, and then the second head updates the content.

Show that if language L can be decided in time T(n) by a one-tape two-head Turing machine, then L ∈ DTIME(T(n)2).


Prove the number of multitape Turing machines is countable.


Prove that the Post Correspondence Problem is decidable over the unary alphabet Σ = {1}.


Prove that the Post Correspondence Problem is undecidable over the binary alphabet Σ = {0, 1}, assuming that the PCP is undecidable over an arbitrary finite alphabet.


Express the *Twin Prime Conjecture* in first-order Peano Arithmetic using only the symbols 0, S, +, ×, = and quantifiers ∀, ∃.

(a) Define a formula Prime(x) expressing that x is a prime number.

(b) Define a formula TwinPrime(p) expressing that p is the smaller number of a twin prime pair.

(c) Write a single first-order PA formula that states: *for every number x, there exists a larger twin prime p > x*.