Problem Detail: Given a context-free grammar G, there exists a Nondeterministic Pushdown Automaton N that accepts exactly the language G accepts. (and visa versa) There may also exist a Deterministic Pushdown Automaton D that accepts exactly the language G accepts too. Read More …
Blog
Potential method for dynamic binary search
Problem Detail: I’m trying to solve 17-2(b) problem from Cormen(CLRS) using potential method. Problem from Cormen: 17-2 Making binary search dynamic Binary search of a sorted array takes logarithmic search time, but the time to insert a new element is linear Read More …
Average number of slots needed in slotted-Aloha
Problem Detail: Consider 2 stations that share the same bus. Both stations are perfect synchronized each other and when they have packets to transmit, they are starting the transmission in the beginning of a same slot. Transmission is as follows: when Read More …
How to find a superstar in linear time?
Problem Detail: Consider directed graphs. We call a node $v$ superstar if and only if no other node can be reached from it, but all other nodes have an edge to $v$. Formally: $qquad displaystyle $v$ text{ superstar } :Longleftrightarrow mathrm{outdeg}(v) Read More …
Circuit Satisfiability problem is NP-Hard?
Problem Detail: $newcommand{np}{mathsf{NP}}newcommand{cc}{textrm{Circuit-SAT}}$I am having difficulty understanding the $np$-hardness proof for $cc$ in CLRS. $cc = {langle C rangle : C text{ is a satisfiable combinatorial boolean circuit} }$ Lemma: The $cc$ problem is $mathsf{NP}$-hard. Can anyone provide an easy-to-understand proof? Read More …
Is there a way to test “Turing completeness”?
Problem Detail: I asked my algorithms teacher today the very same question that is stated in the title, but he seemed a bit unsure, either on the question or on the concept, so I thought I’d try here too. Is there Read More …
How can I prove that a complete binary tree has $lceil n/2 rceil$ leaves?
Problem Detail: Given a complete binary tree with $n$ nodes. I’m trying to prove that a complete binary tree has exactly $lceil n/2 rceil$ leaves. I think I can do this by induction. For $h(t)=0$, the tree is empty. So there Read More …
Words that have the same right- and left-associative product
Problem Detail: I have started to study non deterministic automata using the book of Hopcroft and Ullman. I’m stuck in a problem that I found very interesting: Give a non deterministic finite automaton accepting all the strings that have the same Read More …
How to generate a pushdown automata for accepting a language?
Problem Detail: I have an exercise in my book to come up with a pushdown automaton accepting a language. The exercise is to come up with a state diagram for the PDA accepting the language of all odd-length strings over ${a, Read More …
Why is Iterative-deepening A* optimal, even without monotonicity?
Problem Detail: Why is it that Iterative-deepening A* is optimal, even without monotonicity? How can I be sure that the first goal reached is the optimal one? Asked By : Lieven Cardoen Answered By : Carlos Linares López In a nutshell: IDA* traverses Read More …