Problem Detail: To prove that some decision problem $A$ is NP-complete, my understanding is that it suffices to show that the problem is in NP (i.e. that one can verify or reject all statements in polynomial time), and to demonstrate that Read More …
Category: Uncategorized
[Solved]: What’s flawed about the “save-the-input” method of reversible computing?
Problem Detail: I’m an undergraduate just beginning to read about reversible computing. I know that, because of Landauer’s principle, irreversible computations dissipate heat (and reversible ones do not). I brought it up with my professor, who had never heard of reversible Read More …
[Solved]: Number of ways to fill a 2xN grid with M colors
Problem Detail: This question was asked in the onsite regionals for ACM ICPC 2013 at Amritapuri. In short, the question asked to find the number of ways to fill a $ 2times N$ grid with $M$ colors such that no two Read More …
[Solved]: Where is Program Counter (PC) stored?
Problem Detail: Where is program counter stored? CPU caches? Also how big are these counters? What happens if that memory has been filled up? I know that it’s a value that stores the next instruction for the CPU to process, as Read More …
[Solved]: Interval scheduling scheduling problem with minimal workers
Problem Detail: I am writing a greedy algorithm for a variation of the interval scheduling problem that I haven’t seen before. I have a set of jobs, each with start and finish time. All jobs in set must be assigned to Read More …
[Solved]: Analyzing programs with multiple for-loops
Problem Detail: If they were all linked to make a condition such as ($1 < i < j < k < n$), I know how to solve, but the last loop is disconnected so I have no clue on how to Read More …
[Solved]: Is $Theta$ symmetric?
Problem Detail: For example if $$ f(x)= Theta (g(x)) $$ from the definition of the theta notation, there exist c1 and c2 constants such that $$c_1 g(x) le f(x) le c_2 g(x)$$ then if only we took the constants $1/c_1$ and Read More …
[Solved]: How many number of different binary trees are possible for a given postorder (or preorder) traversal
Problem Detail: I came across the problem: What is the number of binary trees with 3 nodes which when traversed in postorder give the sequence A,B,C? Now 3 being small number I was quick to draw all possible binary trees and Read More …
[Solved]: Algorithm: ordering non-overlapping intervals
Problem Detail: Assume we have a (multi)set of nontrivial intervals $mathcal{I} = {I_1,…,I_n}$ and for any two $I_i, I_j in mathcal{I}$, we have that $I_i cap I_j$ is trivial (that is: contains at most one point), or one of them contains Read More …
[Solved]: Proving NP-hardness of strange graph partition problem
Problem Detail: I am trying to show the following problem is NP-hard. Inputs: Integer $e$, and connected, undirected graph $G=(V,E)$, a vertex-weighted graph Output: Partition of $G$, $G_p=(V,E_p)$ obtained by removing any $e$ edges from $E$ which maximizes $$max sumlimits_{G_i in Read More …