Most Popular

1500 questions
13
votes
1 answer

Smoothing in Naive Bayes model

A Naive Bayes predictor makes its predictions using this formula: $$P(Y=y|X=x) = \alpha P(Y=y)\prod_i P(X_i=x_i|Y=y)$$ where $\alpha$ is a normalizing factor. This requires estimating the parameters $P(X_i=x_i|Y=y)$ from the data. If we do this with…
Chris Taylor
  • 231
  • 1
  • 2
  • 4
13
votes
1 answer

Memory ballooning in the OS

Some hypervisors optimize memory usage using a method that is called ballooning (at least that's what KVM calls it), this method deduplicates memory between VMs and sets common pages to read-only with copy on write. This is sort of the opposite of a…
13
votes
3 answers

How does the processor find kernel code after an interrupt?

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 for each…
13
votes
2 answers

Halting problem without self-reference

In the halting problem, we are interested if there is a Turing machine $T$ that can tell whether a given Turing machine $M$ halts or not on a given input $i$. Usually, the proof starts assuming such a $T$ exists. Then, we consider a case where we…
zpavlinovic
  • 1,664
  • 10
  • 19
13
votes
2 answers

Graph isomorphism problem for labeled graphs

In the case of unlabeled graphs, the graph isomorphism problem can be tackled by a number of algorithms which perform very well in practice. That is, although the worst case running time is exponential, one usually has a polynomial running time. I…
Max
  • 131
  • 1
  • 3
13
votes
1 answer

Proving the security of Nisan-Wigderson pseudo-random number generator

Let $\cal{S}=\{S_i\}_{1\leq i\leq n}$ be a partial $(m,k)$-design and $f: \{0,1\}^m \to \{0,1\}$ be a Boolean function. The Nisan-Wigderson generator $G_f: \{0,1\}^l \to \{0,1\}^n$ is defined as follows: $$G_f(x) = (f(x|_{S_1}) , \ldots, f(x|_{S_n})…
Kaveh
  • 22,661
  • 4
  • 53
  • 113
13
votes
5 answers

Word Frequency with Ordering in O(n) Complexity

During an interview for a Java developer position, I was asked the following: Write a function that takes two params: a String representing a text document and an integer providing the number of items to return. Implement the function such…
user2712937
  • 131
  • 1
  • 1
  • 3
13
votes
2 answers

Are there any existing problems that wouldn't be solvable with a halting oracle?

I understand that most problems are trivial if a halting oracle is available (or, I think equivalently, hyper-computation). However, applying the argument that shows the Halting Problem is impossible for a Turing machine also shows that it is…
13
votes
1 answer

Research in Graph Theory versus Graph Algorithms

I have a very generic question to ask. It is related to research. I'm interested in Graph theory. I have done a course in it. I have done some topics related to both graph theory as a point of view of doing it as a mathematics student and also…
legendkiller
  • 131
  • 1
  • 3
13
votes
1 answer

Analyzing a modified version of the card-game "War"

A simple game usually played by children, the game of War is played by two people using a standard deck of 52 playing cards. Initially, the deck is shuffled and all cards are dealt two the two players, so that each have 26 random cards in a random…
Patrick87
  • 12,924
  • 1
  • 45
  • 77
13
votes
1 answer

Which NP-Complete problem has the fastest known algorithm?

In terms of worst-case asymptotic runtime, which NP-complete problem has the fastest-known (exact) algorithm and what is the algorithm? Is there something known that is faster than $O(n^2*2^n)$?
13
votes
2 answers

Why is the k-bounded spanning tree problem NP-complete?

The $k$-bounded spanning tree problem is where you have an undirected graph $G(V,E)$ and you have to decide whether or not it has a spanning tree such that each vertex has a degree of at most $k$. I realize that for the case $k=2$, this is the…
user17199
  • 131
  • 1
  • 1
  • 5
13
votes
1 answer

Computing the intersection of two NPDA where it is possible

Apropois to Raphael's suggestion on Intersection of two NPDAs: Let $A_1$ and $A_2$ NPDA for context-free languages $L_1$ and $L_2$, respectively. Assuming that we know that $L = L_1 \cap L_2$ is context-free, can we (effectively) construct NPDA $A$…
soandos
  • 1,143
  • 2
  • 10
  • 23
13
votes
2 answers

Are there any garbage collectors that take into account paging?

Garbage collections have to visit all objects that are alive, so as to find the memory that can be reclaimed. (Having many generations’ just delays this a bit) All things being equal, it is clearly better to first visit the object that are…
Ian Ringrose
  • 809
  • 6
  • 12
13
votes
1 answer

Runtime bounds on algorithms of NP complete problems assuming P≠NP

Assume $P\neq NP$. What can we say about the runtime bounds of all NP-complete problems? i.e. what are the tightest functions $L,U:\mathbb{N}\to\mathbb{N}$ for which we can guarantee that an optimal algorithm for any NP-complete problem runs in time…
R B
  • 2,644
  • 17
  • 35