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 …
Category: Uncategorized
[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]: Data structure for a static set of sets
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 …
[Solved]: Can all NP-hard problems be reduced to one another?
Problem Detail: I know that all NP-complete problems can be reduced to each other, but how about NP-hard problems? Can all NP-hard problems be reduced to one another? Asked By : user3590783 Answered By : sashas The answer to your question is no. Read More …
[Solved]: Find 8 numbers whose sum is closest to a defined value
Problem Detail: I have a file that has a number (a positive integer) on each row. Given a number $q$, I want to find a value that’s a sum of some 8 numbers in the file, and is as close to Read More …
[Solved]: Nullable nonterminals and recursion
Problem Detail: I have two questions regarding nullable nonterminals in a grammar. Often a simple algorithm is described to find nullable nonterminals: Basis: if $A rightarrow epsilon$ is a production, $A$ is nullable. Induction: if $A rightarrow X_1X_2ldots X_n$ is a Read More …
[Solved]: Kleene plus in Thompson’s construction
Problem Detail: Is there a direct way to represent Kleene plus(+) using Thompson’s construction algorithm? When I studied Thompson’s construction I learned how to transform concatenation, union and kleene star of regular expresions directly into a NFA. In wikipedia(and other websites) Read More …
[Solved]: Origin of the terms “safety” and “liveness” for concurrent algorithm properties?
Problem Detail: Properties of concurrent algorithms are usually divided into two categories: Safety – something must not happen. Properties in this category are for example partial correctness and sometimes deadlock-freedom (the latter depending on the author). Liveness – something that must 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]: 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 …