Problem Detail: A binary counter is represented by an infinite array of 0 and 1. I need to implement the action $text{add}(k)$ which adds $k$ to the value represented in the array. The obvious way is to add 1, k times. Read More …
Blog
[Solved]: Which addressing modes permits relocation without any change whatsoever in the code?
Problem Detail: An exercise problem stated that : Which of the following addressing modes permits relocation without any change whatsoever in the code? Indirect addressing Indexed addressing Base register addressing PC relative addressing Somewhere it explained as : Base register addressing Read More …
[Solved]: Since we need space for recursive calls, is the space complexity of the recursive factorial is n?
Problem Detail: As Wikipedia says, quickSort needs O(log n) extra space when the following conditions are met: In-place partitioning is used. This unstable partition requires O(1) space. After partitioning, the partition with the fewest elements is (recursively) sorted first, requiring at Read More …
[Solved]: Polymorphism and Inductive datatypes
Problem Detail: I’m curious. I’ve been working on this datatype in OCaml: type ‘a exptree = | Epsilon | Delta of ‘a exptree * ‘a exptree | Omicron of ‘a | Iota of ‘a exptree exptree Which can be manipulated using Read More …
[Solved]: Is DTIME(n) = DTIME(2n) true? (unlike Rosenberg’s results)
Problem Detail: I’m reading Homer and Selman’s “Computability and Complexity” book. In some Corollary 5.3 it says: For all ε > 0, DTIME(O(n)) = DTIME( (1+ε) n). Now I’m confused with this corollary and Rosenberg’s result (p87 in the same book): Read More …
[Solved]: Algorithm to chase a moving target
Problem Detail: Suppose that we have a black-box $f$ which we can query and reset. When we reset $f$, the state $f_S$ of $f$ is set to an element chosen uniformly at random from the set $${0, 1, …, n – Read More …
[Solved]: Is determining if there is a prime in an interval known to be in P or NP-complete?
Problem Detail: I saw from this post on stackoverflow that there are some relatively fast algorithms for sieving an interval of numbers to see if there is a prime in that interval. However, does this mean that the overall decision problem Read More …
[Solved]: What is the order of the Pancake graph in Given example & what are the properties of Pancake graph?
Problem Detail: Pancake graph have least diameter & degree (log n/ log log n) pancake Graph with order-2 will be one single line with two nodes, labeled with permutation of node {12, 21}. pancake Graph with order-3 will be one single Read More …
[Solved]: Difference between “information” and “useful information” in algorithmic information theory
Problem Detail: According to Wikipedia: Informally, from the point of view of algorithmic information theory, the information content of a string is equivalent to the length of the shortest possible self-contained representation of that string. What is the analogous informal rigorous Read More …
[Solved]: Problems that are Cook-reducible to a problem in NP $cap$ co-NP
Problem Detail: Let $mathcal{A}$ be a problem in $text{NP} cap text{co}$-$text{NP}$. Now assume we can reduce another problem $mathcal{B}$ to it using Cook reduction. What conclusions can we draw about $mathcal{B}$? Does this question even make sense? I’m asking because from Read More …