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 …
Category: Uncategorized
[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]: 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]: 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]: 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]: Queue, moving the element at the tail to the head
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 …
[Solved]: Natural occurrences of monads that make use of the category-theoretical framework
Problem Detail: Today, a talk by Henning Kerstan (“Trace Semantics for Probabilistic Transition Systems”) confronted me with category theory for the first time. He has built a theoretical framework for describing probablistic transition systems and their behaviour in a general way, Read More …
[Solved]: Why is the set of NFA that accept all words in co-NPSPACE?
Problem Detail: In Sipser’s book there is a section describing how to decide $qquaddisplaystyle mathrm{ALL}_mathrm{NFA} = { langle N rangle mid N text{ is an NFA}, L(N) = Sigma^*}$ in polynomial space. To do so, it shows $overline{mathrm{ALL}_mathrm{NFA} }$ is in Read More …
[Solved]: CCS process for a drink dispenser with two different prices
Problem Detail: A drink dispenser requires the user to insert a coin ($bar c$), then press one of three buttons: $bar d_{text{tea}}$ requests a cup of tea $e_{text{tea}}$, ditto for coffee, and $bar r$ requests a refund (i.e. the machine gives Read More …
[Solved]: Prove Σ* is decidable
Problem Detail: I see that Σ* is claimed to be decidable in many documents, but I have never seen an example or easy demostration that it is decidable. What is the proof that Σ* is decidable? Asked By : Charles Answered By Read More …