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 …
Category: Uncategorized
[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]: Is Wadler’s ‘Theorems for Free’ as general as Design By Contract for establishing correctness?
Problem Detail: Philip Wadler has written a brilliant paper called ‘Theorems for Free’. The big idea is that you can use types to reason about your program, and even prove simple theorems about your program. We see these ideas about types Read More …
[Solved]: Need an algorithm to find the input factors that are most affecting the output
Problem Detail: I apologize if this question is already answered and appreciate any pointers to existing answers. I’m not familiar with statistical or data mining terms so my search was limited to basic words used in the title of this question. Read More …
[Solved]: Characterization of lambda-terms that have union types
Problem Detail: Many textbooks cover intersection types in the lambda-calculus. The typing rules for intersection can be defined as follows (on top of the simply typed lambda-calculus with subtyping): $$ dfrac{Gamma vdash M : T_1 quad Gamma vdash M : T_2} Read More …
[Solved]: How does the processor find kernel code after an interrupt?
Problem Detail: When an interrupt occurs, the processor preempts the current process and calls kernel code to handle the interrupt. How does the processor know where to enter the kernel? I understand that there are interrupt handlers which can be installed Read More …