Problem Detail: I wonder how we can perform algorithm analysis when in an algorithm we have calls of functions whose definition we do not know, e.g. functions delivered by external libraries. Asked By : marekszpak Answered By : David Richerby There are two Read More …
Blog
[Solved]: Which problems are hard for P^NP?
Problem Detail: Quantified Boolean formulae are the prime examples of problems that are hard for the polynomial hierarchy, i.e., for the $Pi$ and $Sigma$ versions of it. However, there is also the $Delta$ version, defined as $Delta_{i+1}^{rm P} := {rm P}^{Sigma_i^{rm Read More …
[Solved]: Type-system combining type-states and typed effects?
Problem Detail: Has anyone succeeded in implementing or designing a type-system that combines both type-state (linear types) and effect types (e.g. Koka)? Asked By : Olle Härstedt Answered By : Matija Pretnar Edwin Brady has done some work in that area using dependent Read More …
[Solved]: How many permutations in a trainset?
Problem Detail: If I have the following pieces to a train set: (12) Curve (4) Straight Such as this train set. I’m looking for an algorithm (to which I can write a program) that creates/lists all permutations. It’s not as simple Read More …
[Solved]: Greedy algorithm correctness proof for “Elegant Permuted Sum” (UVa 11158)
Problem Detail: Given a sequence of $2 leq n leq 50$ numbers $s = (s_1,s_2,…,s_n)$, find a permutation $a = (a_1,a_2,…,a_n)$ of $s$ such that $$sum_{i=1}^{n-1} |a_i – a_{i+1}|$$ is maximized. I found many codes that get “Accepted” in the online Read More …
[Solved]: Bidirectional Dijkstra vs Dijkstra
Problem Detail: Are there any kind of graphs where Bidirectional Dijkstra would expand more than Dijkstra? I tried to come up with an argument like this: Let node $n$ be expanded by Bidirectional Dijkstra. Now there are two possibilites: Node $n$ Read More …
[Solved]: Can an artificial neural network convert from cartesian coordinates to polar coordinates?
Problem Detail: Given cartesian coordinates $x$ and $y$ as input, can a neural network output $r$ and $theta$, the equivalent polar coordinates? This would seem to require an approximation of the pythagorean theorem (which requires approximations of $x^2$ and $sqrt{x}$) and Read More …
[Solved]: Lamport Timestamps: When to Update Counters
Problem Detail: In the timepiece (excuse the pun) that is Time, Clocks and the Ordering of Events, Lamport describes the logical clock algorithm as the following: Each process $Pi$ increments $Ci$ between any two successive events. If event a is the Read More …
[Solved]: Is a secondary TM sufficient to detect all loops?
Problem Detail: Procedure: Start a secondary TM in parallel with the first, but have the second perform exactly 1 step each 2 steps the first TM performs (i.e. it runs at half speed). If the second machine ever reaches the same Read More …
[Solved]: ILP and number of variables in constraints
Problem Detail: This question is about the time impact of the length (i.e. number of variables) of the constraints in an Integer Linear Programming formulation. Most people try to reach the minimum number of constraints/variables, but I couldn’t find anything that Read More …