I'm looking for an algorithm but I don't quite know how to implement it. More importantly, I don't know what to google for. Even worse, I'm not sure it can be done in polynomial time.
Given a set of numbers (say, {1, 4, 5, 9}), I want to enumerate…
In a recent discussion, I came across the idea of proving a lower bound for the number of comparisons required to find the largest element in an array. The bound is $n - 1$. This is so because the set of comparisons performed by every such algorithm…
Here's one that popped into my mind when I was thinking about binary search.
I'm thinking of an integer between 1 and n. You have to guess my number. You win as soon as you guess the correct number. If your guess is not correct, I'll give you a hint…
This has been asked at least twice here, but both questions have accepted answers which are wrong. I don't really know any good way to draw attention to the question besides asking again and being a bit more careful about not accepting incorrect or…
A pin is dropped at a random point $p$ on the real line, with $p$ determined from a normal distribution with mean $0$ and standard deviation $\sigma$. You are dropped on the real line at $x=0$ and tasked with finding the pin. You can move left or…
The name of Uniform-cost search in computer science is not instinctive since what part of it being "uniform" is not clear to me. Apparently uniformity is not about the cost of each edge - most of the examples handle edges with various costs. Can…
There is a vast literature on the reconstruction conjecture which says that two graphs with the same deck $D$ are isomorphic. The deck is the multi-set of vertex-deleted subgraphs of a graph (which are called cards).
I'd like to take the other…
Update:
This is my solution with Kruskal's Algorithm, although it doesn't take into account real "path". Brute force may be the only solution.
http://www.youtube.com/watch?v=VbSwwos4R2E
Hi, I want to know if there is an algorithm that allows me to…
Definition 1: A "fence" is a set of "fence post positions", where each pair of adjacent positions has the same difference (the spacing), e.g. $\{1,2, 3, 4\}$.
A fence is described by three values ($\in \mathbb{R}$): lower bound ($l$), upper bound…
Let's say I have a matrix of values that represent heights with function $f(x,y)$ and I am trying to find the "lowest value path" beween two points. So this would be the reverse of hill climbing, as in optimization, taking gradient and following…
I am not sure if this is the right website to ask this question but I cant figure out where else to get the answer so, please, dont be mad :-)
As my bachelor thesis/project, I am trying to construct a short-scale search engine using TF-IDF measure.…
I am referring to the algorithm presented here used to find a good pivot: http://en.wikipedia.org/wiki/Selection_algorithm#Linear_general_selection_algorithm_-_Median_of_Medians_algorithm
My question is I don't quite understand why the elements…
I read a story about somebody getting lost in a forest, and, apart from sympathy, the following mathematical problem came to my mind.
Suppose the lost person is sitting still at an unknown point in a square SxS forest (I saw a couple of questions on…
I am stucked at this problem:
Suppose we have the following grid configuration (or matrix) $G\in \Bbb{M}^{\{0,x,y\}}_{m\times n}$
(I.e $G$ is a matrix that have $m$ rows and $n$ colums over the alphabet $\{0,x,y\}$)
$$G=
\begin{bmatrix}
…