instruction
stringlengths
0
29.8k
⌀
I've read first-order logic is in general undecidable, and that could be decidable only when working with unary operators. (I think that's propositional logic, correct me if I am wrong) The question is **why arity leads to undecidable problems?** I would like to see some reference material, or at least some simpl...
First-order logic arity defines decidability?
|undecidability|first-order-logic|
You may need to modify the grammar. In general this is not necessarily possible (not every CFG is an LL(k) grammar - the class suitable for recursive descent predictive parsing). In this case we can modify the grammar to: $$\begin{align*} &\mathtt{1.} & S &\rightarrow 0SA \\ &\mathtt{2.} & S &\rightarrow \vare...
Logic with unary *predicates* (not operators), is called [*monadic*][1]. The thing that is called *propositional* logic only has *nullary* predicates, i.e., constants `true` and `false`, and no quantifiers. The [undecidability of predicate logic][2] follows because predicate logic (with at least one binary predicate...
Here is my attempt to solve this - comments are welcome: * Mark our favorite candidates with M and W. * Our vote is obviously effective only when the candidate I vote for is in tie, either before or after the vote. Assume that in case of tie the order is decided at random; in this case, our vote increases the chanc...
null
The theory is not inconsistent and trivially admits two different models : - a first one in which dave is rich but not poor; - a second one in which dave is poor but not rich. You're maybe confusing the "empty clause" which contains no literal, thus being always false, with the "true clause" which contains bo...
Assume I have an incomplete knowledge base, for example: (rich(dave), poor(dave)) // dave is either poor or rich (not rich(dave), not poor(dave)) // dave is not poor and rich at the same time. My questions are: 1. If I do resolution on the above clauses, will I get the empty clause? and 2. If Y...
Resolution and incomplete Knowledge Base
|knowledge-representation|
null
You can grant your parser more than one symbol lookahead. I am not sure whether the term "recursive descent" applies in all definitions, but there is likely no big difference in the actual implementation. Consider this recursive-descent acceptor: S(input : String, start : int) : int { if ( start + 1 >=...
|algorithms|data-structures|algorithm-analysis|mathematical-analysis|discrete-mathematics|
|reference-request|logic|undecidability|satisfiability|first-order-logic|
Assume I have an incomplete knowledge base, for example: (rich(dave), poor(dave)) // dave is either poor or rich (not rich(dave), not poor(dave)) // dave is not poor and rich at the same time. My questions are: 1. If I do resolution on the above clauses, will I get the empty clause? and 2. If Y...
|logic|knowledge-representation|reasoning|
We know error correcting codes are parameterized as (n,k,d) codes. I wanted to know the values of these parameters for some commonly used error correcting codes in computer memories or in DRAMs, etc. I just wanted to see some values for these parameters, used in real life applications.
null
I have rank-deficient matrix $M \in \mathbb{R}^{n\times m}$ with $\text{rank}(M) = k$ and I want to find a [rank factorization](http://en.wikipedia.org/wiki/Rank_factorization) $M = PQ$ with $P \in \mathbb{R}^{n \times k}$ and $Q \in \mathbb{R}^{k \times m}$. A popular approach is to compute the singular value deco...
Alternatives to SVD for rank factorization
|algorithms|machine-learning|numerical-analysis|linear-algebra|
You've refined your problem some more in the comments. To be more specific, you have a DAG with all edges flowing away from the source $s$ and towards the sink $t$ (that is, all edges are on a path from $s$ to $t$). You want to find the minimum cut between two pieces of the DAG, where the first piece is connected to $s...
Is it possible for a graph to have a cycle that goes through all the nodes, but it does not have a Hamiltonian cycle (i.e. the cycle goes through some nodes more than once)? If yes, can anyone prove it? If not, can anyone give a counterexample?
Can a graph have a cycle containing all nodes but not Hamiltonian?
|graphs|
You may need to modify the grammar. In general this is not necessarily possible (not every CFG is an LL(k) grammar - the class suitable for recursive descent predictive parsing). In this case we can modify the grammar to: $$\begin{align*} &\mathtt{1.} & S &\rightarrow 0SA \\ &\mathtt{2.} & S &\rightarrow \vare...
Just pick a [tree][1] (which by definition doesn't have any cycle, but is connected, so you can visit all the nodes but you must pass on some nodes more than once). [1]: http://en.wikipedia.org/wiki/Tree_%28graph_theory%29
Just pick a [tree][1] which - by definition - doesn't have any cycle, but is connected, so you can visit all the nodes and return to the starting one but you must pass on some nodes more than once. [1]: http://en.wikipedia.org/wiki/Tree_%28graph_theory%29
Just pick a [tree][1] which - by definition - doesn't have any cycle, but is connected, so you can visit all the nodes and return to the starting one but you must pass on some nodes more than once. There are also graphs which have an [Eulerian cycle][2] (a cycle that traverses every *edge* exactly once) but not an [...
I am not sure how to draw parallel between the Wagner–Fischer algorithm and dtw algo. In both case we want to find the distance of each index combination (i,j). In Wagner–Fischer, we initiate the distance by the number of insert we'd have to do from one empty string to another. let wagnerFischer (s: string) ...
Levenstein distance and dynamic time warp
|algorithms|dynamic-programming|edit-distance|
Just pick a [tree][1] which - by definition - doesn't have any *simple cycle*, but is connected, so you can visit all the nodes and return to the starting one but you must pass on some nodes more than once. There are also graphs which have an [Eulerian cycle][2] (a cycle that traverses every *edge* exactly once) but...
null
null
is not really clear to me, how and if i can do boosting for correctness (or error reduction) in case of a bpp search problem. can anyone of you, patiently and easly, try to explain me how does it work? Thank you in advance
bpp search - boosting correctness explanation
|randomness|
According to [this Wikipedia article][1], unrestricted grammars are equivalent to Turing machines. The article notes that I can convert any Turing machine into an unrestricted grammar, but it only shows how to convert a grammar to a Turing machine. How do I indeed do that and convert the Turing machine the recognize...
How can I convert the Turing machine the recognizes language $L$ into an unrestricted grammar?
|formal-grammars|turing-machines|
Lots of basic questions are there in my mind. I need to clear them. **Statement 1:** A compiler converts a human-readable codes to object codes, and those are converted to a machine code (executable) by linker. Am I right here? At [wikipedia][1], it is written that Object files are produced by an assemb...
Some doubts regarding compilers and assemblers
|compilers|code-generation|
is not really clear to me, how and if i can do boosting for correctness (or error reduction) in case of a bpp search problem. can anyone of you, patiently and easly, try to explain me how does it work? Thank you in advance edit: with BPP search i mean that: i got a problem and i can either have false positive-...
Some questions regarding compilers and assemblers
We have a stochastic random source. This gives the bit $0$ (or $1$) with probability $1/2$. We want to generate a uniform distribution on the set S = $\{0, 1,..., n-1\}$. Which algorithm gives with probability $1/n$ the value $i\in S$. And how many bits are needed.
Stochastical algorithm
|algorithms|randomness|
|algorithms|randomness|sampling|
|formal-grammars|turing-machines|simulation|
null
As Raphael pointed in a comment you are probably asking about the decidability of the classical decision problem for fragments of first order logic with unary predicates. The search of syntactically restricted fragments of first-order logic where validity of formulas is decidable was an active field of research for ...
If $n$ is a power of two, then you can simply determine the value $i$ by determine bit per bit in the binary representation. So if $n=8$ then you ask your source 3 times. Suppose you get as result $1,1,0$ then you would map this event to the event that you have selected $i\leftarrow\text{bin}(110)=6$. Clearly you need ...
We encode the Turing machine's tape content in sentential forms; a special set of non-terminals encodes the current state. There can only be one of them in the sentential form at any point in time, placed to the right of the symbol the TM is currently pointing at. The second crucial idea is that we have to *reverse*...
|terminology|compilers|code-generation|
There is in fact a whole bunch of related algorithms. In modern context I believe "time warp" would be called [sequence alignment][1]. Depending on whether you want to match complete strings or optimal substrings one gets *Needleman-Wunsch* and *Smith-Waterman*. In your latter algorithm the costs seem to vary, that...
I agree with Raphael, don't look too far for a precise meaning of those terms. AFAIK, there is none. (And that rule is also true for terms which have a precise meaning, often the same word in used with a different precise meaning in different contexts). > A compiler converts a human-readable codes to object codes, ...
I'll try to give a quick answer: Question 1: compiling a high-level language like C requires these steps: source codes --(preprocessing)--> "bare" *.c without # stuff --(compiling)------> assembler files --(assembling)-----> object files --(linking)---...
null
Looking for some tutorials / references that discuss Breadth First Search that takes into consideration the cost of paths, but could not find much information. Could someone refer a tutorial? Sincerely Roberta
Breadth First Search with cost
|search-trees|
|algorithms|reference-request|graphs|search-algorithms|
Looking for some tutorials / references that discuss Breadth First Search that takes into consideration the cost of paths, but could not find much information. Could someone refer a tutorial?
I agree with Raphael, don't look too far for a precise meaning of those terms. AFAIK, there is none. (And that rule is also true for terms which have a precise meaning, often the same word in used with a different precise meaning in different contexts). > A compiler converts a human-readable codes to object codes, ...
You have your mapping the wrong way around. As it stands, it would be a reduction from a decidable problem to an undecidable problem. It's certainly possible (see below), but it doesn't tell us anything. Recall that if $A \leq_{m} B$, then an algorithm solving $B$ (or deciding membership in this case) can be used to...
I have a rather interesting one to ponder and would love if I could get an answer for it. We were discussing the topic of mapping reduction today in my Computing theory course and I was wondering why this reduction can't exist, $A_{LBA} \leq_{m} E_{LBA}$, since both of them are linear bound automata (LBAs). I do realiz...
Reduction of E_LBA to A_LBA
|turing-machines|reductions|
There are many popular languages. But, computer scientists tell us that in order to understand the behaviour of programs in those languages definitely and unambiguously argue upon program behavior, we need to translate them into another, well understood (their own invented) language. They call such language "a semantic...
what is semantics
|formal-languages|semantics|
null
> Why not to learn semantics of C right away instead of inventing > another language, for describing semantics of C? Because in order to define the semantics of C you need some kind of language, for example English. English can be ambiguous, and especially is the C99 semantics. The computer science notion of sem...
Reduction of A_LBA to E_LBA
It's well-known that this 'naive' algorithm for shuffling an array by swapping each item with another randomly-chosen one doesn't work correctly: for (i=0..n-1) swap(A[i], A[random(n)]); Specifically, since at each of $n$ iterations, one of $n$ choices is made (with uniform probability), there are $n^n...
How asymptotically bad is naive shuffling?
|algorithms|algorithm-analysis|asymptotics|probability-theory|
It is not really clear to me, how and if I can do boosting for correctness (or error reduction) on a [BPP](http://en.wikipedia.org/wiki/BPP_%28complexity%29) (bounded-error probabilistic polynomial-time) search problem. Can anyone of you explain me how it works? With BPP search, I mean a problem that can have false ...
BPP search: what does boosting correctness entail?
|probabilistic-algorithms|search-problem|
|computability|turing-machines|reductions|undecidability|
|algorithms|algorithm-analysis|asymptotics|probability-theory|randomness|
It's well-known that this 'naive' algorithm for shuffling an array by swapping each item with another randomly-chosen one doesn't work correctly: for (i=0..n-1) swap(A[i], A[random(n)]); Specifically, since at each of $n$ iterations, one of $n$ choices is made (with uniform probability), there are $n^n...
null
null
Here is the problem. Given $k, n, T_1, \ldots, T_m$, where each $T_i \subseteq \{1, \ldots, n\}$. Is there a subset $S \subseteq \{1, \ldots, n\}$ with size at most $k$ such that $S \cap T_i \neq \emptyset$ for all $i$? I am trying to reduce this problem to SAT. My idea of a solution would be to have a variable $x_i$ f...
Reduce the following problem to SAT
|reductions|
null
You want to express a cardinality constraint, i.e., that $\sum_{1 \le i \le n} \le k$. There are various different cardinality constraint encodings in SAT.
It looks like you are trying to compute a **hypergraph transversal** of size $k$. That is, $\{T_1,\dots,T_m\}$ is your hypergraph, and $S$ is your transversal. A standard translation is to express the clauses as you have, and then translate the length restriction into a cardinality constraint. You want to express a ...
From a general point of view: there are tons, but I do sincerely recommend you the latest volume on Heuristic Search: [Heuristic Search: Theory and Applications](http://books.google.es/books?hl=es&lr=&id=3k5MVjKzBP4C&oi=fnd&pg=PP2&dq=Heuristic+Search:+Theory+and+Applications+Stefan+Edelkamp&ots=hDN2-fwpEx&sig=1aOebG6CC...
It looks like you are trying to compute a **hypergraph transversal** of size $k$. That is, $\{T_1,\dots,T_m\}$ is your hypergraph, and $S$ is your transversal. A standard translation is to express the clauses as you have, and then translate the length restriction into a cardinality constraint. So use your existing e...