instruction stringlengths 0 29.8k ⌀ |
|---|
Are two terms where one is without a $\lambda\beta$ normal form unconvertible in $\lambda\beta$? |
I have asked this exact question on [StackOverflow][3]. I did not get the answer that I was looking for. Please read this question fully before answering. Thank You.<br><br>
For static pattern database(5-5-5), see [this][1](page 290 and 283) For [What is 15-puzzle?][2]<br>
I am creating a static patter database(5-5-5... |
null |
I have asked this exact question on [StackOverflow][3]. I did not get the answer that I was looking for. Please read this question fully before answering. Thank You.<br><br>
For static pattern database(5-5-5), see [this][1](page 290 and 283) OR there is an explanation below. For [What is 15-puzzle?][2]<br>
I am creat... |
The paper [Canonical Coin Systems for Change-Making
Problems](http://arxiv.org/PS_cache/arxiv/pdf/0809/0809.0400v1.pdf) provides necessary and sufficient conditions for coin systems of up to five coins to be canonical, and an $O(m^2)$ algorithm for deciding whether a "tight" coin system of $m$ coins is canonical.
A... |
A coin system is *canonical* if the number of coins given in change by the greedy algorithm is optimal for all amounts.
The paper [D. Pearson. A Polynomial-time Algorithm for the Change-Making Problem. Operations Reseach Letters, 33(3):231-234, 2005](http://graal.ens-lyon.fr/~abenoit/algo09/coins2.pdf) offers an $O... |
A coin system is *canonical* if the number of coins given in change by the greedy algorithm is optimal for all amounts.
The paper [D. Pearson. A Polynomial-time Algorithm for the Change-Making Problem. Operations Reseach Letters, 33(3):231-234, 2005](http://graal.ens-lyon.fr/~abenoit/algo09/coins2.pdf) offers an $O... |
null |
How do I show that the problem of deciding whether a PDA accepts some string of the form $\{ w!w | w \in \{ 0, 1 \}^*\}$ is undecidable?
I have tried to reduce this problem to another undecidable one such as whether two context-free grammars accept the same language. However, I'm not sure how to use it as a subrouti... |
How do I show that whether a PDA accepts some string $\{ ww | w \in \{ 0, 1 \}^*\}$ is undecidable? |
|undecidability| |
How do I show that whether a PDA accepts some string $\{ w!w | w \in \{ 0, 1 \}^*\}$ is undecidable? |
A binary counter is represented by an infinite array of 0 and 1.
I need to implement the action Add(k) which adds k to the value represented in the array.
The obious way is to add 1, k times. Is there a more efficient way?
thanks
|
Implemeting an increment in a binary counter |
|data-structures| |
A binary counter is represented by an infinite array of 0 and 1.
I need to implement the action $\text{add}(k)$ which adds $k$ to the value represented in the array.
The obvious way is to add 1, k times. Is there a more efficient way?
|
Implemeting addition for a binary counter |
|algorithms|data-structures| |
Well, surely there is.
As a first thing I would convert $k$ to its binary representation $\text{bin}(k)$. If $c$ is the current value of your counter then in order to perform $\text{add}(k)$ just update the counter by setting it to $\text{bin}(c)+\text{bin}(k)$.
If you don't know how to add binary numbers efficie... |
The approach might be as follows. Try to make a context-free (=PDA) language that codes computation steps of a TM, such that the complete computation is successful iff there is a word of the form you describe.
First you need to code separate configurations: tape contents + state + position head (you will have seen t... |
So here is my approach, show that if you can decide your problem, then you can solve [Post's correspondence problem](http://en.wikipedia.org/wiki/Post_correspondence_problem) (PCP).
Remember, PCP is a decision problem that asks if in a set of $2$-tuples $\{(x_1,y_1),\ldots,(x_n,y_n)\}$ you can build a sequence (incl... |
How do I show that the problem of deciding whether a PDA accepts some string of the form $\{ w!w \mid w \in \{ 0, 1 \}^*\}$ is undecidable?
I have tried to reduce this problem to another undecidable one such as whether two context-free grammars accept the same language. However, I'm not sure how to use it as a subro... |
How do I show that whether a PDA accepts some string $\{ w!w \mid w \in \{ 0, 1 \}^*\}$ is undecidable? |
|context-free|undecidability| |
{"Voters":[{"Id":2205,"DisplayName":"A.Schulz"}]} |
{"Voters":[{"Id":2205,"DisplayName":"A.Schulz"}]} |
So here is my approach, show that if you can decide your problem, then you can solve [Post's correspondence problem](http://en.wikipedia.org/wiki/Post_correspondence_problem) (PCP).
Remember, PCP is a decision problem that asks if in a set of $2$-tuples $\{(x_1,y_1),\ldots,(x_n,y_n)\}$ you can build a sequence (incl... |
{"Voters":[{"Id":2205,"DisplayName":"A.Schulz"}]} |
So here is my approach, show that if you can decide your problem, then you can solve [Post's correspondence problem](http://en.wikipedia.org/wiki/Post_correspondence_problem) (PCP).
Remember, PCP is a decision problem that asks if in a set of $2$-tuples $\{(x_1,y_1),\ldots,(x_n,y_n)\}$ you can build a sequence (incl... |
null |
So here is my approach, show that if you can decide your problem, then you can solve [Post's correspondence problem](http://en.wikipedia.org/wiki/Post_correspondence_problem) (PCP).
Remember, PCP is a decision problem that asks if in a set of $2$-tuples $P=\{(x_1,y_1),\ldots,(x_n,y_n)\}$ you can build a sequence (in... |
{"Voters":[{"Id":2205,"DisplayName":"A.Schulz"}]} |
You are referring to the [Landau notation](https://en.wikipedia.org/wiki/Landau_symbols). They are not different symbols for the same thing but have entirely different meanings. Which one is "preferable" depends entirely on the desired statement.
$f \in \cal{O}(g)$ means that $f$ grows at most as fast as $g$, asympt... |
|terminology|logic|lambda-calculus| |
Implementing addition for a binary counter |
|algorithms|data-structures|efficiency| |
|formal-languages|automata|context-free|undecidability|pushdown-automata| |
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 (e.g. prove their identity), we need to translate them into another, well understood language. They call such language "a s... |
See the implementation of miniprolog at my [Programming languages zoo][1], it is the last one on the list. You can [see source code online][2], the code is well documented.
[1]: http://andrej.com/plzoo/
[2]: http://andrej.com/plzoo/html/miniprolog.html |
I am going through greedy algorithms by Vazirani ([http://www.cs.berkeley.edu/~vazirani/algorithms/chap5.pdf][1]) and finding all the notations a bit hard to understand.
Could anyone point me to a much simpler tutorial but has all the important topics covered?
[1]: http://www.cs.berkeley.edu/~vazirani/algorith... |
Greedy algorithms tutorial |
|algorithm-analysis|greedy-algorithms| |
So here is my approach: Show that if you can decide your problem, then you can decide [Post's correspondence problem](http://en.wikipedia.org/wiki/Post_correspondence_problem) (PCP), which is know to be not decidable.
Remember, PCP is a decision problem that asks if in a set of $2$-tuples $P=\{(x_1,y_1),\ldots,(x_n,... |
Here is a [simple definition][1] for greedy algorithm.
There are many greedy algorithms for different problems and in order to understand them you must also know well the subject of the problem. This [question][2] on stackoverflow gives some examples of greedy algorithms usage.
I am not sure what are the import... |
> I'm unclear about the use of the phrases "infinite" language or "finite" language in computer theory.
>
>I think the root of the trouble is that a language like $L=\{ab\}^∗$ is infinite in the sense that it can generate an infinite (but countable) number of strings. Yet, it can still be recognized by a finite state... |
I am trying to find the maximum palindrome subsequence and after going through some tutorials, I came up with a memorized version.But I am not sure about the runtime.I want to know if the following algorithm will work.Could also someone explain what the runtime will be?
Memoized-Palindrome(A,n)
initialize l... |
Memoized Palindrome Subsequence |
|algorithm-analysis|dynamic-programming| |
null |
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 (e.g. prove their identity), we need to translate them into another, well understood language. They call such language "a s... |
{"Voters":[{"Id":69,"DisplayName":"Patrick87"}]} |
I am going through greedy algorithms by Vazirani ([http://www.cs.berkeley.edu/~vazirani/algorithms/chap5.pdf][1]) and finding all the notations a bit hard to understand.
Could anyone point me to a much simpler tutorial for the following topics?
- Minimum Spanning tree - Kruskal's and Prims' Method
- Huffman Enc... |
Could anyone point me to simple tutorial on greedy algorithm for minimum spanning tree, Krushkal's and Prim's. I am looking for a tutorial which does not include all the mathematical notation but at the same time explains the algorithm along with the analysis of the running time.
Minimum Spanning tree - Kruskal's ... |
I am trying to find the maximum palindrome subsequence and after going through some tutorials, I came up with a memorized version.But I am not sure about the runtime.I want to know if the following algorithm will work.Could also someone explain what the runtime will be?
Memoized-Palindrome(A,n)
initialize l... |
I am trying to find the maximum palindrome sub-sequence and after going through some tutorials, I came up with a memoized version.But I am not sure about the runtime.I want to know if the following algorithm will work.Could also someone explain what the runtime will be?
Memoized-Palindrome(A,n)
initialize l... |
Could anyone point me to simple tutorial on greedy algorithm for Minimum Spanning tree - Kruskal's and Prims' Method
I am looking for a tutorial which
- does not include all the mathematical notation
- explains algorithm along with the analysis of the running time.
|
{"Voters":[{"Id":69,"DisplayName":"Patrick87"}]} |
I am trying to find the maximum palindrome sub-sequence and after going through some tutorials, I came up with a memoized version.But I am not sure about the runtime.I want to know if the following algorithm will work.Could also someone explain what the runtime will be?
Memoized-Palindrome(A,n)
initialize l... |
This kind of approach is more often called [dynamic programming][1] than [memoization][2] but they are, indeed, related.
In dynamic programming, however, you usually write the order in which your function is called. (This is one key difference between them.) In this case, you will clearly see that you will compute $... |
**Question:**
**To what extent is it known (or believed) that Chuck Moore and Don Knuth had influence on each other's thoughts on ideal machines, or their work on algorithms?**
I'm interested in citations, interviews, articles, links, or any other sort of evidence. It could also be evidence of the form of A and ... |
Don Knuth and MMIXAL vs. Chuck Moore and Forth -- Algorithms and Ideal Machines -- was there any cross-pollination / influence in their ideas / work? |
|programming-languages| |
|programming-languages|history| |
What is it about the structure of [counting sort][1] that only makes it work on integers?
Surely strings can be counted?
''' allocate an array Count[0..k] ; initialize each array cell to zero ; THEN '''
for each input item x:
Count[key(x)] = Count[key(x)] + 1
total = 0
for i = 0, 1, ..... |
Counting sort on non-integers - why not possible? |
|algorithms|sorting| |
If you naively apply the algorithm you need an encoding $f$ of strings of length $m$ into integers such that $s_1≤s_2$ iff $f(s_1)≤f(s_2)$. The bound on these integers is necessarily at least $c^m$ where $c$ is the number of possible characters.
You then have a complexity in $O(nc^m)$ where $n$ is the number of elem... |
null |
null |
Here is a [simple definition][1] for greedy algorithm.
There are many greedy algorithms for different problems and in order to understand them you must also know well the subject of the problem. This [question][2] on stackoverflow gives some examples of greedy algorithms usage.
EDIT : After you made your quest... |
null |
Glad to see someone implemented Pattern Databases!
From your description: "*Since, you are calculating the number of moves to make these group of tiles reach their goal state, **the other tiles in that group** will be taken into account when a tiles is being moved*" it seems to me that you are implementing MAX patt... |
null |
It is trivially the case that two terms can be $\beta$-convertible even though they do not have a normal form.
Consider:
$$((\lambda x.x)\ (\lambda x.x\ x))\ (\lambda x.x\ x)$$
and
$$(\lambda x.x\ x)\ (\lambda x.x\ x).$$
In one step we have
$$((\lambda x.x)\ (\lambda x.x\ x))\ (\lambda x.x\ x)\to (\lam... |
null |
I'm going to assume you are not given negative weighted edges, because this may not work if there are negative weights.
Algorithm
---------
For each of your edges, label them $1$ to $n$
Let $a_i$ weight A of edge number $i$
Let $b_i$ weight B of edge number $i$
Draw up this table
|a_1 a_2 a_3 ... |
In a scalar implementation, a structural hazard can exist if specific execution hardware is not fully pipelined. For some operations (e.g., multiplication and especially division) the cost of implementing full pipelining may not be considered worthwhile for the expected frequency of the operation.
In a superscalar ... |
In a scalar implementation, a structural hazard can exist if specific execution hardware is not fully pipelined. For some operations (e.g., multiplication and especially division) the cost of implementing full pipelining may not be considered worthwhile for the expected frequency of the operation.
In a superscalar ... |
For the first part of your question about
"approximated locally"
--------------------------
**Eager learning** methods use all available training examples to build a classifier
in advance that is later used for classification of all query instances.
**Lazy learning**, or instance based learning, is a learning... |
I am following **"Introduction to the theory of computation" by Sipser**.
My question is about relationship of different classes which is present in **Chapter 8.2. The Class PSPACE**.
$P \subseteq NP \subseteq PSPACE = NPSPACE \subseteq EXPTIME$
I am trying to understand why the the following part is true $NPS... |
Proving that NPSPACE $\subseteq$ EXPTIME |
|complexity-theory|time-complexity|space-complexity| |
If P does in fact equal NP, how would this enhance our algorithms to factor integers faster. In other words, what kind of insight would this fact give us in understanding integer factorization better? |
How can P =? NP enhance integer factorization |
|complexity-theory|computability|np-complete| |
The expression $f(n)2^{O(f(n))}$ is simply an upper bound for the number of all configurations a $f(n)$-space bounded TM can have. Here is how to count: We have $|\Gamma|^{f(n)}=2^{O(f(n)}$ different ways how to fill the work tape, and the head can be on $f(n)$ different positions. There is also a constant number of st... |
If ${\sf P}$ does in fact equal ${\sf NP}$, how would this enhance our algorithms to factor integers faster. In other words, what kind of insight would this fact give us in understanding integer factorization better? |
|complexity-theory|computability|np-complete|p-vs-np| |
If $P=NP$, and we have an algorithm that can solve the [k-SAT][1] problem in polynomial time, then integer factorization can simply be reduced to k-SAT by describing factoring as a problem in k-SAT.
Essentially it works as follows: You make a bunch of variables each representing the bits of $p$, and $q$, and $n$. Th... |
|complexity-theory|computability|np-complete|p-vs-np|factoring| |
One way to think about convolution/crosscorrelation is as if you were searching for some signal in your data. The more the data looks like the kernel, the higher the resulting value will be. I actually take the reverse of the kernel, i.e. as in cross-correlation, but it is basically the same thing.
For example, let'... |
I'm going to assume you are not given negative weighted edges, because this may not work if there are negative weights.
Algorithm
---------
For each of your edges, label them $1$ to $n$
Let $a_i$ weight A of edge number $i$
Let $b_i$ weight B of edge number $i$
Draw up this table
|a_1 a_2 a_3 ... |
I'm going to assume you are not given negative weighted edges, because this may not work if there are negative weights.
Algorithm
---------
For each of your edges, label them $1$ to $n$
Let $a_i$ weight A of edge number $i$
Let $b_i$ weight B of edge number $i$
Draw up this table
|a_1 a_2 a_3 ... |
I'm going to assume you are not given negative weighted edges, because this may not work if there are negative weights.
Algorithm
---------
For each of your edges, label them $1$ to $n$
Let $a_i$ weight A of edge number $i$
Let $b_i$ weight B of edge number $i$
Draw up this table
|a_1 a_2 a_3 ... |
In one sense, the effect of branch prediction is more critical in the fetching of instructions since an instruction which is not fetched cannot be executed.
With respect to executing both paths of a branch, this is called eager execution and has been researched somewhat substantially. Augustus K. Uht and Vijay Sind... |
null |
Suppose a build max heap operation that runs bubble down over a heap tree, how does it's amortized cost equal to O(n) |
How can I proof that a Build max heap's ammortized cost is O(n) |
|time-complexity| |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.