instruction
stringlengths
0
29.8k
⌀
Known facets of the Travelling Salesman Problem polytope
|np-complete|
null
Sorry, this is probably not the best place to ask such a trivial question, but the chat seems awfully inactive and I don't know where else to ask. Please forgive me! Construct an NFA over {0, 1}* whose language does not end with "10". This is one of the first problems in the book, so it's supposedly easy, but I just...
NFA question. Just need to know if it's a typo or not
|formal-languages|
|complexity-theory|np-complete|
|asymptotics|recurrence-relation|mathematical-analysis|
|regular-languages|automata|finite-automata|pumping-lemma|
null
> Construct an NFA over $\{0, 1\}$ whose language does not end with "10". This is one of the first problems in the book, so it's supposedly easy, but I just can't figure it out. It's easy using a DFA, but I'm not so sure using an NFA. Maybe I'm not understanding a particular concept in the NFA.
How can I make an NFA for this simple language? I know how to write a DFA
|regular-languages|finite-automata|
Is Huffman coding **always** optimal since it uses Shanon's ideas? What about text, image, video, ... compression? Is this subject still active in the field? What classical or modern references should I read?
> **Possible Duplicate:** > [How can we assume comparison, addition, &hellip; between numbers is $O(1)$](http://cs.stackexchange.com/questions/1643/how-can-we-assume-comparison-addition-between-numbers-is-o1) <!-- End of automatically inserted text --> When we calculate the time-complexity of some algorithm we ma...
{"OriginalQuestionIds":[1643],"Voters":[{"Id":1642,"DisplayName":"edA-qa mort-ora-y"},{"Id":742,"DisplayName":"Saeed Amiri"},{"Id":39,"DisplayName":"Gilles"}]}
Create one that accepts strings over $\{0,1\}^*$ that end with the suffix $00$, another one for strings that end with $01$, and a third one for strings that end with $11$ then take their union. ![NFA accepting strings over {0, 1}^* not ending with 10][1] [1]: https://i.stack.imgur.com/T5E4I.jpg
null
> Construct an NFA over $\{0, 1\}$ whose language contains only words that do not end with $10$. This is one of the first problems in the book, so it's supposedly easy. I just can't figure it out. It's easy using a DFA, but I'm not so sure using an NFA. Maybe I'm not understanding a particular concept in the NFA.
NFA for binary words that do not end in 10
|formal-languages|regular-languages|automata|finite-automata|
Every DFA is also, in particular, an NFA. Therefore if you have constructed a DFA for some language, then you have a fortiori constructed an NFA for it.
Edit: Wherever it says "vertex cover", read "dominating set". Suppose that the sets are $S_1,\ldots,S_n$ and the elements are $x_1,\ldots,x_m$. For each set $S_i$ there will correspond a vertex $S_i$. For each element $x_j$ there will correspond $n$ vertices $x_j^{(1)},\ldots,x_j^{(n)}$. There is also an additional ...
If you are more comfortable with regular expressions, try to define your language as one. >! For example $(0 + 1)^*(00 + 01 + 11) + 1 + 0 + \varepsilon$ Now convert the regular expression into an automaton with the simple method (which I assume you know).
Create one that accepts strings over $\{0,1\}^*$ that end with the suffix $00$, another one for strings that end with $01$, and a third one for strings that end with $11$ then take their union.![NFA accepting strings over {0, 1}* not ending with 10][1] __EDIT__ Now NFA handles strings whose length $\lt 2$ and has an...
null
Certainly some basic starts could be to include the smallest bills available to reach the total amount of the overall bill. If you don't care to allow \$2 bills, each person could simply remove the largest bill they can take from the pool then and would get there relatively quickly. The \$2 bill throws that off as it...
This is a problem from CLRS 23-2 that I'm trying to solve. The problem assumes that given graph G is very sparse connected. It wants to improve further over Prim's algorithm O(E + V lg V). The idea is to contract the graph, i.e. collapse 2 or more nodes into one node. So each reduction will reduce the graph by at least...
Minimum spanning tree Reduce O(E) Algorithm analysis
|graphs|algorithm-analysis|
This answer is just so that the question is not left unanswered. The OP is correct: the book got it wrong.
null
If you have a quick-sort algorithm, and you always select the smallest (or largest) element as your pivot; am I right in assuming that if you provide an already sorted data set, you will always get worst-case performance regardless of whether your 'already sorted' list is in ascending or descending order? My thinki...
Is this assumption correct about quicksort?
|time-complexity|
null
Yes! You're thinking is absolutely right! And as correctly mentioned by Yuval Filmus, the running time will be $O(n^2)$
The worst case complexity for quicksort is $O(n^2)$. This is achieved by picking pivots that divide the set such that one group has only a single member. With a bad pivot picking algorithm, this can easily be achieved by picking one end of a sorted set. Your assumption is correct.
|algorithms|time-complexity|algorithm-analysis|runtime-analysis|sorting|
Does Quicksort always have quadratic runtime if you choose a maximum element as pivot?
This is a problem from CLRS 23-2 that I'm trying to solve. The problem assumes that given graph G is very sparse connected. It wants to improve further over Prim's algorithm $O(E + V \lg V)$. The idea is to contract the graph, i.e. collapse two or more nodes into one node. So each reduction will reduce the graph by at ...
Show that the Minimum spanning tree Reduce Algorithm runs in O(E) on sparse graphs
|algorithms|graphs|algorithm-analysis|runtime-analysis|
This is a problem from CLRS 23-2 that I'm trying to solve. The problem assumes that given graph G is very sparse connected. It wants to improve further over Prim's algorithm $O(E + V \lg V)$. The idea is to contract the graph, i.e. collapse two or more nodes into one node. So each reduction will reduce the graph by at ...
This is a problem from CLRS 23-2 that I'm trying to solve. The problem assumes that given graph G is very sparse connected. It wants to improve further over Prim's algorithm $O(E + V \lg V)$. The idea is to contract the graph, i.e. collapse two or more nodes into one node. So each reduction will reduce the graph by at ...
null
The worst case complexity for quicksort is $\Theta(n^2)$. This is achieved by picking pivots that divide the set such that one group has only a single member. With a bad pivot picking algorithm, this can easily be achieved by picking one end of a sorted set. Your assumption is correct.
Yes! You're thinking is absolutely right! And as correctly mentioned by Yuval Filmus, the running time will be $\Theta(n^2)$
How can I build an example of a DFA that has $2^n$ states where the equivalent NFA has $n$ states. Obviously the DFA's state-set should contain all subsets of the the NFA's state-set, but I don't know how to start. Any suggestions to put me on the right track?
NFA with exponential number of states when deteminized
|finite-automata|subset-construction|
I'm going to guess that you mean that the *optimal* DFA has $2^n$ states. Maybe this doesn't get you $2^n$ states, but it's $O(2^n)$. From "Communication Complexity" by Kushilevitz and Nisan, Exercise 12.6: "For some constant [non-negative integer] $c$, consider the (finite) language $L_c = \{ww\mid w \in \{0,1\}...
I'm going to guess that you mean that the *optimal* DFA has $2^n$ states. Maybe this doesn't get you $2^n$ states, but it's $O(2^n)$. From "Communication Complexity" by Kushilevitz and Nisan, Exercise 12.6: "For some constant [non-negative integer] $c$, consider the (finite) language $L_c = \{ww\mid w \in \{0,1\}...
null
The standard example is the language $L$ of all words over an alphabet $A$ of size $n$ that *don't* contain all the different letters. There is an NFA accepting $L$ with $n+1$ states (or $n$ states if you allow multiple starting states): first guess a letter $a$ which is missing, then go (with an $\epsilon$-move) to an...
while converting a DFA to a regular expression using Transitive closure method, what is the significance of state "k" and what values "k" takes? If "k" represents the intermediate states then what are the values for "k"??? i.e while solving a problem, for which value of "k" should we stop finding the regular expression...
Converting a DFA to a regular expression using Transitive closure method
|formal-languages|
|automata|finite-automata|
When converting a DFA to a regular expression using the transitive closure method, what is the significance of state $k$ and what values $k$ takes? If $k$ represents the intermediate states then what are the values for $k$? That is while applying the method, for which value of $k$ should we stop finding the regular exp...
What is the purpose of k do in the transitive closure method?
|regular-languages|automata|finite-automata|
null
What is the purpose of k in the transitive closure method?
Ok, I have been a computer nerd for many many years. I can program in quite a few languages, I can even build them, but I sat down with a buddy the other day and asked how a computer actually takes electricity and does something with it, and we just couldnt figure it out, and Google wasn't much help either. I mean, ...
how does a computer work?
|education|
The complete picture is fairly complicated. There are many layers built on top of one another that collectively implement high-level abstractions on top of electrical voltages. There is no simple explanation of how everything is put together, especially considering that computer hardware and software has evolved dram...
One way you can think about the transitive closure method of converting DFAs to regular expressions (suggested by Michael Sipser in "Introduction to the Theory of Computation") is to think about converting a DFA to a regular expression by progressively ripping out states from the DFA and replacing transitions into and ...
Ok, I have been a computer nerd for many many years. I can program in quite a few languages, and I can even build them. I sat down with a buddy the other day and asked how a computer actually takes electricity and does something with it, and we just couldnt figure it out, and Google wasn't much help either. I mean,...
How does a computer work?
null
|education|computer-architecture|
null
For the branch-and-cut method, it is essential to know many facets of the polytopes generated by the problem. However, it is currently one of the hardest problems to actually calculate all facets of such polytopes as they rapidly grow in size. For an arbitrary optimization problem, the polytope used by branch-and-cu...
null
null
A computer works by manipulating energy gradients (which we then interpret as 1's and 0's) in a consistent, defined way. It's the consistency which defines a computer.
A computer works by manipulating energy gradients (which we then interpret as 1's and 0's) in a **consistent**, **defined** way. It's the *consistency* which defines a computer, while it's the *definition* which separates the different processors. Also, learn about how just two logic gates (OR, and AND) are suffici...
null
The podcast Security Now! did a series on how computers work, starting with base principles. - [233][1] - Let's Design a Computer (part 1) - [235][2] - Machine Language - [237][3] - Indirection: The Power of Pointers (not technically part of the series) - [239][4] - Stacks, Registers & Recursion - [241][5] ...
Here's a question from a past exam I'm trying to solve: For an undirected graph $G$ with positive weights $w(e) \geq 0$, I'm trying to find the minimum cut. I don't other way for doing that besides using the MinCut-MaxFlow theorem, but this graph is undirected, so how should I direct it? I though of direct it on bo...
Finding the minimum cut for an undirected graph
|algorithms|graphs|
null
>Suppose that we redefine the residual network to disallow edges into $s$. Argue that the procedure FORD-FULKERSON still correctly computes a maximum flow. I was thinking that when we augment a path the residual capacity of reverse edge increases and can be used to decrease the flow in that edge (but overall incre...
Network flow : A variation in FORD-FULKERSON algorithm
|network-flow|correctness-proof|
null
>Suppose that we redefine the residual network to disallow edges into $s$. Argue that the procedure FORD-FULKERSON still correctly computes a maximum flow. I was thinking that when we augment a path the residual capacity of reverse edge increases and can be used to decrease the flow in that edge (but overall incre...
A variation in Ford-Fulkerson algorithm
|algorithms|graphs|network-flow|correctness-proof|
{"Voters":[{"Id":39,"DisplayName":"Gilles"}]}
Here I'm really interested in lowering barriers to mathematical education. Target: I'd like to see created for the JavaScript community, an equivalent of the Python-based/linked **scientific and high-performance computing** libraries (great lists of which are available through [Sage](http://sagemath.org/download-...
A faster, leaner JavaScript for scientific computing: what features should I keep?
|programming-languages|compilers|performance|
null