Posted on Categories:Computational Complexity, 数学代写, 计算复杂度

# 数学代写|计算复杂度代写Computational Complexity代考|ENCM517 Warmup: Expressiveness of boolean formulae

avatest™

## avatest™帮您通过考试

avatest™的各个学科专家已帮了学生顺利通过达上千场考试。我们保证您快速准时完成各时长和类型的考试，包括in class、take home、online、proctor。写手整理各样的资源来或按照您学校的资料教您，创造模拟试题，提供所有的问题例子，以保证您在真实考试中取得的通过率是85%以上。如果您有即将到来的每周、季考、期中或期末考试，我们都能帮助您！

•最快12小时交付

•200+ 英语母语导师

•70分以下全额退款

## 数学代写|计算复杂度代写Computational Complexity代考|Warmup: Expressiveness of boolean formulae

As a warmup for the proof of Lemma $2.12$ we show how to express various conditions using CNF formulae.
EXAMPLE $2.13$
The formula $(a \vee \bar{b}) \wedge(\bar{a} \vee b)$ is in CNF form. It is satisfied by only those values of $a, b$ that are equal. Thus, the formula
$$\left(x_1 \vee \bar{y}_1\right) \wedge\left(\bar{x}_1 \vee y_1\right) \wedge \cdots \wedge\left(x_n \vee \bar{y}_n\right) \wedge\left(\bar{x}_n \vee y_n\right)$$
is True if and only if the strings $x, y \in{0,1}^n$ are equal to one another.
Thus, though $=$ is not a standard boolean operator like $\vee$ or $\wedge$, we will use it as a convenient shorthand since the formula $\phi_1=\phi_2$ is equivalent to (in other words, has the same satisfying assignments as $)\left(\phi_1 \vee \overline{\phi_2}\right) \wedge\left(\phi_1 \vee \phi_2\right)$

In fact, CNF formulae of sufficient size can express every Boolean condition, as shown by the following simple claim: (this fact is sometimes known as universality of the operations AND, OR and NOT)
CLAIM $2.14$
For every Boolean function $f:{0,1}^{\ell} \rightarrow{0,1}$ there is an $\ell$-variable CNF formula $\varphi$ of size $\ell 2^{\ell}$ such that $\varphi(u)=f(u)$ for every $u \in{0,1}^{\ell}$, where the size of a CNF formula is defined to be the number of $\wedge / \vee$ symbols it contains.

## 数学代写|计算复杂度代写Computational Complexity代考|Proof of Lemma 2.12

Let $L$ be an NP language and let $M$ be the polynomial time TM such that that for every $x \in{0,1}^$, $x \in L \Leftrightarrow M(x, u)=1$ for some $u \in{0,1}^{p(|x|)}$, where $p: \mathbb{N} \rightarrow \mathbb{N}$ is some polynomial. We show $L$ is polynomial-time Karp reducible to SAT by describing a way to transform in polynomial-time every string $x \in{0,1}^$ into a CNF formula $\varphi_x$ such that $x \in L$ iff $\varphi_x$ is satisfiable.

How can we construct such a formula $\varphi_x$ ? By Claim $2.14$, the function that maps $u \in{0,1}^{p(|x|)}$ to $M(x, u)$ can be expressed as a CNF formula $\psi_x$ (i.e., $\psi_x(u)=M(x, u)$ for every $\left.u \in{0,1}^{p(|x|)}\right)$. Thus a string $u$ such that $M(x, u)=1$ exists if and only if $\psi_x$ is satisfiable. But this is not useful for us, since the size of the formula $\psi_x$ obtained from Claim $2.14$ can be as large as $p(|x|) 2^{p(|x|)}$. To get a smaller formula we use the fact that $M$ runs in polynomial time, and that each basic step of a Turing machine is highly local (in the sense that it examines and changes only a few bits of the machine’s tapes).

In the course of the proof we will make the following simplifying assumptions about the TM M: (1) $M$ only has two tapes: an input tape and a work/output tape and (2) $M$ is an oblivious TM in the sense that its head movement does not depend on the contents of its input tape. In particular, this means that $M$ ‘s computation takes the same time for all inputs of size $n$ and for each time step $i$ the location of $M$ ‘s heads at the $i^{\text {th }}$ step depends only on $i$ and $M$ ‘s input length.
We can make these assumptions without loss of generality because for every $T(n)$-time TM $M$ there exists a two-tape oblivious TM $\tilde{M}$ computing the same function in $O\left(T(n)^2\right)$ time (see Remark $1.10$ and Exercise 8 of Chapter 1). ${ }^4$ Thus in particular, if $L$ is in NP then there exists a two-tape oblivious polynomial-time TM $M$ and a polynomial $p$ such that $x \in L \Leftrightarrow \exists u \in$ ${0,1}^{p(|x|)}$ s.t. $M(x, u)=1$.

The advantage of assuming that $M$ is oblivious is that for any given input length, we can define functions inputpos $(i), \operatorname{prev}(i)$ where inputpos $(i)$ denotes the location of the input tape head at the $i^{\text {th }}$ step and prev $(i)$ denotes the last step before $i$ that $M$ visited the same location on its work tape, see Figure 2.3. ${ }^5$ These values can be computed in polynomial time by simulating $M$ on, say, the all-zeroes input.

## 数学代写|计算复杂度代写计算复杂度代考|预热:布尔公式的表达

EXAMPLE $2.13$

$$\left(x_1 \vee \bar{y}_1\right) \wedge\left(\bar{x}_1 \vee y_1\right) \wedge \cdots \wedge\left(x_n \vee \bar{y}_n\right) \wedge\left(\bar{x}_n \vee y_n\right)$$

CLAIM $2.14$

## MATLAB代写

MATLAB 是一种用于技术计算的高性能语言。它将计算、可视化和编程集成在一个易于使用的环境中，其中问题和解决方案以熟悉的数学符号表示。典型用途包括：数学和计算算法开发建模、仿真和原型制作数据分析、探索和可视化科学和工程图形应用程序开发，包括图形用户界面构建MATLAB 是一个交互式系统，其基本数据元素是一个不需要维度的数组。这使您可以解决许多技术计算问题，尤其是那些具有矩阵和向量公式的问题，而只需用 C 或 Fortran 等标量非交互式语言编写程序所需的时间的一小部分。MATLAB 名称代表矩阵实验室。MATLAB 最初的编写目的是提供对由 LINPACK 和 EISPACK 项目开发的矩阵软件的轻松访问，这两个项目共同代表了矩阵计算软件的最新技术。MATLAB 经过多年的发展，得到了许多用户的投入。在大学环境中，它是数学、工程和科学入门和高级课程的标准教学工具。在工业领域，MATLAB 是高效研究、开发和分析的首选工具。MATLAB 具有一系列称为工具箱的特定于应用程序的解决方案。对于大多数 MATLAB 用户来说非常重要，工具箱允许您学习应用专业技术。工具箱是 MATLAB 函数（M 文件）的综合集合，可扩展 MATLAB 环境以解决特定类别的问题。可用工具箱的领域包括信号处理、控制系统、神经网络、模糊逻辑、小波、仿真等。