Problem Detail: Scott Meyers describes here that traversing a symmetric matrix row-wise performes significantly better over traversing it column-wise – which is also significantly counter-intuitive. The reasoning is connected with how the CPU-caches are utilized. But I do not really understand Read More …
Category: Uncategorized
Can a regular expression be infinite?
Problem Detail: I know that languages which can be defined using regular expressions and those recognisable by DFA/NFA ( finite automata ) are equivalent. Also no DFA exists for the language ${0^n1^n|n ge 0}$. But still it can be written using Read More …
Control flow graphs – Tree decomposition
Problem Detail: Considering above terminologies for drawing control flow graphs for any program, it is very simple. For example : While A if B do .. else do .. end while For above example, while doing decomposition, I can say Read More …
Kleene star and Kleene plus
Problem Detail: Let $Sigma$ be an alphabet. Have a look at following definitions frequently used in literature containing Kleene star and Kleene plus. $Sigma^* := Sigma^+ cup {varepsilon}$ $Sigma^+ := Sigma^* setminus {varepsilon}$ These definitions lead to different sets iff $varepsilon Read More …
Is the 0-1 Knapsack problem where value equals weight NP-complete?
Problem Detail: I have a problem which I suspect is NP-complete. It is easy to prove that it is NP. My current train of thought revolves around using a reduction from knapsack but it would result in instances of 0-1-Knapsack with Read More …
Differences between Fuzzy C-Means and EM
Problem Detail: When clustering a set of data points, what exactly are the differences between Fuzzy C-Means (aka Soft K-Means) and Expectation Maximization? In slide 30 and 32 of this lecture I found, it says that Soft K-Means is a special Read More …
Constructing PDA to accept language { $a^i b^j c^k mid i,j,k geq0, i+2k = j$ }
Problem Detail: I’m trying to understand the approach to constructing a PDA which accepts the language { $a^i b^j c^k mid i,j,k geq0, i+2k = j$ } Asked By : Iancovici Answered By : Patrick87 Your language is equivalent to the language $a^ib^ib^{2k}c^k$, Read More …
How to prove that DFAs from NFAs can have exponential number of states?
Problem Detail: All non-deterministic finite automata can be turned into equivalent deterministic finite automata. However, a deterministic finite automata only allows a single arrow per symbol pointing from a state. Therefore, its states should be members of the power set of Read More …
If any 3 points are collinear
Problem Detail: Given a set $S$ of points $p_1,..,p_2$ give the most efficient algorithm for determining if any 3 points of the set are collinear. The problem is I started with general definition but I cannot continue to actually solving Read More …
Convert a non-deterministic Turing machine into a deterministic Turing machine
Problem Detail: How can we systematically convert a non-deterministic Turing machine into a deterministic Turing machine that recognizes the same language? Asked By : Kevin Answered By : Hendrik Jan The deterministic machine simulates all possible computations of a nondeterministic machine, basically in Read More …