Problem Detail: As far as I can unserstand Dynamic programming stands simply for memoization (which is a fancy name for lazy evaluation or plain “caching”). Now, I read that there is we can reduce complexity of coin-change problem by truncating some Read More …
Author: ignougroup
[Solved]: Number of words in the regular language $(00)^*$
Problem Detail: According to Wikipedia, for any regular language $L$ there exist constants $lambda_1,ldots,lambda_k$ and polynomials $p_1(x),ldots,p_k(x)$ such that for every $n$ the number $s_L(n)$ of words of length $n$ in $L$ satisfies the equation $qquad displaystyle s_L(n)=p_1(n)lambda_1^n+dots+p_k(n)lambda_k^n$. The language $L Read More …
[Solved]: Sort doubly linked list efficiently
Problem Detail: How efficiently can a doubly linked list be sorted? The minimum I could get is $O(n^2)$. Can anyone suggest something better? Asked By : Rishika Answered By : FrankW Mergesort keeps its $Theta(nlog n)$ worst case on linked lists. Double-linking can’t Read More …
[Solved]: Can we push and pop both at a single transition in a PDA?
Problem Detail: Let say I have a pda : δ(q1,a,Z)=(q2,aZ) δ(q2,a,aZ)=(q2,bZ) Is this allowed…. you can see that in δ(q2,a,aZ)=(q2,bZ), we are basically popping ‘a’ and pushing ‘b’ for a single transition… Is this allowed for PDA ?? Asked By : Shubham Read More …
[Solved]: How to reduce MAX-2SAT problem to finding a cut in a graph
Problem Detail: I’m trying to reduce the MAX-2SAT problem to finding a cut in a graph, with no luck so far. Let me first show a description of the problem: 2SAT: Given a boolean formula $varphi$ in a CNF form, where Read More …
[Solved]: Do all states in a DFA must be connected?
Problem Detail: Could I construct (for some wired reason) a DFA that has a state that is not connected to anything, and it would still be legal? I’m studying for a test, and I found a question that asks if an Read More …
[Solved]: Can a CFG end have a non-terminal symbol in the middle of it?
Problem Detail: What is the correct way to write a CFG? A -> B C’ E C’ -> C C’ -> null or A -> B C’ C’ -> C E C’ -> E Asked By : Badger Cat Answered By : usul Read More …
[Solved]: What helpful solution does the Halting Problem give to computing?
Problem Detail: What problem does the halting problem solve in computing, whether theoretical or practical? It is very easy to debug code which loops forever, just signal the debugger to break if the program is running for too long? What purpose Read More …
[Solved]: Writing a multitasking operating system for a processor without MMU
Problem Detail: I’ve been thinking of writing a hobby operating system for some of the ARM processors. There are many popular single-board computers with ARM MPU, so I simply wanted to purchase one of those (choosing one with more open documentation). Read More …
[Solved]: Proving that any CF language over a 1 letter alphabet is regular
Problem Detail: I would like to prove that any context free language over a 1 letter alphabet is regular. I understand there is Parikh’s theorem but I want to prove this using the work I have done so far: Let L Read More …