Problem Detail: It’s possible to parse a document using a single pass from a state machine. What is the benefit of having two passes, ie. having a lexer to convert text to tokens, and having a parser to test production rules Read More …
Category: Uncategorized
[Solved]: circle packing algorithm used by Percolator
Problem Detail: I was admiring this rendition of the Mona Lisa from quasimondo‘s Flickr account. He says: Combining circle packing with data visualization. The pie charts show the distribution of the dominant colors under the circle area. The circle packing technique Read More …
[Solved]: Data Structure For Closest Pair Problem
Problem Detail: Suppose I have a list of distinct integers. I’m looking for a data structure that will support the operations search, insert, delete and closest_pair in $O(log n)$ time. I know that a sorted array supports search, insert and delete Read More …
[Solved]: Minimize the maximum component of a sum of vectors
Problem Detail: I’d like to learn something about this optimization problem: For given non-negative whole numbers $a_{i,j,k}$, find a function $f$ minimizing the expression $$max_k sum_i a_{i,f(i),k}$$ An example using a different formulation might make it clearer: You’re given a set Read More …
[Solved]: Difference between 1* + 0* and (1 + 0)*
Problem Detail: I know that (1 + 0)* is the set of all bit strings; but isn’t 1* + 0* the same thing? Asked By : O.A. Answered By : Yuval Filmus The set $1^*+0^*$ is composed of two parts: $1^*$ and $0^*$. Read More …
[Solved]: Polynomial time reducibility
Problem Detail: $L_1$ and $L_2$ are two languages defined on the alphabet $sum$. $L_1$ is reducible to $L_2$ in polynomial time. Which of the following cannot be true? $L_1 in P$ and $L_2$ is finite $L_1 in NP$ and $L_2 Read More …
[Solved]: What is meant by Category theory doesn’t yet know how to deal with higher-order functions?
Problem Detail: In reading Uday Reddy’s answer to What is the relation between functors in SML and Category theory? Uday states Category theory doesn’t yet know how to deal with higher-order functions. Some day, it will. As I thought Category theory Read More …
[Solved]: Can an intersection of two context-free languages be an undecidable language?
Problem Detail: I’m trying to prove that $exists L_1, L_2 : L_1$ and $L_2$ are context-free languages $land;L_1 cap L_2 = L_3$ is an undecidable language. I know that context-free languages are not closed under intersection. This means that I can Read More …
[Solved]: Given two total Turing machines, is it undecidable problem to detect whether they give the same output on all inputs?
Problem Detail: See title. And by all inputs I mean providing the functions with the same input and checking whether they give the same output for each case. EDIT If it can be reduced to Halting problem, then how? EDIT 2 Read More …
[Solved]: Does “standard” Dijkstra’s algorithm work with bi-directional edges and zero cost edges?
Problem Detail: I have been reading about Dijkstra’s algorithm and I think I understand it. I followed the algorithm in pseudo-code from Wikipedia, and now I wonder: If my graph is bi-directional and I add each edge to my graph twice Read More …