Problem Detail: Suppose that there is an algorithm which sorts a sequence of $n$ elements $$a_1, a_2, …, a_n$$ Each of the $a_i$ is chosen with probability $1/k$ from a set of $k$ distinct integer numbers. Is it true, given that Read More …
Blog
[Solved]: Scala as a language for Generic Programming
Problem Detail: I posted the same Q at programmers.SE, but nobody really helps. In the paper “An Extended Comparative Study of Language Support for Generic Programming” by Garcia et al. an interesting comparison of programming languages features for generic programming is Read More …
[Solved]: How many edges can a unipathic graph have?
Problem Detail: A unipathic graph is a directed graph such that there is at most one simple path from any one vertex to any other vertex. Unipathic graphs can have cycles. For example, a doubly linked list (not a circular one!) Read More …
[Solved]: Why multiple return values is not a common thing?
Problem Detail: I would like to ask a question about multiple return values, why this construct is not preferrable in programming languages (conceptual and/or technical difficulties). I’ve heard something about stack frames and how they reserve memory for return value and Read More …
[Solved]: Break an authentication protocol based on a pre-shared symmetric key
Problem Detail: Consider the following protocol, meant to authenticate $A$ (Alice) to $B$ (Bob) and vice versa. $$ begin{align*} A to B: &quad text{“I'm Alice”}, R_A B to A: &quad E(R_A, K) A to B: &quad E(langle R_A+1, P_Arangle, K) end{align*} Read More …
[Solved]: Complexity of the V-opt heuristic Traveling Salesman algorithm
Problem Detail: The paragraph on V-opt heuristic TSP algorithms at this site mentions a very effective algorithm due to Lin-Kernigham-Johnson. That page says: For many years Lin–Kernighan–Johnson had identified optimal solutions for all TSPs where an optimal solution was known and Read More …
[Solved]: How can I analyze the time complexity of this Dynamic Time Warping algorithm implemented in MATLAB?
Problem Detail: I have a rough idea that the time complexity is O(mn) where m and n are based on the length of signals, as per this http://en.wikipedia.org/wiki/Dynamic_time_warping. How can I determine the time complexity of the following code (source) function Read More …
[Solved]: Find longest common subsequence in limited space
Problem Detail: Given three strings $x$, $y$, and $z$ over an arbitrary finite alphabet, I need to determine their longest common subsequence (LCS). Example: A longest common subsequence of bandana, cabana, and magazine is aan. I’m trying to find an algorithm Read More …
[Solved]: Lost in a “one directional” concert
Problem Detail: You and a friend lost each other on the line to a concert, and neither is sure which of you is further ahead. Formally, each is at some integer coordinate and may only walk towards a higher coordinate or Read More …
[Solved]: Class of the language only containing the empty string?
Problem Detail: $L = left { epsilon right }$ Clearly this language is finite so this must be a regular language. Now since every regular language is Context Sensitive, $L$ is a CSL. We can define the grammar for $L$ as Read More …