Problem Detail: Given two languages $L_1$ and $L_2$ that are in $mathsf{P}$, can it be proven that there is a polynomial time reduction from $L_1$ to $L_2$ and vice versa? If so, how? I noticed that if $L_1$ is the empty Read More …
Category: Uncategorized
[Solved]: Which kind of branch prediction is more important?
Problem Detail: I have observed that there are two different types of states in branch prediction. In superscalar execution, where the branch prediction is very important, and it is mainly in execution delay rather than fetch delay. In the instruction pipeline, Read More …
[Solved]: Union of a Deterministic Context-free language and a Regular Language is a Deterministic Context-free Language
Problem Detail: In formal language theory, deterministic context-free languages (DCFL) are a proper subset of context-free languages. They are the context-free languages that can be accepted by a deterministic pushdown automaton. Now Assume that $R$ is a regular language and $D$ Read More …
[Solved]: If recursive Fibonacci is $O(2^N)$ then why do I get 15 calls for N=5?
Problem Detail: I learned that recursive Fibonacci is $O(2^N)$. However, when I implement it and print out the recursive calls that were made, I only get 15 calls for N=5. What I am missing? Should it not be 32 or near Read More …
[Solved]: How to find the big O notation of $log^b x$
Problem Detail: How would you determine big O notation for $log^b x$? I don’t think you can simply say $O(log^b x)$, can you? If you can, then here is a better question: $x^3 + log^b x$. How would you know if Read More …
[Solved]: Is oracle computer capable of doing infinite loops?
Problem Detail: Solve this problem: “build an infinite binary oscilator” With a Turing Machine we can solve it a=False While True: a=not a print a, then output will be True False True False True False … (for ever) I think an Read More …
[Solved]: Mutual exclusion for n processes
Problem Detail: I want to implement mutual exclusion for $n$ processes. Critical section code: int turn = 0; /* shared control variable */ Pi: /* i is 0 or 1 */ while (turn != i) ; /* busy wait */ CSi; Read More …
[Solved]: DFS miniumum spanning tree
Problem Detail: Just a quick question, If i were to alter the general DFS algorithm to do this: minDFS(Vertex v) { if (!v.getVisted()) { v.setVisited(); Vertex temp = findClosestVertex(); graph.addEdge(v, temp); minDFS(temp); } } Would I eventually (at the end of Read More …
[Solved]: What is a compact way to represent a partition of a set?
Problem Detail: There exist efficient data structures for representing set partitions. These data structures have good time complexities for operations like Union and Find, but they are not particularly space-efficient. What is a space-efficient way to represent a partition of a Read More …
[Solved]: Why can PDAs only write one symbol to the stack according to this definition?
Problem Detail: This is in regards to the definition 2.13 of non-deterministic PDA given in Theory of Computation 3rd ed. by Michael Sipser. The transition is defined as $$ delta: Qtimes Sigma_varepsilon times Gamma_varepsilon to P(Qtimes Gamma_varepsilon) $$ where $Q$ is Read More …