Problem Detail: I would like to prove that we need at least five comparisons to find median amoung five numbers. And my proposition: Let’s consider tree of comparisons. There are at least $5 cdot {4choose 2} = 30$ possiblities, so in Read More …
Category: Uncategorized
[Solved]: Trouble understanding how to pick constants to prove big theta
Problem Detail: So I’m reading Introductions to Algorithms and sometimes I wish it would be a little bit more friendly with how it explains topics. One of these topics is proving big-theta. I understand that the definition of $Theta$ is as Read More …
[Solved]: How to call something that can be either a terminal or a nonterminal?
Problem Detail: I had written a compiler compiler a few years ago and I’m now cleaning it up, improving it, and turning it into C. I came across a terminology problem however that I remember in the past I couldn’t solve Read More …
[Solved]: Confused by Floating Point Spacing
Problem Detail: I’m currently taking a numerical analysis class in college and we’re covering floating point systems. For the most part, I have a good grasp on it. However, something I can’t seem to visualize, and haven’t seen any totally lucid Read More …
[Solved]: Find the number of topological sorts in a tree
Problem Detail: Find the number of topological sorts in a tree that has nodes that hold the size of their sub-tree including itself. I’ve tried thinking what would be the best for m to define it but couldn’t get anything specific. Read More …
[Solved]: How, in hardware, MIPS can access a word in the middle of an address
Problem Detail: This is am example of a RAM address in the MIPS architecture (32 bits) I can imagine the RAM as having 32 pins just to inform the RAM address I want to access, so I can access each of Read More …
[Solved]: Is $L= { a^ib^j mid jneq i and jneq2i } $ context free?
Problem Detail: $L = { a^ib^j mid jneq i and jneq2i } $ Is this language a context free language? If yes give a PDA. If no, give a proof. The pumping lemma for context free languages doesn’t seem to work Read More …
[Solved]: Big Oh vs Big Theta
Problem Detail: I mathematically understand $f(n) in O(g(n))$ : $f(n)$ does not grow faster than $g(n)$. More formally, $exists c, n_0$ s.t. $f(n) leq cg(n) forall n geq n_0$. Similarly, $f(n) in Theta(g(n))$ means that $f(n)$ grows approximately as fast as Read More …
[Solved]: Why is Oracle Turing Machine important?
Problem Detail: As you know, an Oracle Turing Machine (OTM) is a “black box” which somehow can tell us whether a given Turing machine with a given input eventually halts. By Church’s Thesis it is impossible to design an algorithm which Read More …
[Solved]: Binary tree traversals reversed
Problem Detail: Am I correct in saying that traverse(node): if node is null, return print node traverse(node’s right subtree) traverse(node’s left subtree) would produce output that is the reverse of post-order traversal? post-order(node): if node is null, return post-order(node’s left subtree) Read More …