instruction
stringlengths
0
29.8k
⌀
Going through some KR tutorials on resolution at the moment, and I came across this slide: http://www.cs.toronto.edu/~sheila/384/w11/ Under lectures and readings, 05.KR, slide no 77. In this slide it is mentioned that "And the procedure is also complete". I think this completeness can not mean that if a sentenc...
resolution, complete, or refutation-complete
|logic|artificial-intelligence|knowledge-representation|first-order-logic|
Going through some KR tutorials on resolution at the moment, and I came across this slide: http://www.cs.toronto.edu/~sheila/384/w11/ Under lectures and readings, 05.KR, slide no 77. In this slide it is mentioned that "And the procedure is also complete". I think this completeness can not mean that if a sentenc...
Going through some KR tutorials on resolution at the moment, and I came across this slide: http://www.cs.toronto.edu/~sheila/384/w11/ Under lectures and readings, 05.KR, slide no 77. In this slide it is mentioned that "And the procedure is also complete". I think this completeness can not mean that if a sentenc...
Resolution is complete as a refutation system. That is, if $S$ is a contradictory set of clauses, then resolution can refute $S$. So if $A$ implies $B$, then resolution can refute (the clause form of) $A \land \lnot B$.
You are confusing NP and NP-hard. The fact that a problem is (say) in L doesn't preclude it being in NP, in fact, quite the contrary: any problem which is in L is a fortiori in NP, i.e. L$\subseteq$NP. Another mistake you're making is that a problem which is approximable can't be NP-hard (or rather, its decision ver...
null
- Certainly the myriad meanings of the same (short) flags to commands is an inconsistency. - Each program that uses regular expressions has it's own syntax for them - Configuration files for services are all different syntax (that can be forgiven in part, your mailer daemon has little in common with your webserver...
Going through [some knowledge representation tutorials](http://www.cs.toronto.edu/~sheila/384/w11/) on resolution at the moment, and I came across [slide 05.KR, no77](http://www.cs.toronto.edu/~sheila/384/w11/Lectures/csc384w11-Lecture-05-KR.pdf). There it is mentioned that "the procedure is also complete". I th...
Is resolution complete or only refutation-complete?
|logic|first-order-logic|
Here's a simple question which made me confused. Please tell me if my analysis of the problem and my conclusions are correct. For an optimization problem $\sf Gap-A[a,b] \in L$ for $b>a$. I want to discuss what I can know about $\sf Gap-A[a/2,b/2]$. $\sf(i)$ Is it correct to say that $\sf Gap-A[a/2,b/2]$ is n...
Resolution is only refutationally complete, as you mentioned. This is _intended_ and very useful, because it drastically reduces the search space. Instead of having to eventually derive every possible consequence (to find a proof of some conjecture), resolution is only trying to derive the empty clause.
null
Resolution is complete as a refutation system. That is, if $S$ is a contradictory set of clauses, then resolution can refute $S$, i.e. $S \vdash \bot$. This sufficient since $T \vdash A$ is equivalent to $T \cup \{\lnot A\} \vdash \bot$. So if we want to see a formula $A$ is derivable from $T$, we only need to check...
You can always convert your formula or circuit to an equivalent CNF formula of polynomial size. The result you mention is only for 3CNF formulas. In general for kCNF-SAT the assumed threshold phenomenon happens on a point depending on $k$, the values you mention are only for 3CNF-SAT. Also remember what these res...
You can always convert your formula or circuit to an equivalent CNF formula of polynomial size. The result you mention is only for 3CNF formulas. In general for kCNF-SAT the assumed threshold phenomenon happens on a point depending on $k$, the values you mention are only for 3CNF-SAT. Also remember what these res...
I have a CTL* formula: EF[p AND AX[q U r]] but in my application, I am limited to CTL. To my understanding, this formula is no valid CTL and I wonder whether I can transform it (preserving semantic, of course). The CTL* formula should express "there exists a path on which p holds and from that point, in all subsequent ...
Convert CTL* formula to CTL
|untagged|
|logic|
I have a CTL* formula: $\mathsf{EF}[p\land \mathsf{AX}[q\ \mathsf{U}\ r]]$ but in my application, I am limited to CTL. To my understanding, this formula is no valid CTL and I wonder whether I can transform it (preserving semantic, of course). The CTL* formula should express "there exists a path on which $p$ holds and f...
You are confusing NP and NP-hard. The fact that a problem is (say) in L doesn't preclude it being in NP, in fact, quite the contrary: any problem which is in L is a fortiori in NP, i.e. L$\subseteq$NP. On the other hand, it is not likely to be NP-hard (and assuming that P$\neq$NP, if it is in L then it cannot be NP-har...
Resolution is complete as a refutation system. That is, if $S$ is a contradictory set of clauses, then resolution can refute $S$, i.e. $S \vdash \bot$. This is sufficient since $T \vdash A$ is equivalent to $T \cup \{\lnot A\} \vdash \bot$. So if we want to see a formula $A$ is derivable from $T$, we only need to ch...
I cannot imagine how cohomology is related to graph theory, actually I read solid definition from [wiki][1], and to be honest, I cannot understand it. e.g I know what is homology (in simple term), group of functions such that I can continuously convert each of them to another one, but, is there similar visualization ...
Here is a question from Daniel I. A. Cohen's book _Introduction to Computer Theory_: > Consider the language: > PRIME’ = { $a^n$ where $n$ is not a prime } = { $\epsilon, a, aaaa, aaaaaa, aaaaaaaa, \ldots$ } > (a) Prove that PRIME’ is non-regular. > (b) Prove, however, that PRIME’ does satisfy the pumping lem...
Prove that language PRIME' satisfies the Pumping Lemma
|formal-languages|automata|pumping-lemma|
Pick $xyz$ so that $|y|$ is not coprime to $|xyz|$. This does not work when $|xyz|$ does not have prime factors smaller than the pumping length though. In that case there will be a prime amongst all $|xy^nz|$ by [Dirichlet's theorem](http://en.wikipedia.org/wiki/Dirichlet's_theorem_on_arithmetic_progressions).
I'm trying to solve exercise 6.5 on page 309 from Richard Crandall's "Prime numbers - A computational perspective". It basically asks for an algorithm to factor integers in randomized polynomial time given an oracle for taking square roots modulo $n$. I think, the basic idea is the following: Given a composite numbe...
Solve Integer Factoring in randomized polynomial time with an oracle for square root modulo $n$
|randomized-algorithms|integers|factoring|
null
I cannot imagine how cohomology is related to graph theory, actually I read solid definition from [wiki][1], and to be honest, I cannot understand it. e.g I know what is homotopy (in simple term), group of functions such that I can continuously convert each of them to another one, and I think this is useful for under...
Here is a question from Daniel I. A. Cohen's book _Introduction to Computer Theory_: > Consider the language: > $\quad \mathrm{PRIME}’ = \{ a^n \mid n \text{ is not a prime} \} = \{ \varepsilon, a, aaaa, aaaaaa, aaaaaaaa, \ldots \}$ > > 1. Prove that $\mathrm{PRIME}’$ is non-regular. > 2. Prove, however,...
Prove that the language of unary not-prime numbers satisfies the Pumping Lemma
Let $w \in \mathrm{PRIME}'$ with $|w| \geq 5$. Distinguish two cases. 1. $|w|$ is even -- in that case, choose $x = \varepsilon$, $y = aa$ and $z = a^{|w|-2}$. Then, for all $i\geq 0$, we have $|xy^iz|$ is even and greater than two, as $|z| \geq 3$, and therefore not prime; $xy^iz \in \mathrm{PRIME}'$. 2. $|w|$...
S => SS* => SS+S* (leftmost derivation ) => aS+S* => aa+S* => aa+a*
in the dragonbook(Aho, Sethi, Ullmann)there is one exercise I don´t get. Chapter 2, Exercies: 2.1 Given is the context free grammar S -> S S + | S S * | a Task: Show how the signs aa+a* can be produced from this grammar. I understand the grammar, S can have the form S S + ...and so on...
Compiler - Dragonbook - Exercises question
|compilers|
Let r be the number of rows in a DRAM array, and c be the number of columns. Apparently, DRAM with organization 16x1 requires least pins when r = c = 4 because fewer address bits are required to represent them, and so does DRAM with organization 16x4. Why are these the same? Doesn't the latter have 4 columns instead...
Where do these DRAM row/column calculations come from?
|memory-management|
###Worst-case complexity **Insert**: $\mathcal{O}(1)$ **Find-min**: $\mathcal{O}(1)$ **Decrease-key**: $\mathcal{O}(1)$ **Delete**: $\mathcal{O}(\log \log n)$ **Space**: $\mathcal{O}(n)$ ###Proof > THEOREM 1. *We can implement a priority queue that with n integer keys in the range $[0 , N )$ in linear ...
Are you merely looking for unicity of the *last* character? In that case, you may mean a property such as: - the regular expression ends with a character (it is `xc` for some expression `x` and character `c`) - the language described by the regular expression ends with a character (it is `Lc` for some ...
1. Where in the analysis of the algorithm does the number of squares ("quadratic residues") come in? As to their number, you know that $a^2 \pmod{n}$ is always a square, and every number has up to $4$ square roots. That should help you show that there are a lot of squares. 2. Try to prove that your algorithm works, an...
How to design a UTM in which the simulation time of a TM M is only O($log|T|+log|Q|$) times more than the original execution time of M . Where T and Q are the tape alphabet and states of M respectively.
UTM simulation time
|complexity-theory|turing-machines|
The basic idea is to have one or more symbol in the pattern that clearly indicate the end. For example $ab^*c$, $(a|b)c$, $ab^+c$, $ab?c$ or $a(b|c)$ are non-ambiguous, but $abc^*$, $abc^+$ or $abc?$ are ambiguous.
null
null
You fell into the trap of thinking that formal language theory deals with meaning. It doesn't. In formal language theory, a context-free language is ambiguous if some context-free grammar generates exactly that language, while none of them do so in such a way that each string in the language has only a single parse ...
New try at formalising, with the extra information: $L$ is non-ambiguous if $L=\bigcup_{c\in S} L_cc$ and $\forall c_1,c_2\in S,\forall a,b\in\Sigma^*, ac_1b\notin L_{c_2}$, or in plain text: there is a set $S$ of characters that occur only at the end of the words. Sorry but I don't know any name for those. I gu...
The basic idea is to have one or more symbol in the pattern that clearly indicate the end. For example: Non-ambiguous: > $ab^*c$ $(a|b)c$ > $ab^+c$ > $ab?c$ > $a(b|c)$ > $c(ab)^*c$ > $acc^*d$ > $abc|bcd$ Ambiguous: > $abc^*$ $abc^+$ $abc?$ $(abca)^∗bc$ $acc^*$ or $...
null
New try at formalising, with the extra information: $L$ is non-ambiguous if $L=\bigcup_{c\in S} L_cc$ and $\forall c\in S,\exists k\in\mathbb{N}, L\subset \{\prod_{i=1}^{k}(a_icb_i)d,\text{with } a_i,b_i\in(\Sigma\backslash\{c\})^*,d\in S\}$, or in plain text: each possible ending character appears a fixed number o...
There is a formula in wikipedia for the general case of josepus problem [Josephus Problem][1] [1]: http://en.wikipedia.org/wiki/Josephus_problem But there is no reference for it, I don't know where it came from and I need too find out... Maybe Donald Knuth's Art of Programming?
A Formula For Generalized Josephus problem
|recursion|
How to design a Universal Turing Machine in which the simulation time of a Turing Machine $M$ is only $\mathcal{O}(log|T|+log|Q|)$ times more than the original execution time of $M$, where $T$ and $Q$ are the tape alphabet and states of $M$ respectively?
Universal Turing Machine simulation with bounded time overhead
null
In the Dragon book (Aho, Sethi, Ullmann) there is one exercise I don't get. > Chapter 2, Exercies: 2.1 > Given the context-free grammar > $$S \to S S + \mid S S * \mid a$$ > Task: Show how the signs aa+a* can be produced from this grammar. I understand the grammar, $S$ can have the form $S S +$… and so on. B...
Show how a sentence can be produced from a grammar (Dragon book 2.1)
|formal-grammars|context-free|
$$\begin{align*} S \Rightarrow & SS* \\ \Rightarrow & SS+S* & \text{(leftmost derivation )} \\ \Rightarrow & aS+S* \\ \Rightarrow & aa+S* \\ \Rightarrow & aa+a* \\ \end{align*}$$
|computer-architecture|memory-hardware|
null
The basic idea is to have one or more symbol that clearly indicate the end. For example: Non-ambiguous: > $ab^*c$ $(a|b)c$ > $ab^+c$ > $ab?c$ > $a(b|c)$ > $c(ab)^*ccc$ > $acc^*d$ > $abc|bcd$ Ambiguous: > $abc^*$ $abc^+$ $abc?$ $(abca)^∗bc$ $acc^*$ or $ac^*c$
Is there a name/interest for regular languages that have a non-ambiguous ending?
Can someone tell me why almost in every book/website/paper someone uses the following: foreach vertex v in Adjacent(u) relax(u,v) when relaxing the edges, instead of: foreach vertex v in Adjacent(u) if (v is in Q) relax(u,v) This is extremely confusing for someone when...
a simple question about Dijkstra
|graphs|shortest-path|
Can someone tell me why almost in every book/website/paper authors use the following: foreach vertex v in Adjacent(u) relax(u,v) when relaxing the edges, instead of: foreach vertex v in Adjacent(u) if (v is in Q) relax(u,v) This is extremely confusing for someone when ...
The condition > min.priority + weight(min,v) < v.priority can only be true if $v$ is in the queue. If a vertex $v$ has been removed from $Q$ the invariant of Dijkstra's algorithm guarantees we've already found the shortest path to $v$.
null
Perhaps the extensive study of Quicksort, and its many variants, is the clearest example. There combinatoric considerations governed the consideration of alternatives, and analyzing the solutions to quite complex equations shows performance advantages (or not) of them.
The first value describing the DRAM is the number of data-interface-sized "chunks" it contains and the second value is the width of the data interface in bits, i.e., bits per "chunk". A 16x1 DRAM would only have 16 bits addressable at 1-bit granularity, with four rows and four columns allowing a minimization of addres...
Given some undirected, unweighted, connected, and potentially parallel-edged graph $G$, an Euler circuit may be constructed iff every vertex in $G$ has an even degree. In graphs with two or more vertices of odd degree (there may only be multiples of two), one must "Eulerize" the graph, connecting the odd vertices wi...
Is there a non-brute force algorithm for Eulerization of graphs?
|graphs|
While developing an [algorithm][1] for monotone submodular maximization over a matroid, we had to solve the recurrence $$ \ell \gamma^{(m)}_{\ell+1} = (2\ell-m) \gamma^{(m)}_\ell + (m - \ell + 1) \gamma^{(m)}_{\ell-1}, \quad \gamma^{(m)}_0 = 1, \quad \gamma^{(m)}_{m+1} = e. $$ After noticing that $\gamma^{(m)}_\ell...
null
(λmn.(λsz.ms(nsz)))(λsz.sz)(λsz.sz) [1 3 (2 3 4)][1 2][1 2] [[1 2] 2 (1 2 3)][1 2] [[1 2] 1 ([1 2] 1 2)] [1 ([1 2] 1 2)] [1 (1 2)] (λmn.m(mn))
Here is a question from Daniel I. A. Cohen's book _Introduction to Computer Theory_: > Consider the language: > $\quad \mathrm{PRIME}' = \{ a^n \mid n \text{ is not a prime} \} = \{ \varepsilon, a, aaaa, aaaaaa, aaaaaaaa, \ldots \}$ > > 1. Prove that $\mathrm{PRIME}'$ is non-regular. > 2. Prove, however,...
Is it possible to design a Universal Turing Machine in which the simulation time of a Turing Machine $M$ is bounded by a factor of $\mathcal{O}(\log|T|+\log|Q|)$ of the original execution time of $M$, where $T$ and $Q$ are the tape alphabet and states of $M$ respectively? If so, how can this be done?
null
Consider the [Chinese Postman Problem][1] on undirected graphs: Given an undirected graph $G$, find the shortest circuit of the graph that travels every edge atleast once. Now, if $G$ is Eulerian, then the Euler circuit is the shortest such circuit. If not, some edges will be traveled more than once. In other words, so...
Consider the [Chinese Postman Problem][1] on undirected graphs: Given an undirected graph $G$, find the shortest circuit of the graph that travels every edge atleast once. Now, if $G$ is Eulerian, then the Euler circuit is the shortest such circuit. If not, some edges will be traveled more than once. In other words, so...
I would like to ask you guys if there is any algorithm that is able to solve following situation. We have two finite automatons A, B and we are willing to determine whether the language recognized by automaton A is a subset of language recognized by automaton B or otherwise. I was just wondering about this becaus...
Automatons language is subset of language of some other (deterministic finite) automaton
|regular-expressions|
Recall some closure properties of regular languages, namely that they are closed under complementation and intersection. Now, $L(A)\subseteq L(B)$ whenever $L(A)\cap\overline{L(B)}$ is empty. So you need to construct the automaton that accepts the intersection of $A$ and the complement of $B$ – these are standard const...