Problem Detail: Given a weighted digraph, I can check whether a given vertex belongs to a negative cycle in $O(|V|cdot|E|)$ using Bellman-Ford. But what if I need to find all vertices on negative cycles? Is there a way to do it Read More …
Author: ignougroup
[Solved]: Closed-form Expression of the Expected value of the Cost of D&C Algorithm?
Problem Detail: Let there is a binary-string, $B$, of length $N$. The probability of occurrence of 0 and 1 in this binary-word is $p$ and $q$ , respectively. Each bit in the string is independent of any other bit. There is Read More …
[Solved]: Prove that regular expression is unambiguous
Problem Detail: I’ve got following definition: Function $f$ is a valid mapping of word $w$ to regular expression $R$, if any of following conditions is true: $R = w$ and $f$ is the identity or $R = epsilon$ and $w = 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]: 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]: 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]: 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]: 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]: 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]: Do recursive algorithms generally perform better than their for-loop counterpart?
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 …