Problem Detail: I’m sure this is not a challenge for you but it remains an open question for me: Is it wise to prefer a recursive algorithm over its for-loop counterpart? E.g. take the evaluation of the natural logarithm of a Read More …
Blog
[Solved]: What mechanisms prevent a process from taking over the processor forever?
Problem Detail: Suppose a process keeps running code (e.g. an infinite loop). How can other programs take over? What prevents the process from remaining active forever? Asked By : Dionysus Answered By : Gilles Various peripherals are connected to the main processor. When Read More …
[Solved]: High Dimensional Data Structures
Problem Detail: I have a 20-dimensional dataset, with a large amount of data points. I would like to have each dimension discretized into bins. Per bin, I would like to be able to access two neighbours per dimension (i.e. +1 and Read More …
[Solved]: Understanding Closest Pair Algorithm (CLRS)
Problem Detail: I’m reading CLRS Section 33.4 Finding the closest pair of points. At exercise 33.4-2 they say 33.4-2 Show that it actually suffices to check only the points in the 5 array positions following each point in the array Y’ Read More …
[Solved]: Universal/existential quantification?
Problem Detail: I’m struggling to understand the purpose of universal and existential quantification of types. I’m playing around with writing a toy language based on the calculus of constructions. I’ve been reading about Morte and Henk to help me get a Read More …
[Solved]: Is $log(n!)$ in $Theta(n log(n))$?
Problem Detail: I had two questions on my automated test which I don’t understand the answer for. $log(n!) = log(ncdot (n-1)cdot cdots cdot 2cdot 1) = log(n)+log(n-1)+….+log(1)$. So it is in $O(nlog(n))$. But is it also in $Omega(n log(n))$? I don’t Read More …
[Solved]: What is a dichotomy? Whether 2-SAT itself is a dichotomy of SAT?
Problem Detail: Recently, I am reading papers about dichotomy. I do not understant what condition can be called as a dichotomy? What is the meaning of “a question is either in P or in NP–complete“? (assume P $neq$ NP) For example, Read More …
[Solved]: Shortest walk that covers $k$ nodes
Problem Detail: I have the following problem, I would like to know an efficient algorithm to solve it. Suppose I have a weighted graph $G$ and a set of vertices $K$, I want to find a walk which starts at a Read More …
[Solved]: Is it decidable whether a given context free grammar generates an infinite number of strings?
Problem Detail: Is the decision problem “Does a given context free grammar generate an infinite number of strings” decidable? In order to test whether a context free grammar generates an infinite number of strings or not, we can write a program Read More …
[Solved]: Shortest path that visits maximum number of strongly connected components
Problem Detail: Consider a directed graph. I need to find a path that visits maximum number of strongly connected components in that graph. If there are several such paths the desired path is the path that visits minimum number of nodes Read More …