instruction stringlengths 0 29.8k ⌀ |
|---|
|complexity-theory|np-complete|np|co-np| |
null |
null |
I have so show that, for the normal 9x9 sudoku, determining whether there is a solution is just as hard as computing a solution if it exists. I should do that by assuming i have a polynomial-time algorithm for checking whether a given sudoku is solvable and i then should explain how to obtain a polynomial-time algorith... |
Proof: Solving a 9x9 sudoku is just as hard as determining whether there is a solution |
|sudoku| |
null |
We defined a polynomial-time verifier so that it has certificates of length AT MOST p(|x|) for some fixed polynomial p.
Why does it not make a difference to require a certificate $c$ to have EXACLTY length p(|x|)? |
Question about the length of certificate of an polynommial-time verifier |
|polynomial-time| |
I need to build an enumerator for $$L=\{0^{3^n}| n\ge 0\}, \Sigma = \{0\}, \Gamma = \{0, x, \sqcup\}$$ that has **at most 10 states**, including print and halt states. I can ignore the halt state and any edge that leads towards it.
I tried to approach this in the simplest way i could think of, build a Turing machine... |
Enumerator for $L=\{0^{3^n}| n\ge 0\}$ |
|turing-machines|enumeration| |
null |
This is an interesting question. I partially agree and partially disagree with previous answers so maybe it is worth adding mine.
Of course, a QC is different from old-time analog computers, but only because of its "quantumness", which has little to do with its being analog vs digital. A QC is definitely **not a dig... |
I think I found an answer to my first question by sort of splitting $q0$, merging half of it into $q1$ and merging the $I$ state into the rest of it[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/TXUsl.png
In the new machine, I use the blank, $\sqcup$, at the start of the tape to mark t... |
null |
null |
The definition of PPAD (Polynomial parity arguments on directed graphs) revolves around the definition of "End-Of-The-Line"
> An exponentially large **polynomial-depth arithmetic circuit**, $f$, specifies a graph where every node has an in-degree and out-degree of at most $1$. Given that $0$'s in-degree doesn't matc... |
Why is End-Of-The-Line defined in terms of "Arithmetic circuits" instead of "Boolean circuits" |
|circuits|boolean-complexity| |
I would propose to do some researching in the field of **Stance Classification**. Given a target claim or argument we can classify whether a number of sentences are in favor, against or neither of that claim. So an idea is to extract the topic of those sentences classify whether they agree or disagree with it and depen... |
null |
Instead of a variable-length certificate $c$, you can always modify the certificate to have the form $\text{len}(c), c, 00\cdots 0$ where you append enough zeros to pad it out to the max length, thus yielding a fixed-length certificate. |
There are no directions that are likely to be accessible to an amateur. The problem is believed to be extremely hard. No one knows of any directions that are believed to be very promising. Instead, I recommend that you work on a different problem. |
This is an interesting question. I partially agree and partially disagree with previous answers so maybe it is worth adding mine.
Of course, a QC is different from old-time analog computers, but only because of its "quantumness", which has little to do with its being analog vs digital. A QC is definitely **not a dig... |
null |
Grover's algorithm assumes $U_f$ computing a function $f$ as an oracle input. But in practice, an oracle isn't given. Instead a circuit computing $f$ is given. So let's assume a reversible circuit, $C \colon \{0, 1\}^{N + 1} \mapsto \{0, 1\}^{N+1}$ that computes $C(x, y) = (x, y \oplus f(x))$, where $f \colon \{0, 1\} ... |
Quantum search with input as a circuit |
|search-algorithms|quantum-computing|search-problem| |
Grover's algorithm assumes $U_f$ computing a function $f$ as an oracle input. But in practice, an oracle isn't given. Instead a circuit computing $f$ is given. So let's assume a reversible circuit, $C \colon \{0, 1\}^{N + 1} \mapsto \{0, 1\}^{N+1}$ that computes $C(x, y) = (x, y \oplus f(x))$, where $f \colon \{0, 1\}^... |
Quantum search with input as a classical circuit |
null |
null |
Let's say you have 20 boxes filled out.
You put the number 1 in the first empty box and check if a solution exists. If yes, you put down 1 in the first empty box permanently and now you have a problem with 21 boxes filled out. If no, you put the number 2 in the first empty box and try again, up to 9. If you don't f... |
|search-algorithms|circuits|quantum-computing|search-problem| |
null |
Let $L$ be the language of having words of infinite length on $\{0,1\}^\omega$ such that any finite prefix of a word in $L$ has as many $0$'s as $1$'s. Then is $L$ büchi recognisable?
I think that $L$ is not $\omega$ regular, but standard tricks such as complementation or intersecting with some other language doesn... |
Is the language with as many 0 as 1 on any prefix $\omega$ regular? |
|regular-languages|automata|buchi-automata| |
Let $L$ be the language of having words of infinite length on $\{0,1\}^\omega$ such that any finite prefix of a word in $L$ has at least as many $0$'s as $1$'s. Then is $L$ büchi recognisable?
I think that $L$ is not $\omega$ regular, but standard tricks such as complementation or intersecting with some other langu... |
Is the language with at least as many 0 as 1 on any prefix $\omega$ regular? |
null |
This is an interesting question. I partially agree and partially disagree with previous answers so maybe it is worth adding mine.
Of course, a QC is different from old-time analog computers, but only because of its "quantumness", which has little to do with its being analog vs digital. A QC is definitely **not a dig... |
Let $X$ be the chosen subset of inputs to which we can restrict 3-SAT such that algorithm A remains superpolynomial.
>Then no algorithm A’ that solves 3-SAT’ can run in polynomial time on average
This does not follow from your argument. At best, assuming you can determine whether input lies in $X$ in polynomial ... |
Towards a contradiction, suppose $L$ is $\omega$-regular. Then $$L= A_1B_1^\omega\cup A_2B_2^\omega\cup\cdots\cup A_nB_n^\omega$$
for some $n$, where $A_i$ and $B_i$ are regular languages for all $i$.
Consider the word $s=0^11^10^21^20^31^3\cdots\in L$. WLOG, suppose $s\in A_1B_1^\omega$.
Let $p$ be a pumping l... |
|big-o-notation| |
In general, SCCP will remove the unreachable blocks based on the previous const propagation, that's why it can propagate more constant (some phi's oprands can be removed)
And it's sparse, which means it runs on SSA form IR, that would make the analysis and procedure faster.
I read from a blog that there are four... |
null |
Let $L$ be the language of infinite words in $\{0,1\}^\omega$ such that any finite prefix of a word in $L$ has at least as many $0$'s as $1$'s. Is $L$ büchi recognisable?
I think that $L$ is not $\omega$ regular, but standard tricks such as complementation or intersecting with some other language don't seem to work... |
|regular-languages|automata|buchi-automata|omega-automata| |
I'm having a hard time describing this problem without an example, so let's go with this: Say you have a program folder that contains many files. There are some files you could delete and, while the program might be crippled, it would still run. We're assuming each file is independent from the others, so behind the sce... |
Finding the smallest subset s.t. all elements satisfy condition, using as few tests as possible |
|algorithms|optimization|search-problem| |
I'm having a hard time describing this problem without an example, so let's go with this: Say you have a program folder that contains many files. There are some files you could delete and, while the program might be crippled, it would still run. We're assuming each file is independent from the others, so behind the sce... |
I'm having a hard time describing this problem without an example, so let's go with this: Say you have a program that is made up of many files. There are some files you could delete, and, while it might be crippled, the program could still run. We're assuming each file is independent from the others, so behind the scen... |
$f+g$ being larger than both $f$ and $g$, the lower bound of $g$ still holds. And we know nothing about the upper bound. |
$f+g$ being larger than $g$, the lower bound of $g$ still holds. And we know nothing about the upper bound. |
As you suspected, $L$ is not büchi recognisable/$\omega$-regular. Here is a proof.
------
Towards a contradiction, suppose $L$ is $\omega$-regular. Then $$L= A_1B_1^\omega\cup A_2B_2^\omega\cup\cdots\cup A_nB_n^\omega$$
for some $n$, where $A_i$ and $B_i$ are regular languages for all $i$.
Consider $s=0^11^10... |
I'm having a hard time describing this problem without an example, so let's go with this: Say you have a program that is made up of many files. There are some files you could delete, and, while it might be crippled, the program could still run. We're assuming each file is independent from the others, so behind the scen... |
I'm having a hard time describing this problem without an example, so let's go with this: Say you have a program that is made up of many files. There are some files you could delete, and, while it might be crippled, the program could still run. We're assuming each file is independent from the others, so behind the scen... |
Good morning,
I am trying to figure out the solution to this problem:
In this problem we consider two stacks A and B manipulated using the
following operations (n denotes the size of A and m the size of B):
PushA(x): Push element x on stack A.
PushB(x): Push element x on stack B.
MultiPopA(k): Pop min(k... |
Finding the Equation for Potential Method and Amortization Analysis |
|algorithms|amortized-analysis| |
I know the answer if it was OR would be `(1*01*01*)* U 0*10*10*`, but with the AND I have no clue how this can be achieved. There are lot's concatenations that I can't cover by getting the regular expression. |
Regular Expression of {w : w contains an even number of 0s and exactly two 1s} |
|automata|regular-expressions|discrete-mathematics| |
null |
There are a limited number of cases. For instance, one case has an odd number of 0's followed by consecutive 1's, followed by an odd number of 0's. Another case is that there is an initial 1, followed by an even number of 0's, followed by a terminating 1. List all the cases and make up an OR-type expression to cover... |
I am trying to figure out the solution to this problem:
In this problem we consider two stacks $A$ and $B$ manipulated using the
following operations ($n$ denotes the size of $A$ and $m$ the size of $B$):
PushA($x$): Push element $x$ on stack $A$.
PushB($x$): Push element $x$ on stack $B$.
MultiPopA(... |
|algorithms|amortized-analysis|stacks| |
I've tried to expand the recursion:
$$T(n) = T(n^{\frac{1}{2}}) + 5n = T(n^{\frac{1}{4}}) + 5(n^{\frac{1}{2}} + n) = T(n^{\frac{1}{8}}) + 5(n^{\frac{1}{4}} + n^{\frac{1}{2}} + n)$$
We have a total of $\log_2(n)$ elements in the recursion. So we can easily find an upper bound:
$$T(n) = O(n\cdot \log_2(n))$$
Th... |
Find the asymptotic bound for the recurrence relation: $T(n) = T(\sqrt{n}) + 5n$ |
|asymptotics|recurrence-relation| |
I've tried to expand the recursion:
$$T(n) = T(n^{\frac{1}{2}}) + 5n = T(n^{\frac{1}{4}}) + 5(n^{\frac{1}{2}} + n) = T(n^{\frac{1}{8}}) + 5(n^{\frac{1}{4}} + n^{\frac{1}{2}} + n)$$
We have a total of $\log_2(n)$ elements in the recursion. So we can easily find an upper bound:
$$T(n) = O(n\cdot \log_2(n))$$
Th... |
You can use induction to show that $T(n) = O(n)$.
More concretely, try to prove using induction that you can find a $c\in \mathbb{R}^+$ and $n_0\in \mathbb{N}$ such that for all $n>n_0$, it will hold that $T(n) < cn$.
Basically, substituting this in the induction will reduce your recurrent formula into a simple e... |
Let's say you have 20 boxes filled out.
You put the number 1 in the first empty box and check if a solution exists. If yes, you put down 1 in the first empty box permanently and now you have a problem with 21 boxes filled out. If no, you put the number 2 in the first empty box and try again, up to 9. If you don't f... |
Take an out-of-order processor. At any cycle, there may be multiple instructions ready for execution. The choice which to execute next can affect the total execution time in unpredictable (for the processor) ways.
Register forwarding can lead to a different instruction being executed next, with a different total ex... |
Your algorithm is a good one, about as good as you can get.
If you care about the worst-case number of tests, your algorithm is optimal. Let $n$ denote the total number of files. Then any algorithm must perform at least $n$ queries in some cases. There are $2^n$ possibilities for the final answer (since there are... |
Is it true or false that $n^{n} \mathcal{O}(n!)$ ?
Any suggestions how to prove/disprove this statement? |
Is $n^n$ is a big-oh n factorial |
|asymptotics|big-o-notation| |
Is it true or false that $n^{n} \in \mathcal{O}(n!)$ ?
Any suggestions how to prove/disprove this statement? |
Amortized analysis is a technique for showing how to distribute the total cost of a worst case sequence of operations among all the operations in the sequence to get an average cost. So even if there are operations that are expensive, as long as there are enough cheap operations, the average cost will be cheap. In your... |
I am trying to come up with an algorithm to find the minimal representation of the transformation from a zero matrix to a target matrix.
Specifically, I have an empty matrix and can perform operations such as `set(x1,y1,x2,y2)` and `unset(x1,y1,x2,y2)` to edit submatrices.
I looked at some greedy algorithms and quadt... |
Writing an Algorithm to Represent a Bit Matrix in Minimal Operations? |
|algorithms|optimization|matrices| |
Amortized analysis is a technique for showing how to distribute the total cost of a worst case sequence of operations among all the operations in the sequence to get an average cost. So even if there are operations that are expensive, as long as there are enough cheap operations, the average cost will be cheap. In your... |
null |
I've tried to expand the recursion:
$$T(n) = T(n^{\frac{1}{2}}) + 5n = T(n^{\frac{1}{4}}) + 5(n^{\frac{1}{2}} + n) = T(n^{\frac{1}{8}}) + 5(n^{\frac{1}{4}} + n^{\frac{1}{2}} + n)$$
We have a total of $\log_2(n) + 1$ elements in the recursion. So we can easily find an upper bound:
$$T(n) = O(n\cdot \log_2(n))$$
... |
null |
I've tried to expand the recursion:
$$T(n) = T(n^{\frac{1}{2}}) + 5n = T(n^{\frac{1}{4}}) + 5(n^{\frac{1}{2}} + n) = T(n^{\frac{1}{8}}) + 5(n^{\frac{1}{4}} + n^{\frac{1}{2}} + n)$$
We have a total of $\lfloor\log_2(n)\rfloor + 1$ elements in the recursion. So we can easily find an upper bound:
$$T(n) = O(n\cdot ... |
I believe the problem is NP-hard, even with only set(), and is even hard to approximate within a factor better than 2. See https://mathoverflow.net/q/105164/37212, https://cstheory.stackexchange.com/q/12376/5038, https://stackoverflow.com/q/3516044/781723, https://en.wikipedia.org/wiki/Polygon_covering.
A pragmatic... |
$\lim_{n \to \infty} \frac{n^n}{n!} = \lim_{n \to \infty} \prod_{i=1}^n \frac{n}{i} \ge \lim_{n \to \infty} \prod_{i=1}^{\lfloor n/2 \rfloor} \frac{n}{i} \ge \lim_{n \to \infty}2^{\lfloor n/2 \rfloor} = +\infty.$ |
Let us assume that for all $n\ge n_0$
$$c_0 n\le T(n)\le c_1 n$$
and ensure that
$$c_0 n\le T(\sqrt n)+5n\le c_1 n.$$
Now if we write
$$c_0\sqrt n\le T(\sqrt n)\le c_1\sqrt n$$ which is
$$c_0\sqrt n+5n\le T(\sqrt n)+5n\le c_1\sqrt n+5n$$
the inequalities are fulfilled when
$$c_0n\le c_0\sqrt n+... |
Taking the square root of $n$ halves the number of bits, so you indeed halve that number $\lg n$ times before the iterated square root falls below some predefined constant (say $2$).
Now we can write
$$n+\sqrt n+\sqrt[4]n+\sqrt[8]n+\cdots<n+\sqrt n+\sqrt n+\sqrt n+\cdots=n+\sqrt n\lg n,$$ which is $O(n)$.
--... |
$\lim_{n \to \infty} \frac{n^n}{n!} = \lim_{n \to \infty} \prod_{i=1}^n \frac{n}{i} \ge \lim_{n \to \infty} \prod_{i=1}^{\lfloor n/2 \rfloor} \frac{n}{i} \ge \lim_{n \to \infty}2^{\lfloor n/2 \rfloor } = +\infty.$ |
null |
$$\frac{n^n}{n!}=\frac{n\cdot n\cdot n\cdots n\cdot n}{n(n-1)(n-2)\cdots 2\cdot 1}=1\,\frac{n}{n-1}\frac{n}{n-1}\cdots\frac n2\,n>1\cdot1\cdot1\cdots1\cdot n$$ is sufficient.
(In fact, by the same argument the ratio is $\Omega(n^k)$ for all $k$.) |
$$\frac{n^n}{n!}=\frac{n\cdot n\cdot n\cdots n\cdot n}{n(n-1)(n-2)\cdots 2\cdot 1}=\frac nn\frac{n}{n-1}\frac{n}{n-1}\cdots\frac n2\frac n1>1\cdot1\cdot1\cdots1\cdot n$$ is sufficient.
(In fact, by the same argument the ratio is $\Omega(n^k)$ for all $k$.) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.