Problem Detail: Cache-oblivious algorithms and data structures are a rather new thing, introduced by Frigo et al. in Cache-oblivious algorithms, 1999. Prokop’s thesis from the same year introduces the early ideas as well. The paper by Frigo et al. present some Read More …
Blog
[Solved]: How to write CFG for languages
Problem Detail: How do you write the CFG for the following language: {ax by c ax+y} Is there some formula or rules I need to follow? An explanation will be so appreciated. What I tried is: First I broke ax+y into Read More …
[Solved]: What if a formal grammar cannot be terminated?
Problem Detail: I’m currently in a class on Computability and we just finished looking at formal grammars before moving onto finite automata. We were given an several examples of a formal grammar, and one stuck out in particular: V: { S, Read More …
[Solved]: Restricted version of the Clique problem?
Problem Detail: Consider the following version of the Clique problem where the input is of size $n$ and we’re asked to find a clique of size $k$. The restriction is that the decision procedure cannot change the input graph into any Read More …
[Solved]: On “The Average Height of Planted Plane Trees” by Knuth, de Bruijn and Rice (1972)
Problem Detail: I am trying to derive the classic paper in the title only by elementary means (no generating functions, no complex analysis, no Fourier analysis) although with much less precision. In short, I “only” want to prove that the average Read More …
[Solved]: Find k maximum numbers from a heap of size n in O(klog(k)) time
Problem Detail: I have a binary heap with $n$ elements. I want to get the $k$ largest elements in this heap, in $O(k log k)$ time. How do I do it? (Calling deletemax $k$ times yields a $O(k log n)$ complexity. Read More …
[Solved]: How was the ALU implemented in the first computer (i.e., Babbage’s analytical engine)?
Problem Detail: I’ve seen circuit level implementations of ALU’s before, but how are NOT/AND/ADD performed mechanically? Asked By : Wuschelbeutel Kartoffelhuhn Answered By : slebetman Babbage’s arithmetic unit (ALU) for the Analytical Engine was originally called the mill. It wasn’t constructed out of Read More …
[Solved]: How does CPU actually retrieve data from memory when you call a variable in a programming language?
Problem Detail: As I have understood from all the internet sources I can get to, when you declare and initialize a variable in java, you are allocating this data, say an 8-byte float, in a particular memory cell in the RAM, Read More …
[Solved]: Algorithm Complexity Analysis on functional programming language implementations
Problem Detail: I’ve learned today that algorithm analysis differs based on computational model. It is something I’ve never thought about or heard of. An example given to me, that illustrated it further, by User @chi was: E.g. consider the task: given Read More …
[Solved]: DFA that recognizes 0 in every odd position
Problem Detail: I had a question that asked for the DFA that accepts the following language: {w | every odd position of w is a 0 } Should this DFA accept the empty string, since it doesn’t have an odd position? Read More …