instruction stringlengths 0 29.8k ⌀ |
|---|
|time-complexity|np|decision-problem|linear-complexity| |
A boolean expression is valid if it is true for every valuation. The problem
$\text{BOOL-VAL}$ asks whether a given boolean expression is valid. As the question suggests I need to show that $\text{BOOL-VAL}$ is decidable in linear time. I have no idea how to go about proving this.
Is $\text{BOOL-VAL}$ the complemen... |
null |
A boolean expression is valid if it is true for every valuation. The problem
$\text{BOOL-VAL}$ asks whether a given boolean expression is valid. As the question suggests I need to show that $\text{BOOL-VAL}$ is decidable in linear time. I have no idea how to go about proving this.
Is $\text{BOOL-VAL}$ the complemen... |
No. What you are trying to show is not correct. As far as we know, there is no efficient algorithm to test whether an arbitrary boolean expression is valid.
If $\varphi$ is a boolean formula in CNF format, then $\neg \varphi$ is valid iff $\varphi$ is unsatisfiable. So if you had a linear-time algorithm to test f... |
Given a definite program, how can I obtain its Herbrand base?
For instance, given the program $P$ below, what is its Herbrand base $B_P$?
> $p(f(x)) \leftarrow p(x)$
> $q(a) \leftarrow p(x)$
I know the definition of Herbrand base for a first-order language $L$, which relies on the concept of a Herbrand univ... |
Given a definite program, how do I obtain its Herbrand base? |
|prolog| |
If $S$ is a set of formulas, by abuse of language, we can talk about the Herbrand base $B_S$ of $S$ instead of the Herbrand base $B_L$ of the underlying first-order language $L$ from which the formulas come. Now, recall that a program $P$ is a set of formulas, and you will know what he meant by $B_P$.
In the partic... |
null |
I am missing implementation details but I included the steps I am following and existing implementation. Is my logic right and does anyone have any ideas on how I can go about implementing this?
Logic:
Create a non-deterministic Turing machine that accepts if there exists a factor of n less than k, and rejects other... |
I am attempting to make a reduction algorithm from prime factorization to hamiltonian path finding. Is my logic and implementation right? |
|algorithms|complexity-theory|graphs|turing-machines|np-complete| |
If protein folding is supposedly an NP-complete problem, does deepmind deserve a millenium prize? What am I missing? |
Protein folding P vs. NP |
|algorithm-analysis| |
I am currently studying Computer Network, and I have some problems when encountered CSMA/CD, I can understand how it works, but I am struggling in understanding this graph, anyone can give me some help?
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/yfDtf.png |
How to understand CSMA/CD algorithm from this graph? |
|computer-networks| |
null |
Because it store the data and program in a single memory space.As compare to other computer architecture it is cheaper because it has no physical sepration between the data and instruction.It execute the single instruction with a double clock cycle and it can access the instruction but can't read and write at a same ti... |
So I've been really confused about the act of flipping a kernel in image processing. Is there any intuitive way to think about it or does it only help computing efficiently and maintain the mathematical symmetry? \
Do we necessarily flip a kernel in image processing? (say the kernel is not symmetrical). Do we only fli... |
Does flipping the kernel in image processing only help maintain mathematical symmetry? |
|image-processing|os-kernel| |
|image-processing|os-kernel|kernel-functions| |
|image-processing|kernel-functions| |
From the definition I know that regular grammar should be Left/Right Linear (ie it should have variable on Left/Right side of each production rules)
But, my question is why it is mandatory?
Can't we have "Grammar which has DFA(Determistic Finite Automata) or NFA be called Regular Grammar"?
S --> SaS | e (e is e... |
Why Regular Grammar is Left/Right Linear? |
|regular-languages|finite-automata|formal-grammars|theory| |
The $\mathsf{P}$ vs. $\mathsf{NP}$ problem asks whether $\mathsf{P}=\mathsf{NP}$. To settle this problem one needs to either provide a *formal* proof that $\mathsf{P}=\mathsf{NP}$ or a *formal* proof that $\mathsf{P}\neq\mathsf{NP}$.
One possible proof for $\mathsf{P}=\mathsf{NP}$ consists in exhibiting a polynomi... |
The boring answer is: The phrase "regular grammar" means what it means, because we have decided that it means that. Had we decided it should mean something else, it would mean something else.
That aside, it is of course legitimate to ask whether
> Definition A: "A *regular grammar* is a grammar that is either ri... |
The idea is exactly the same: an undirected graph $G = (V, E)$ has an independant set of size $k$ if and only if the graph $(\{1,…,k\}, \emptyset)$ (the graph with $k$ vertices and no edge) is isomorphic to a subgraph of $G$. |
My supposition is that this is was more or less an automatic designation based on the fact that [Rule 110](https://en.wikipedia.org/wiki/Rule_110) requires an infinite "background tiling" of the 14-bit sequence `00010011011111`, and since by convention a proper Turing-complete system is supposed to begin with a blank t... |
Why is Rule 110 considered "weakly" universal? |
|computation-models|turing-completeness|cellular-automata| |
If there is an algorithm with time complexity $O(n^{n/log(n)})$, is that already exponential time or still subexponential time?
It shouldn't be considered quasi-polynomial since the exponent is also depending on $n$, right? |
Is time complexity $O(n^{n/log(n)})$ considered subexponential time? |
|time-complexity|runtime-analysis| |
I have the following predicate: $empty(r)\Leftrightarrow L(r)=\emptyset.$ Now I am given the following regular expressions where $e, f$ are any regular expression:
- $r=\emptyset$
- $r=\varepsilon$
- $r=a:\forall\in\Sigma$
- $r=e+f$
- $r=ef$
- $r=e^*$
Now I have to write a recursive definition for $empty(r)$... |
How to make a recursive definition for a given predicate? |
|regular-languages|regular-expressions| |
I recognize that it has overwhelming consensus at this point, but from what I understand, it's still technically considered "probably true" instead of "definitely true".
If we go by their original definition, then it amounts to dealing with things that can be accomplished by "effective methods", meaning finite sets ... |
Why is the Church-Turing thesis not accepted as fact? |
|turing-completeness|church-turing-thesis| |
Let $L, L_1, L_2$ be regular languages.
- if $L = L_1\cup L_2$, then $L$ is empty if and only if $L_1$ is empty **AND** $L_2$ is empty;
- if $L = L_1L_2$, then $L$ is empty if and only if $L_1$ is empty **OR** $L_2$ is empty;
- if $L = L_1^*$, then $L$ is not empty.
That should do it for induction. |
$$n^{\tfrac{n}{\log_2 n}} = 2^{\tfrac{n}{\log_2 n}\times \log_2 n} = 2^n$$ |
$$n^{\tfrac{n}{\log_2 n}} = (2^{log_2 n})^{\tfrac{n}{\log_2 n}} = 2^{\tfrac{n}{\log_2 n}\times \log_2 n} = 2^n$$ |
$$n^{\tfrac{n}{\log_2 n}} = (2^{\log_2 n})^{\tfrac{n}{\log_2 n}} = 2^{\tfrac{n}{\log_2 n}\times \log_2 n} = 2^n$$ |
I'm attempting to solve this problem:
Given an undirected connected graph $G=(V,E)$ with $weight(e)>0 , \forall e\in E$, and a subgroup $S \subseteq V$, we define that a sub-graph $H=(V',E')$ of $G$ spans $S$ if:
$S \subseteq V'$ ,
and $H$ is connected.
We define $H$ to be **Minimal Spanning** if the sum... |
Algorithm to find Minimal Spanning Subgraph |
|algorithms|graphs|weighted-graphs|connected|subgraphs| |
To my understanding, what you are looking at is a [Steiner tree problem](https://en.wikipedia.org/wiki/Steiner_tree_problem#Steiner_tree_in_graphs_and_variants) variant.
This is a $\mathsf{NP}$-hard problem, so it's no wonder you have difficulties solving it.
Maybe you can find some answers [here](https://arxiv.o... |
null |
I'm attempting to solve this problem:
Given an undirected connected graph $G=(V,E)$ with $\mathrm{weight}(e)>0$ for all $e \in E$, and a subset $S \subseteq V$, we define that a sub-graph $H=(V',E')$ of $G$ **spans** $S$ if $S \subseteq V'$ and $H$ is connected.
We define $H$ to be **minimal spanning** if the s... |
Since there are only three vertices in ***S***, you can solve this problem by solving the following integer program. Let $w(e)$ be the weight of edge $e$ and $x_e$ a binary variable indicating if $e \in H$. We also define $\delta(U) = \{uv \in E: u \in U, v \notin U\}$ for some $U \subseteq V$.
$min$ $\Sigma(w(e)x_e... |
I strongly believe the answer from fade2black is wrong. The empty language is not recursive, in fact it is not even recursive enumerable. The question you have to ask yourself is given any encoding of a turing machine M, can we determine if its language is the empty language. Intuitively you would have to check all pos... |
I strongly believe the answer from fade2black is wrong. The empty language is not recursive, in fact it is not even recursive enumerable. The question you have to ask yourself is given any encoding of a turing machine M, can we determine if its language is the empty language.
The way you can formally prove this would ... |
null |
I think these datasets meet your constraints, [wn18rr][1] and [proteins][2]. I found them by looking [here][3].
[1]: https://paperswithcode.com/dataset/wn18rr
[2]: https://paperswithcode.com/dataset/proteins
[3]: https://paperswithcode.com/datasets?mod=graphs |
null |
1. The conversion of CNF to DNF is exponential in the worst case. There are no tricks that avoid writing out an exponential number of clauses. It is not obvious to me that the little-o notation with *exp* is correct, but, yes, it is exponential.
2. No. The NP-complete satisfiability problem you are thinking of is ... |
What is the asymptotic complexity of doing a convolution of an unbounded Gaussian on an NxN input matrix $M$?
The naive approach is $O(n^4)$ ($R_{ij} = \sum_{k=1}^{n}\sum_{l=1}^{n}M_{kl}*g(\sqrt{(k-i)^2 + (l-j)^2})$; $O(n^2)$ work on each of $O(n^2)$ elements); there is a fairly trivial lower bound of $O(n^2)$ (at l... |
Complexity of unbounded Gaussian convolution |
|algorithms|asymptotics|matrices| |
null |
Using [FFT][1] the time complexity can be reduced to $O(n^2 log^2n)$ see this [answer][2]
[1]: https://en.wikipedia.org/wiki/Convolution_theorem
[2]: https://stackoverflow.com/questions/16164749/computational-complexity-of-convolution |
Suppose we are given $m$ points on $\mathbb{R}^2$. Consider $n=1, 2, 3, \dotsc$; we want to cover the $m$ points with $n$ triangles (of any shape) while minimizing the total area of the $n$ triangles.
I first consider the case when $n=1$. We create a convex hull (a polygon) that contains all $m $ points. And by usi... |
A covering problem -- find $n$ triangles to cover $m$ points and minimize the total area of the $n$ triangles |
|algorithms|computational-geometry|linear-programming| |
Flipping the kernel comes from the pure-math context of a convolution, where it is a natural thing to do. See this part of [3b1b's video][1] on convolutions where he gives a great intuitive answer to your question.
[1]: https://youtu.be/KuXjwB4LzSA?t=807 |
null |
No. What you are trying to show is not correct. As far as we know, there is no efficient algorithm to test whether an arbitrary boolean expression is valid.
If $\varphi$ is a boolean formula in CNF format, then $\neg \varphi$ is valid iff $\varphi$ is unsatisfiable. So if you had a linear-time algorithm to test f... |
null |
Because what can be effectively carried out depends on what is possible within the physics of our universe. So if we have not correctly understood physics, it is possible that perhaps more might be possible than we can currently imagine. While that doesn't seem likely, it's not something we can absolutely definitivel... |
1. The conversion of CNF to DNF is exponential in the worst case. There are no tricks that avoid writing out an exponential number of clauses. It is not obvious to me that the little-o notation with *exp* is correct, but, yes, it is exponential.
2. No. The NP-complete satisfiability problem you are thinking of is ... |
Is there a reasonably accurate method of computing an FFT of logarithmically-represented input data (with a sign bit, that is $±2^{\text{double-precision value}}$)?
The naive method (convert to linear representation, do an ordinary FFT, and convert back to logarithmic representation) very quickly runs into overflow/... |
FFT of logarithmic input data |
|floating-point|numerical-algorithms|fast-fourier-transform| |
null |
null |
I recently had this question answered on stack exchange:
https://cs.stackexchange.com/questions/156036/if-x-is-in-np-but-y-is-not-in-np-then-can-x-be-reduced-to-y
The answer proposed a counter example using an element of complexity theory I had not given much thought to, specifically it was the problem
> $A = ... |
The meaning of Tautology and Contradiction in Complexity theory |
|complexity-theory|np|decision-problem| |
I am missing implementation details but I included the steps I am following as of now and an existing attempt at implementation. Are there better/simpler ways to go about this?
Logic:
Create a non-deterministic Turing machine that accepts if there exists a factor of n less than k, and rejects otherwise. This Turing ... |
I am attempting to make a reduction algorithm from prime factorization to hamiltonian path finding and am unsure of the exact steps to take |
I hope this question is not out of place here, but I am currently attempting to implement the problem stated in the Title. I included the steps I am following as of now and an existing attempt at implementation. Are there better/simpler ways to go about this?
Logic:
Create a non-deterministic Turing machine that acc... |
null |
null |
In the following let $\Sigma=\{0, 1\}$. I'll prove that *every* language over $\Sigma$ is recognizable.
Let $L\subseteq\Sigma^*$. Let $w_1,w_2,\ldots$ be the list of words in $L$. For every $i=1,2,\ldots$, let $M_i$ be the Turing machine that *decides* the language $\{w_i\}$, which trivially exists. Consider a Turin... |
What is wrong with this proof that shows every language over $\Sigma=\{0, 1\}$ is recognizable? |
|formal-languages|turing-machines|turing-recognizable| |
null |
I hope this question is not out of place here, but I am currently attempting to implement the problem(a reduction algorithm) stated in the Title. I included the steps I am following as of now and an existing attempt at implementation. Are there better/simpler ways to go about this?
Logic:
Create a non-deterministic ... |
Is there a known method for reducing the problem of prime factorization to the problem of determining if a hamiltonian path exists? |
Yes, your reduction looks correct, as far as I can see. I only skimmed it and didn't check every detail carefully.
A computer scientist would probably give a shorter proof that such a reduction exists. First, they would show that the factoring problem is in NP: specifically, to test whether $n$ has a factor less t... |
null |
The problem is that $M$ doesn't (in general) exist.
If $L$ is infinite, then there will be infinitely many $M_i$. So you can't do something like building all the states of all the $M_i$ into $M$ in some kind of sequence, as that would lead to infinitely many states.
Instead, you would have to try to build $M$ via... |
null |
null |
I am currently working my way through _[Language Models are Few-Shot Learners
](https://arxiv.org/abs/2005.14165)_, the initial 75-page paper about [GPT-3](https://en.wikipedia.org/wiki/GPT-3), the language learning model spawning off into ChatGTP.
In it, they mention several times that they are using **175 billion... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.