Problem Detail: Suppose I have a queue where I pull from left and push to the right, and suppose I have the contents in the queue as $a b c @ d e$ (from left to right, left is head, right Read More …
Blog
[Solved]: Why do relational databases use 2PC for distributed transactions over the likes of Paxos?
Problem Detail: Paxos is more powerful and in the famous writing “Consensus on Transaction Commit” : http://research.microsoft.com/pubs/64636/tr-2003-96.pdf, Jim Gray and Leslie Lamport describe 2PC as a special case of Paxos. Why do relational database use 2PC in real world? Also 2PC Read More …
[Solved]: Can nodes in red-black trees have one nil child and one non-nil child?
Problem Detail: I don’t recall hearing that nodes in red-black trees can’t have one nil child and one non-nil child. However, I did hear that red-black trees have a worst-case height of $2log_2(n + 1)$, where n is the number of Read More …
[Solved]: Rewriting gates such as XOR into three basic gates?
Problem Detail: How would I rewrite an XOR gate into the three basic logic gates (AND, OR, NOT). To be more specific, I have to write it in such a way with 2 NOT gates, 2 OR gates, and 1 AND Read More …
[Solved]: Binary code with constraint
Problem Detail: Suppose I have an alphabet of n symbols. I can efficiently encode them with $lceil log_2nrceil$-bits strings. For instance if n=8: A: 0 0 0 B: 0 0 1 C: 0 1 0 D: 0 1 1 E: 1 Read More …
[Solved]: Efficient algorithm for detecting overlaps in time intervals
Problem Detail: Let’s say I am building a time clock app. The employee can log into the interface and then enter time for multiple projects so that we can generate reports for billing as well as payroll. A table in the Read More …
[Solved]: Can one consider living (biological) cell to be Turing Complete?
Problem Detail: Universal Turing Machine can be boiled down to two components. Infinite tape of input and an action table, a finite state machine that moves read/write head along the tape and writes to it depending on input provided by the Read More …
[Solved]: Issue in comparing classifiers for pattern recognition
Problem Detail: I have designed a classifier M which recognizes gestures and classifies it under any category always. A gesture is classified based on the hamming distance between the sample time series y and the training time series x. The result Read More …
[Solved]: Name for this algorithm?
Problem Detail: I’m trying to figure out if there is a proper or commonly accepted name for this particular function (f). float clamp(float min, float max, float v) { if (v < min) return min; else if (v > max) return Read More …
[Solved]: Is the difference of a non-recursive and recursive set recursive?
Problem Detail: I have two sets B which is recursively enumerable and is not recursive, and A which is recursive. Is $A-B$ recursive and / or recursively enumerable? What about $B-A$? $B-A$ is obviously recursively enumerable (to generate its elements, I Read More …