Problem Detail: The case of multiple strings. A slight modification of the dynamic programming algorithm for two strings is used as a subroutine. Here is the pseudo code: # The modified dynamic programming algorithm for longest common subsequence. # Inputs: x, Read More …
Author: ignougroup
[Solved]: Finding Minimum Weight Subgraph Spanning Tree
Problem Detail: Suppose we have a graph $G = (V, E, w:ein E to x in {0,1})$. That is, a set of vertices, a set of edges and a weight function that assigns edges weights of 0 or 1. Suppose we Read More …
[Solved]: If $L_1L_2$ is regular language then $L_2L_1$ is regular to?
Problem Detail: We have two languages: $L_1,L_2$. We know that $L_1L_2$ is regular language, so my question is if $L_2L_1$ is regular to? I try to find a way to prove it… I can’t assume of course that $L_1,L_2$ are regular… Read More …
[Solved]: How to do last step of Krom’s algorithm for solving 2SAT problems
Problem Detail: I was making a program for solving 2 SAT problems, using Krom’s algorithm. I did not found a lot of information searching in Google, so I used Wikipedia’s description of Krom’s algorithm to implement it but I’m stuck in Read More …
[Solved]: Dijkstra’s algorithm runtime for dense graphs
Problem Detail: The runtime for Dijkstra’s algorithm implemented with a priority queue on a sparse graph is $O((E+V)log V)$. For a dense graph such as a complete graph, there can be $V(V-1)/2$ edges. Since $E sim V^2$, is the runtime $O((V+V^2)log Read More …
[Solved]: If we sort a table column-wise and then row-wise why the table is still sorted column-wise?
Problem Detail: Say we have a $n times n$ table which elements are sorted column-wise, for example: $$ left( begin{array}{ccc} 2 & 4 & 1 3 & 5 & 6 7 & 9 & 8 end{array} right) $$ I would like Read More …
[Solved]: Term rewriting; Compute critical pairs
Problem Detail: I have tried to solve the following exercise but I got stuck while trying to find all the critical pairs. I have the following questions: How do I know which critical pair produced a new rule? How do I Read More …
[Solved]: What do we gain by having “dependent types”?
Problem Detail: I thought I understood dependent typing (DT) properly, but the answer to this question: Why was there a need for Martin-Löf to create intuitionistic type theory? has had me thinking otherwise. After reading up on DT and trying to Read More …
[Solved]: Detecting coplanarity by given pairwise distances
Problem Detail: Consider an undirected weighted graph $G = (V,E)$, where $V subset mathbb{R}^3$ so the points are 3D, and the weight of an edge equals the (Euclidean) distance between its endpoints. Note that we’re not given the coordinates of the Read More …
[Solved]: Why does the solution of an NP problem have to be polynomial size?
Problem Detail: I’ve read in “Introduction to Algorithms” (CLRS) that formal language $L$ is NP-language if and only if there is a polynomial verification algorithm $A(x, y)$ and a constant $c$ such that $$L={xin{0,1}mid exists y text{ with } |y| leq Read More …