instruction
stringlengths
0
29.8k
⌀
Laslie Lamport is very influential in the field of distributed computation, here is his quote: "A distributed system is one in which the failure of a computer you didn't even know existed can render your own computer unusable'' is a famous Lamport quip. I would suggest to check the article about [him][1]. he's trying...
I'll build on Pål's answer to be a bit more explicit about how we can code PR functions using those operations. First of all, note that we can code any finite sequence of (positive) numbers into a single number such that the $i$'th element of the sequence can be extracted; for instance, this should be doable by mapping...
I am trying to read about Alternating Turing Machines (ATM) that have both existential and universal quantifiers for all their _internal_ states. Given that these models are conceptual, I tend to imagine that there is some form of reflection in terms of an advantage provided to the deterministic Turing Machine to provi...
How to interpret Universal Quantifier in Alternating Turing Machines?
|complexity-theory|turing-machines|co-np|
I recently read about the “computer” built out of matchboxes designed by Donald Michie that could teach itself how to play tic tac toe. Here is the Wikipedia article about it: https://en.m.wikipedia.org/wiki/Matchbox_Educable_Noughts_and_Crosses_Engine I thought it looked interesting, so I decided to make a digit...
I recently read about the “computer” built out of matchboxes designed by Donald Michie that could teach itself how to play tic tac toe. Here is the Wikipedia article about it: <https://en.m.wikipedia.org/wiki/Matchbox_Educable_Noughts_and_Crosses_Engine> I thought it looked interesting, so I decided to make a dig...
How many games will a “MENACE” tic tac toe computer take to train
According to [this paper](https://www.cambridge.org/core/journals/theory-and-practice-of-logic-programming/article/abs/expressive-power-of-higherorder-datalog/B800F077DBC66023631AF4139B9F0B47) [1], higher-order Datalog is more expressive: > ... we demonstrate that on ordered databases, for all `k ≥ 2`, `k`-order Da...
How could higher-order Datalog be more expressive than first-order Datalog?
|complexity-theory|time-complexity|logic|logic-programming|datalog|
Is there a hashing function $f$ that for each input $x$ if $f(x) = y$, then $f(x \, || \, y) = y$? In other words, if we concatenate its output with the input, the result will not change. Furthermore, is there a simple construction for such functions? ## Example Let $x =$ `"hello"` and $f(x) =$ `"123"`. Then $...
null
Let me illustrate with a hand-wavy argument on a very simple game why convergence to optimal play might be very slow, and not even guaranteed, when training against a random opponent. Consider the following game: Player A first picks a color, either red or blue. Then player B picks a number between $1$ and $100$. If...
The short answer to your question is no. There is no such a reduction. Your question is actually can be answered using theorem which is stated here: https://cs.stackexchange.com/q/154941/159462
Let’s say there are n fixed words permitted in some game of Scrabble, on an m x m squares board. We are assuming an idealized scenario where anyone can write any word on the board. Assume both players have an unlimited number of every word. Or, assume there is only one player, playing every round. Assume all the ...
Calculating the highest possible scoring Scrabble move
|board-games|
null
I recently read about the “computer” built out of matchboxes designed by Donald Michie that could teach itself how to play tic tac toe. Here is the Wikipedia article about it: <https://en.m.wikipedia.org/wiki/Matchbox_Educable_Noughts_and_Crosses_Engine> I thought it looked interesting, so I decided to make a dig...
0 I know that quasi polynomial algorithm is neither polynomial nor exponential. But I want to know if we find such algorithm for NP complete problem, will it be of any use? Or is there such algorithm exists already? I want to know why it becomes impossible to solve NP complete problems on regular machine. Is it b...
Quasi polynomial algorithm for np complete problem
|time-complexity|np-complete|p-vs-np|
I know that quasi polynomial algorithm is neither polynomial nor exponential. But I want to know if we find such algorithm for NP complete problem, will it be of any use? Or is there such algorithm exists already? I want to know why it becomes impossible to solve NP complete problems on regular machine. Is it becaus...
Some basic pros and cons are outlined [here](https://www.computer.org/publications/tech-news/trends/differences-between-parallel-and-distributed-computing). There are multiple books on the topic as well e.g. > Kshemkalyani, A. D., Singhal, M. (2011). Distributed Computing: Principles, Algorithms, and Systems. (n.p.): ...
Scrabble is PSPACE-Complete (see [this ref.](https://www.csc.kth.se/~mlampis/papers/scrabble-final.pdf)). Dynamic programming can be used to devise a more tractable solution instead of plain brute force. Here are some pointers to designing an efficient Scrabble solution: some [computer programs](https://en.wikipedi...
Recall that quasi-polynomial-time algorithms have a running time upperbounded by $2^{O((\log{n})^c)}$ for some constant $c\in\mathbb{N}$. It has a separate complexity class **QP**. From [wikipedia](https://en.wikipedia.org/wiki/Quasi-polynomial_time): > The decision problems with quasi-polynomial time algorithms ar...
null
null
While computers are very reliable, they can also do errors because of noise. I would like to have an idea of the rough order of magnitude of a floating point operation in a computer, with a reference to a good paper.
How reliable is a floating point operation (how often does it makes mistakes)
|floating-point|
null
While computers are very reliable, they can also do errors because of noise. I would like to have an idea of the rough order of magnitude of a floating point operation in a computer, in a typical environment, with a reference to a good paper. I am not looking for rounding errors but I am looking for errors due to no...
{"Voters":[{"Id":6616,"DisplayName":"MWB"}],"DeleteType":1}
Not an actual answer, but I think you are interested in the [soft error][1] rate of modern computers (or perhaps only the [single-event upset][2] rate). These rates will likely vary depending on where the computer runs (space/high atmosphere vs underground facilities). CPU producing companies should probably have so...
Benchmarking typically consists of getting the current CPU time, executing test code a large number of times, and then subtracting the new CPU time from the previous one. However when you benchmark code multiple times, the results tend to vary either slightly to significantly each time. You will very likely not get the...
{"Voters":[{"Id":6616,"DisplayName":"MWB"}]}
null
there is famous equivalence between type of grammars and automatons. however when discussing recursive functions, we only consider equivalence of General Recursive functions with Turing machines, however primitive recursive functions are considered separately and I don't know any equivalence of that computational model...
Are Primitive recursive functions (with bounded $\mu$ operator) equivalent to other known computational model?
|computability|computation-models|primitive-recursion|
Laslie Lamport is very influential in the field of distributed computation, here is his quote: "A distributed system is one in which the failure of a computer you didn't even know existed can render your own computer unusable'' is a famous Lamport quip. I would suggest to check the article about [him][1]. he's trying...
null
null
null
Yes, Dijkstra's algorithm without relaxation is possible. But the big-O complexity is the same. Dijkstra uses greedy strategy so there is the priority_queue that guarantees the popped vertex is the closest vertex to the already-discovered island. Without relaxation, you should allow duplicate nodes with different w...
It's not really true the any sample of size *2n* (all with positive label) can be used to determine the rectangle. Take for example the following sample $S$: $$ S=\{(\mathbf{x}_i, 1): \mathbf{x}_{i} = \mathbf{x}_{j}, \forall i, j\in[2n], i\ne j\}. $$ This training set $S$ contains just one (positive) example sa...
Interesting conversation. I think that the grammar of English is not regular, because the grammar was defined as programming language are defined. But natural spoken English (or any other language) is regular. The example that breaks regularity is {a^n b^n | n >= 0}, but I think that no human being is able to ...
[LOOP](https://en.wikipedia.org/wiki/LOOP_(programming_language)) is a simple programming language which exactly captures primitive recursive functions. Primitive recursive functions also have other characterizations. For example, they are the functions which are provably total in $\rm I\Sigma_1$ (a [fragment](https...
Given any connected undirected graph, we can convert it into a tree by "detaching" some edges from one of their endpoints. For example, consider the graph with the following edges: $$ (1) ~~~~~~~~~~~~~ a-b, b-c, c-a, c-d, d-e $$ We can detach the edge b-c from the vertex c (adding a new vertex c' of degree 1), and ...
An "edge-spanning-tree" of minimum height
|graphs|trees|spanning-trees|
null
Here is an idea. The root of your desired tree should be one of the centers (a vertex with minimum eccentricity) of the graph $G$. You run BFS from each of the nodes in $G$ and observe the resulting BFS tree. We pick the tree $T$ that has the lowest height. There will be some missing edges that were present in $G$ but ...
Given functions $f(n)$ and $G(n)$, from $[0,\infty)\rightarrow [0,\infty) $ we can define |Operands | Meaning| | -------- | ------- | | $f(n) = O_n(G(n))$ | $\displaystyle \lim_{n\rightarrow \infty} \inf \frac{G(n)}{f(n)} > 0$ | | $f(n) = o_n(G(n))$ | $\displaystyle \lim_{n\rightarrow \infty} \frac{G(n)...
While computers are very reliable, they can also do errors because of noise. I would like to have an idea of the rough order of magnitude of error per floating point operation in a computer, in a typical environment (in a typical office, like not deep underground for instance), with a reference to a good paper. I am...
null
As you know, alternating Turing machines are nondeterministic, but have both existential and universal states. In an existential state one of the possible computations should accept, in a universal state all possible continuations should accept. In this way an ordinary nondeterministic TM corresponds to an alternating ...
I'm curious about whether there exists a hierarchical or layered concept within the broad categories of algorithms, where they can be further divided into subcategories based on their characteristics and problem-solving approaches. Is there a clear association or inheritance relationship between different algorithm cat...
What is the relationship among the various algorithms?
|algorithms|
In the untyped lambda calculus (with variables, abstraction and application as the only constructors), we have a "pair" construct, given by $(a, b) = \lambda x, x a b$. The projections are then $\pi_i = \lambda x_1 x_2, x_i$ and there is a product function $ \langle f, g \rangle = \lambda x, (f x, g x)$. TL; DR; Do ...
"union" or "disjunction" in pure untyped lambda calculus
|lambda-calculus|category-theory|
As noted in the answer of [codeR][1] Big O notation makes no sense for 3x3x3 alone because of the constant input size. What might be interesting to discuss is the time complexity to find a solution with these algorithms in relationship to the length of the optimal (=shortest) solution to solve a Rubik's cube. So we div...
As noted in the answer of [codeR][1] Big O notation makes no sense for 3x3x3 alone because of the constant input size. What might be interesting to discuss is the time complexity to find a solution with these algorithms in relationship to the length of the optimal (=shortest) solution to solve a Rubik's cube. So we div...
Here is a handy categorization from [wikipedia](https://en.wikipedia.org/wiki/Algorithm#Classification) and a list of few popular [algorithmic topics](https://en.wikipedia.org/wiki/List_of_algorithms).
Look at the definition given. Assume you have a quasi-polynomial algorithm that takes $2^{(\log n)^{1.1}}$ nanoseconds. This is less than $n^2$ nanoseconds $ n \le 2 ^ { 2 ^ {10}} = 2^{1024}$. That will be solvable for quite large x. But with large c the function grows much faster. With c = 2 the same expression become...
Look at the definition given. Assume you have a quasi-polynomial algorithm that takes $2^{(\log n)^{1.1}}$ nanoseconds. This is less than $n^2$ nanoseconds $ n \le 2 ^ { 2 ^ {10}} = 2^{1024}$. That will be solvable for quite large x. But with large c the function grows much faster. With c = 2 the same expression become...
**Instance**: An undirected graph $G$ and a positive integer $k$ **Question**: Does $G$ contain a vertex cover of size $\leq k$ *or* a clique of size $\geq k$? Obviously, this problem is solved by polynomial reduction, but is it from Clique or Vertex Cover? And how?
Prove "Vertex Cover OR Clique" is NP complete
|np-complete|reductions|np|clique|vertex-cover|
**Instance**: An undirected graph $G$ and a positive integer $k$ **Question**: Does $G$ contain a vertex cover of size $\leq k$ *or* a clique of size $\geq k$? Obviously, this problem is solved by polynomial reduction, but is it from Clique or Vertex Cover? And how? I've tried to reduce from both problems, bu...
**Instance**: An undirected graph $G$ and a positive integer $k$ **Question**: Does $G$ contain a vertex cover of size $\leq k$ *or* a clique of size $\geq k$? Obviously, this problem is solved by polynomial reduction, but is it from Clique or Vertex Cover? And how? I've tried to reduce from both problems, bu...
There is a famous equivalence between types of grammars and automatons. However when discussing recursive functions, we only consider equivalence of General Recursive functions with Turing machines. However primitive recursive functions are considered separately and I don't know any equivalence of that computational mo...
null
null
You can easily reduce from clique as follows. First, notice that the clique problem remains NP-hard even if we restrict $k$ to lie in $3 \leq k \leq n$ (because outside this range the problem is trivially solvable in polynomial time). Given a graph $G$ on $n$ vertices and $3\leq k \leq n$, construct a graph $G'...
What you have proved: You can sort an array with your “modified bubble sort” algorithm which goes like this: Sort the first n elements using “modified bubble sort”, then do one more bubble sort pass. This is a _slightly_ different algorithm. I figured out a small modification to the bubble sort code where your proo...
Look at the definition given. Assume you have a quasi-polynomial algorithm that takes $2^{(\log n)^{1.1}}$ nanoseconds. This is less than if $n^2$ nanoseconds $ n \le 2 ^ { 2 ^ {10}} = 2^{1024}$. That will be solvable for quite large x. But with large c the function grows much faster. With c = 2 the same expression bec...
null
Look at the definition given. Assume you have a quasi-polynomial algorithm that takes $2^{(\log n)^{1.1}}$ nanoseconds. This is less than if $n^2$ nanoseconds $ n \le 2 ^ { 2 ^ {10}} = 2^{1024}$. That will be solvable for quite large x. But with large c the function grows much faster. With c = 2 the same expression bec...
I have the following Regular Expression (classic Computer Science definition of Regular Expression, not PCRE or modern computer language RegEx): {(ΣΣ)\*00(ΣΣ)\*}Σ ∪ Σ{(ΣΣ)\*00(ΣΣ)\*} It "feels" like it should be reducible to me but I can't see how. Is it reducible or am I just asking for trouble trying? The term ...
Can this Classic Regular Expression be simplified?
|complexity-theory|regular-languages|regular-expressions|
$(\Sigma \Sigma)^* (\Sigma 0 0 | 0 0 \Sigma) (\Sigma \Sigma)^* $ You need an even number of letters on the left and an odd number on the right, or the other way round.
As noted in the answer of [codeR][1] Big O notation makes no sense for 3x3x3 alone because of the constant input size. What might be interesting to discuss is the time complexity to find a solution with these algorithms in relationship to the length of the optimal (=shortest) solution to solve a Rubik's cube. So we div...
Can every problem with a greedy solution be solved using dynamic programming? Why or why not? I'm not completely sure how to formally reason about this, my understanding about the structure of problems with a greedy/dp solution is quite handwavy. I found conflicting answers for this online, so I'm not sure what t...
Can every greedy problem be solved using dynamic programming?
|algorithms|optimization|dynamic-programming|greedy-algorithms|
I am looking to implement a general base conversion algorithm. I was wondering if there already exists such a thing, since I couldn't find one. Currently, I am able to go from int to int, but I also want support for negative, rational and, in principle, all complex numbers as both bases and the value to convert. ...
General Base Converting Algorithm
|base-conversion|
null
null
Is there a text that goes through some explicit examples of converting tree automata to tree regular expressions? I'm working through Comon's "Tree Automata Techniques and Applications", and I'm trying to work out some examples of regular expressions from tree automata. I'm convinced that the procedure given in the ...
Resources on Tree Automata Regular Expressions
|reference-request|regular-expressions|tree-automata|
null