Problem Detail: I have collection $U$ of sets, where each set is of size at most 95 (corresponding to each printable ASCII character). For example, ${h,r,l,a}$ is one set, and $U = {{h,r,l,a}, {l,e,d}, ldots}$. The number of sets in $U$ Read More …
Blog
[Solved]: Is a grammar that accepts function declarations, function calls and expressions (at any order!) necessarily cyclic?
Problem Detail: As the title suggests, assume a grammar which has to recognize function declarations, function calls, and expressions, at any order. Does that mean it has to be cyclic, and therefore ambiguous? I mean, it would have to look something Read More …
[Solved]: Gray Code Generation
Problem Detail: I am trying to generate a $n$-bit gray code where I can specify two strings $s$ and $t$ that must be consecutive in that gray code. I know that there are ways to generate specific codes (such has the Read More …
[Solved]: Help with understanding Simulated Annealing algorithm
Problem Detail: I’m trying to wrap my head around it, but no matter what I read, I still can’t fully understand it. I tried to read a little bit about the annealing process in physics, but I have no background whatsoever Read More …
[Solved]: Finding an exactly weighted st-path in a digraph
Problem Detail: I have a weighted digraph graph $G = (V,E)$ where the weights are positive and negative integers. The graph $G$ is not necessarily acyclic. The question is: given 2 nodes $v_1$ and $v_2$, is there a path from $v_1$ Read More …
[Solved]: Exponential reduction vs Polynomial Reduction
Problem Detail: I’m having trouble understanding reduction. Lets say you have a decision problem A that is NP-Complete. Also, another problem B the can be reduced from A. What can you say about B if: 1) The reduction is done in Read More …
[Solved]: The $text{k-key}$ problem
Problem Detail: Given an undirected graph, I define a structure called k-key as a path containing $k$ vertices which are connected to a simple cycle which contains $k$ vertices as well. Here’s the k-key problem: given an undirected graph $G$ and Read More …
[Solved]: Efficiently selecting the median and elements to its left and right
Problem Detail: Suppose we have a set $S = { a_1,a_2,a_3,ldots , a_N }$ of $N$ coders. Each Coders has rating $R_i$ and the number of gold medals $E_i$, they had won so far. A Software Company wants to hire exactly Read More …
[Solved]: Enumerate All Possible Strings Over Alphabet
Problem Detail: I am given the following decision problem: A program $ Pi $ takes as input a pair of strings and outputs either $true$ or $false$. It is guaranteed that $Pi$ terminates on any input. Does there exist a pair Read More …
[Solved]: Efficient algorithm to find subgraph
Problem Detail: I have a really nasty problem (for me) at hand and I was wishing some of you may know an efficient algorithm to solve it. Thanks to all of you in advance. My problem I have a set of Read More …