Problem Detail: This is a sort of edit-distance question, and is very easy. I am just quite brain dead on this subject and can’t figure it out so far. Given a series of numbers, e.g. [3, 1, 1, 1] How Read More …
Blog
Examples of undecidable problems whose intersection is decidable
Problem Detail: I know that given two problems are undecidable it does not follow that their intersection must be undecidable. For example, take a property of languages $P$ such that it is undecidable whether the language accepted by a given pushdown Read More …
LR(1) – Items, Look Ahead
Problem Detail: I am having diffuculties understanding the principle of lookahead in LR(1) – items. How do I compute the lookahead sets ? Say for an example that I have the following grammar: S -> AB A -> aAb | b Read More …
Limitations of Stack Inspection
Problem Detail: This is a follow up to the How does Stack Inspection work? that explores the notion in more detail Stack inspection is a mechanism for ensuring security in the context of the JVM and CLR virtual machines when externally Read More …
Fastest square root method with exact integer result?
Problem Detail: I am dealing with the problem of computing $ s = lfloor sqrt(x)rfloor$ with $x in [0,30000^2]$. The common sqrtf(x) on C language is too slow for this case, however it always gives me the correct result. I’ve tried Read More …
What is the name of this prime number algorithm?
Problem Detail: Does the following recursive algorithm have a name? If so, what is it? procedure main(): myFilter = new Filter( myPrime = 2 ) //first prime number print 2 //since it would not otherwise be printed for each n in Read More …
NFA to DFA convertion explanation
Problem Detail: I’ve converted this NFA to a DFA and I get a similar soultion automata but I’m not sure if I really understand everything. Please correct me if I’m explaining it wrong, I would love some feedback. From the state Read More …
Lower bounds: queues that return their min elements in $O(1)$ time
Problem Detail: First, consider this simple problem — design a data structure of comparable elements that behaves just like a stack (in particular, push(), pop() and top() take constant time), but can also return its min value in $O(1)$ time, without Read More …
Existence of bipartite perfect matching
Problem Detail: Let $B = G(L, R, E)$ be a bipartite graph. I want to find out whether this graph has a perfect matching. One way to test whether this graph has a perfect matching is Hall’s Marriage Theorem, but it Read More …
Simplify complexity of n multichoose k
Problem Detail: Edit: In my case, $k$ may be greater than $n$ and they grow independently. I have a recursive algorithm with time complexity equivalent to choosing k elements from n with repetition, and I was wondering whether I could get Read More …