instruction stringlengths 0 29.8k ⌀ |
|---|
When doing a DFS, any node is in one of three states - before being visited, during recursively visiting its descendants, and after all its descendants have been visited (returning to its parent, i.e., wrap-up phase). The three colors correspond to each of the three states. One of the reasons for mentioning colors and ... |
The (meta) algorithm you're looking for is the Gröbner basis algorithm. In the last decade, the approach that you mention, called *algebraic attacks*, has gained momentum in the cryptological community. One person who has been developing efficient Gröbner basis algorithms in the context of cryptography is [Faugère][1].... |
One important problem in distributed file systems (**DFS**) is to generate files from distributed blocks. The area of [Erasure code][1] from information theory and Algebra is used extensively in distributed fault tolerant file systems for example in [HDFS RAID][2] (Hadoop Based File System). Social network and Cloud co... |
I'm having trouble understanding a mapping reduction and I would appreciate your help.
STM = { < M > | is a TM that accepts w^R whenever it accepts w }
A reduction of ATM to STM:
Given < M,w > the following M' is defined:
M' on Input x
if x = 01 Accept
otherwise run M on w and accept x... |
mapping reduction for dummies |
|reductions| |
I am having trouble understanding a mapping reduction and I would appreciate your help.
Define $S_{TM} = \{ \langle M \rangle \mid $ is a Turing machine that accepts $w^R$ whenever it accepts $w\}$ and consider the reduction of $A_{TM}$ to $S_{TM}$ as follows.
Given $\langle M, w \rangle$ the following Turing mac... |
Mapping reductions for dummies |
One important problem in distributed file systems (**DFS**) is to generate files from distributed blocks. The area of [Erasure code][1] from information theory and Algebra (groups, rings, linear algebra,...) is used extensively in distributed fault tolerant file systems for example in [HDFS RAID][2] (Hadoop Based File ... |
|algorithms|graphs|search-algorithms|graph-traversal| |
|computability|turing-machines|reductions| |
**Motivation**: This question is motivated by my [previous question][1]. In that question, my statment of the uniqueness requirement is not interesting since it leads to easily computable function. I am interested in constructing uncomputable function from a simple combainatorial problem.
We want to tile $m\times ... |
Tiling of squares |
|computability| |
**Motivation**: This question is motivated by my [previous question][1]. In that question, my statment of the uniqueness requirement is not interesting since it leads to easily computable function. I am interested in constructing uncomputable function from a simple combainatorial problem.
We want to tile $m\times ... |
Why would a company like Twitter be interest in algebraic concepts like groups, monoids and rings. https://github.com/twitter/algebird
All I could find is:
> Implementations of Monoids for interesting approximation algorithms,
> such as [Bloom filter][1], [HyperLogLog][2] and [CountMinSketch][3]. These allow you... |
**Motivation**: This question is motivated by my [previous question][1] . In that question, my statment of the uniqueness requirement is not interesting since it leads to easily computable function. I am interested in constructing uncomputable function from a simple combainatorial problem.
We want to tile $m\times... |
**Motivation**: This question is motivated by my [previous question][1] . In that question, my statment of the uniqueness requirement is not interesting since it leads to easily computable function. I am interested in constructing uncomputable function from a simple combainatorial problem.
We want to tile $m\times... |
What does a pseudo-polynomial algorithm tell us about the problem it solves? I don't see how running time improves if the algorithm is exponential in the input length and polynomial in the input value; so how do we explain this shift from exponential to polynomial? |
Weak and strong completeness |
|np-complete|pseudo-polynomial| |
The main answer is that by exploiting semi-group structure, we can build systems that parallelize correctly without knowing the underlying operation (the user is promising associativity).
By using Monoids, we can take advantage of sparsity (we deal with a lot of sparse matrices, where almost all values are a zero in... |
null |
This function is (still) computable, by a subset of the reasoning in the previous question: No squares are tileable using $n=4k+2$ or $4k+3\ 1\times 1$ tiles; arbitrarily large squares are tileable using $n=4k\ 1\times 1$ tiles, and using $n=4k+1\ 1\times 1$ tiles and an arbitrary number of $2\times 2$ tiles, one can c... |
What use are groups, monoids, and rings in database computations? |
Monoids are ubiquitous in programming, just that most programmers don't know about them.
- Number operations like addition and multiplication.
- Matrix multiplication.
- Basically all collection-like data structures form monoids, where the monoidal operation is concatenation or union. This includes lists, sets, ma... |
As it is stated in "[Computers and Intractability: a Guide to the Theory of NP-Completeness][1]" A pseudo-polynomial-time algorithm will display '**exponential behavior**' only when confronted with instances containing '**exponentially large**' numbers, which might be rare for the applications we are interested in. If ... |
I'm an autodidact who works best with a mix of theory and implementation examples. I'm having a hard time finding resources on implementing algorithms and data structures in Python (2.7-3.X preferably). I found a text ...mastering basic algorithms in the python language but I find it to be far too introductory and thu... |
Looking for non-entry level implementation of foundational algorithms and data structures in python. where to look? |
|algorithms|algorithm-analysis| |
If your question is
>What are examples of groups, monoids, and rings in computation?
then one example I can think of off-hand is for path-finding algorithms in graph-theory. If we define a [semiring](https://en.wikipedia.org/wiki/Semiring) with $+$ as $\min$ and $\cdot$ as $+$, then we can use matrix multiplicatio... |
We can prove a more general theorem. The language $\{ a^n : n \in A \}$ is regular if and only if the set $A$ is eventually periodic, i.e. there exist $m$ and $k$ such that for all $n \geq m$, $n \in A$ iff $n+k \in A$.
Indeed, a language of this form is clearly regular. For the other direction, consider a DFA accep... |
Monoids are ubiquitous in programming, just that most programmers don't know about them.
- Number operations like addition and multiplication.
- Matrix multiplication.
- Basically all collection-like data structures form monoids, where the monoidal operation is concatenation or union. This includes lists, sets, ma... |
I am having trouble understanding a mapping reduction and I would appreciate your help. Define
$$\begin{align}
A_{TM} &= \{ \langle M \rangle \mid \text{\(M\) is a TM that accepts \(w\)}\} \\
S_{TM} &= \{ \langle M \rangle \mid \text{\(M\) is a Turing machine that accepts \(w^R\) whenever it accepts \(w\)}\} \\
... |
As it is stated in "[Computers and Intractability: a Guide to the Theory of NP-Completeness][1]" A pseudo-polynomial-time algorithm will display '**exponential behavior**' only when confronted with instances containing '**exponentially large**' numbers, which might be rare for the applications we are interested in. If ... |
null |
**Motivation**: This question is motivated by my [previous question][1] . In that question, my statment of the uniqueness requirement is not interesting since it leads to easily computable function. I am interested in constructing uncomputable function from a simple combainatorial problem.
We want to tile $m\times... |
Assume you are given a bipartite graph G = (U, V, E) and you are given an integer n. Assume also that for each v in V, you are given two integers v_min and v_max (where v_min <= v_max).
The problem is to find a subset U' of U of size n such that for each v in V, the number of edges coming into v from U' is between... |
Bipartite graph question |
|bipartite-matching| |
Assume you are given a bipartite graph $G = (U, V, E)$ and you are given an integer $n$. Assume also that for each $v \in V$, you are given two integers $v_{min}$ and $v_{max}$ (where $v_{min} \le v_{max}$).
The problem is to find a subset $U'$ of $U$ of size $n$ such that for each $v \in V$, the number of edges com... |
|algorithms|graphs|bipartite-matching| |
Your problem is NP-hard, by reduction from set cover. Given an instance of set cover with universe $V$, sets $U$ and number $n$, draw an edge between a set and a point if the set contains the point. Let $v_\min = 1$ and $v_\max = |U|$. A subset $U'$ satisfies the $v_\min,v_\max$ constraints iff it is a set cover. So if... |
A pseudo-polynomial algorithm tells us that the problem is probably not NP-hard. The (somewhat) commonly-believed Exponential Time Hypothesis (ETH) states that 3SAT on $n$ variables requires time $2^{\Omega(n)}$. Since 3SAT is in NP, the ETH implies that any NP-complete problem requires time $2^{n^{\Omega(1)}}$, which ... |
I'm an autodidact who works best with a mix of theory and implementation examples. I'm having a hard time finding resources on implementing algorithms and data structures in Python (2.7-3.X preferably). I found a text ...mastering basic algorithms in the python language but I find it to be far too introductory and thu... |
> I have math background but I'm not computer scientist. It would be great to have "real-world" uses of monoids and semi-groups. These are normally considered useless theoretical constructs, and ignored in many abstract algebra courses (for lack of anything interesting to say).
There is rather too much interesting t... |
David Eppstein has a bunch of algorithms implemented in Python in his <a href="http://www.ics.uci.edu/~eppstein/PADS/">PADS repository</a>. |
It is an exercise in CLRS that you can remove the gray or black color and the algorithm works fine with just two colors, in other words it is not really needed. The main goal of marking vertices is to make sure we don't run into an infinite loop by repeatedly visiting already visited vertices.
The reason for using 3... |
null |
null |
|algorithms|complexity-theory|np-complete|pseudo-polynomial| |
|computability|combinatorics| |
|computability|combinatorics| |
Complexity theory classifies problems with respect to their computational hardness, i.e. which machine models can solve them under which restrictions, and the relations between these classes like the famous $\sf{P}$ and $\sf{NP}$ classes.
[Computational complexity][1] is about the inherent difficulty of computationa... |
null |
The Halting Problem is defined as
Htm = { < M,w > | M halts on input w }
Im not sure what it means, Htm is a collection of Turing Machines that all of them accept/reject the word w? is that a specific word? or does that mean any word in their alphabet?
Thanks |
The Halting problem |
|computability| |
null |
The Halting Problem is defined as:
$H_{TM} = \{ \langle M, w \rangle \mid \text{\(M\) halts on input \(w\)}\}$
I'm not sure what it means. Is $H_{TM}$ a collection of Turing Machines such that all of them accept/reject the word $w$? Is that a specific word? Or does that mean any word in their alphabet?
Thanks |
Meaning of the Halting problem |
|computability|turing-machines| |
We first choose an alphabet of symbols that our Turing machines can read and write on the tapes. Typically we have three symbols: $0$, $1$, and "empty". A *word* is a finite sequence of symbols.
If $u$ and $v$ are words we can form a new word $\langle u, v \rangle$ which represents the two words put together (this r... |
The set (or language if you will) $H_{TM}$ is a of _pairs_ $(M,w)$ where $w$ is any string of you alphabet and $M$ is a Turing machine, and $M$ halts with $w$ as input.
This means that a pair $P = (M,w)$ is in the set $H_{TM}$ if and only if $M(w) \downarrow$.
_Deciding_ this set is however not possible. There i... |
The set (or language if you will) $H_{TM}$ is a set of _pairs_ $(M,w)$ where $w$ is any string of your alphabet and $M$ is a Turing machine, and $M$ halts with $w$ as input.
This means that a pair $P = (M,w)$ is in the set $H_{TM}$ if and only if $M(w) \downarrow$.
_Deciding_ this set is however not possible. Th... |
Given a language, how do you go about deciding if it's decidable or not? For example:
Given a DFA A0 and a TM M0
L1 = { < M > | M is a TM and L(M) = L(A0) }
L2 = { < A > | A is a DFA and L(A) = L(M0) }
What's the intuition/process of figuring out if L1, L2 are decidable or not?
This is not homework, L1 i... |
intuition about dependability |
|turing-machines|undecidability| |
intuition about decidability |
For example, I know that the non-regular language $a^nb^n$ is in $AC^0$. I would like to know more examples like this. |
Which non-regular languages are in $AC^0$? |
|complexity-theory|regular-languages|circuits| |
Given a language, how do you go about deciding if it's decidable or not? For example:
Given a DFA $A_0$ and a TM $M_0$
$L_1 = \{ \langle M \rangle \, | \, M \mbox{ is a TM and }L(M) = L(A_0) \}$
$L_2 = \{ \langle A \rangle \, | \, A \mbox{ is a DFA and }L(A) = L(M_0) \}$
What's the intuition/process of figu... |
For the first *undecidable* language $L_1$ you can apply the [Rice's theorem][1]:
Theorem (Rice’s Theorem): Let L be a language of the form
$L = \{ \langle M \rangle | L(M)\mbox{ has some property }P\}$,where
1. P is non-trivial, i.e. there exist at least one machine M such that $\langle M \rangle \in L$, and ... |
null |
For the first *undecidable* language $L_1$ you can apply the [Rice's theorem][1]:
**Theorem (Rice’s Theorem)**: Let L be a language of the form
$L = \{ \langle M \rangle | L(M)\mbox{ has some property }P\}$,where
1. P is non-trivial, i.e. there exist at least one machine M such that $\langle M \rangle \in L$, ... |
I'm looking at my textbook here from Michael Sipser and he says that a **nondeterministic Turing machine is a decider if all its computation branches halt on all inputs.** I think I recall seeing somewhere what you'd call a nondeterministic Turing machine that halts on at least one branch for all inputs, but may loop o... |
If a non-deterministic turing machine is called a "decider" if it halts on all branches of computation |
|turing-machines|nondeterminism| |
I'm looking at my textbook here from Michael Sipser and he says that a **nondeterministic Turing machine is a decider if all its computation branches halt on all inputs.** I think I recall seeing somewhere what you'd call a nondeterministic Turing machine that halts on at least one branch for all inputs, but may loop o... |
null |
### Counting in the general case
The problem you are interested in is known as #SAT, or model counting. In a sense, it is the classical #P-complete problem. Model counting is hard, even for $2$-SAT! Not surprisingly, the exact methods can only handle instances with around hundreds of variables. Approximate methods e... |
I am taking the [Coursera class][1] on compilers and in the lesson about lexers it is hinted that there is a time-space tradeoff between using non-deterministic finite automaton (NFA) and deterministic finite automaton (DFA) to parse regular expressions. If I understand correctly, the tradeoff is that a NFA is smaller,... |
Are there real lexers that use NFAs directly instead of first transforming them to DFAs? |
|automata|finite-automata|compilers|regular-expressions| |
I'd be surprised if they did. The _construction_ of the lexer is done once (hopefully), the result _used_ millions of times (just think how many tokens there are in your medium-sized source file). So, unless there are very unusual circumstances, it pays off to make the lexer as fast (and other resource frugal) as possi... |
The idea is that a _deterministic_ TM will always answer Yes/No in finite time (else the whole idea makes no sense). And to do that, the deterministic simulation of the NTM can't just go off into lala-land on some branches, i.e., every branch must end in yes/no at a finite depth. It _decides_ (gives you a definite answ... |
A non-deterministic Turing machine is called a "decider" if it halts on all branches of computation |
null |
Non-deterministic Turing machine that halts on at least one branches of computation |
I am learning about automata and finite state machines. Consider the following automaton, that accepts the language 'ab':
alphabet: 'a','b'
states: 1,2, 3 (3 is the final state and 1 is the initial state)
transitions:
state 1, symbol a, state 2
state 2, symbol b, state 3
First part of my questions:
1... |
design of self-loops and final states in fsm |
|finite-automata| |
I am learning about automata and finite state machines. Consider the following automaton, that accepts the word 'ab', does not have to be infinite, just once:
alphabet: 'a','b'
states: 1,2, 3 (3 is the final state and 1 is the initial state)
transitions:
state 1, symbol a, state 2
state 2, symbol b... |
null |
I am learning about automata and finite state machines. Consider the following automaton, that accepts the word 'ab', does not have to be infinite, just once:
alphabet: 'a','b'
states: 1,2, 3 (3 is the final state and 1 is the initial state)
transitions:
state 1, symbol a, state 2
state 2, symbol b... |
Your original automaton is fine, it accepts the singleton $\{ab\}$. Here is a pictorial representation:
![enter image description here][1]
In the above automaton it's implicit that given a state and a letter for which there is no arrow going out of that state, then the automaton "crashes". If you want to be compl... |
So I have the following pseudo-code:
Function(n):
for (i = 4 to n^2):
for (j = 5 to floor(3ilog(i))):
// Some math that executes in constant time
So far, I know that to find this i will be calculating
$\sum_{i=4}^{n^2}\sum_{j=5}^{3ilog_{2}i}C$ where C is a constant, but I am comp... |
Running time of a nested for loop |
|algorithm-analysis| |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.