Problem Detail: I’m studying for an entrance exam and I have sample questions. One of the questions is this Prove that recurrence $T(n) = T(n/5) + T(4n/5)+n/2$ has a solution $T(n) = omega(n log n)$. Solve by drawing the recursion tree. Read More …
Blog
[Solved]: Meaning of the Halting problem
Problem Detail: The Halting Problem is defined as: $H_{TM} = { langle M, w rangle mid text{(M) halts on input (w)}}$ I’m not sure what it means. Is $H_{TM}$ a collection of Turing Machines such that all of them accept/reject the Read More …
[Solved]: Happened-before and Causal order
Problem Detail: I’m reading Lamport’s “Time, Clocks, and the Ordering of Events in a Distributed System” and there’s a detail that’s bugging me. Lamport defines the “happened before” partial order, which I understand. Then he says that “Another way of viewing Read More …
[Solved]: Data structure to use for a consumable message queue where it’s safe for messages to overwrite one another
Problem Detail: I have a queue of messages representing filesystem operations that need to be processed in order. A message may succeed or fail when it’s sent. A change message, for example, is generated when a user creates or saves a Read More …
[Solved]: Error in the use of asymptotic notation
Problem Detail: I’m trying to understand what is wrong with the following proof of the following recurrence $$ T(n) = 2,T!left(leftlfloorfrac{n}{2}rightrfloorright)+n $$ $$ T(n) leq 2left(cleftlfloorfrac{n}{2}rightrfloorright)+n leq cn+n = n(c+1) =O(n) $$ The documentation says it’s wrong because of the inductive Read More …
[Solved]: Is it impossible to truly emulate a system if its actual clock speed is the same?
Problem Detail: As I understand emulation a rule of the thumb says that a computer must be around a order of magnitude more powerful to emulate another system without resorting to tricks. This is because for every clock cycle of the Read More …
[Solved]: Shortest even path that goes through a vertex
Problem Detail: Given an undirected and connected graph $G=(V,E)$ and two vertices $s,t$ and a vertex $d in V- {s,t}$, we would like to define a legal path as a path from $s$ to $t$, passes through $d$ (at least once) Read More …
[Solved]: Complete examples of program correctness proofs
Problem Detail: Does anyone have any complete example of a proof of program correctness? I’m talking about something that includes the usual predicate, base case, inductive hypothesis, and inductive step. But also important is the loop invariant, and termination. I’m just Read More …
[Solved]: Generate random numbers from an interval with holes
Problem Detail: Given a set $S$ of $k$ numbers in $[0, N)$. The task is to randomly generate numbers in the range $[0, N)$ such that none belongs to $S$. Edit – Also given an API to generate random numbers between Read More …
[Solved]: What is the relationship between Turing Machines with a finite tape and Finite State Automata?
Problem Detail: I seem to recall from an undergraduate class that for a Turing Machine with a finite tape there will always exist a corresponding Finite State Automata, but I’ve been unable to find this confirmed anywhere on the internet. Is Read More …