Problem Detail: I don’t understand why $n log log n $ is not $Theta (n)$. Suppose we give $n$ a value of $10,000$. Then $n log log n$ is $6020.6$. So isn’t $n log log n$ upper- and lower-bounded by $n$, Read More …
Category: Uncategorized
[Solved]: Solving recurrence with logarithm squared $T(n)=2T(n/2) + n log^2n$
Problem Detail: $T(n)=2T(n/2) + nlog^2(n)$. If I try to substitute $m = log(n)$ I end up with $T(2^m)=2 T(2^{m-1}) + 2^mlog^{2}(2^m)$. Which isn’t helpful to me. Any clues? PS. hope this isn’t too localized. I specified that the problem was a Read More …
[Solved]: The exact relation between complexity classes and algorithm complexities
Problem Detail: Are all algorithms which have polynomial time complexity belong to P class ? And P class do not have any algorithm which does have not polynomial complexity ? Are all algorithms which have non polynomial complexity belong to NP Read More …
[Solved]: Did I correctly prune this min-max search tree using alpha-beta pruning?
Problem Detail: I am studying some old past test questions. Is this search tree correctly pruned? Asked By : gbhall Answered By : gbhall I was close. Here’s an answer from my tutor which makes sense: There should be some pruning on Read More …
[Solved]: Period in postulate; what does it mean?
Problem Detail: While I am learning a lot from others here at the Computer Science site, I must admit that I don’t get as much out of some questions and answers since I typically don’t understand the theorems to the level Read More …
[Solved]: Is the problem of evaluating a boolean formula on a given assignment P-complete?
Problem Detail: I know that the CIRCUIT VALUE problem is P-complete. In the CIRCUIT VALUE problem the input is a Boolean circuit together with an input to this circuit, and the answer is the evaluation of the given circuit on the Read More …
[Solved]: What goes wrong with sums of Landau terms?
Problem Detail: I wrote $qquad displaystyle sumlimits_{i=1}^n frac{1}{i} = sumlimits_{i=1}^n cal{O}(1) = cal{O}(n)$ but my friend says this is wrong. From the TCS cheat sheet I know that the sum is also called $H_n$ which has logarithmic growth in $n$. So Read More …
[Solved]: What is the time complexity of checking if a number is prime?
Problem Detail: Could some one please explain how to get the time complexity of checking if a number is prime? I’m really confused as to if it is $O(sqrt{n})$ or $O(n^2)$. I iterate from $i=2$ to $sqrt{n}$ and continuously checking if Read More …
[Solved]: Why is compression ratio using bzip2 for a sequence of “a”s so jumpy?
Problem Detail: library(ggplot2) compress <- function(str) { length(memCompress(paste(rep(“a”, str), collapse=””), type=”bzip2″)) / nchar(paste(rep(“a”, str), collapse=””)) } cr <- data.frame(i = 1:10000, r = sapply(1:10000, compress)) ggplot(cr[cr$i>=5000 & cr$i<=10000,], aes(x=i, y=r)) + geom_line() The compression ratio starts out at 37 for Read More …
[Solved]: Call by need compared to pass by function
Problem Detail: SML uses pass‑by‑value, Haskell uses call‑by‑need. Unless I’m wrong (the purpose of this question), one can do call‑by‑need with SML, passing a function instead of a value; a function to be later evaluated when needed. Adapting a classical example: Read More …