Questions tagged [algorithms]

Mathematical questions about Algorithms, including the analysis of algorithms, combinatorial algorithms, proofs of correctness, invariants, and semantic analyses. See also (computational-mathematics) and (computational-complexity).

An algorithm is an unambiguous specification of how to solve a class of problems. The study of algorithms is the branch of mathematics that specializes in finding efficient (mostly in the terms of time and space complexity) for various computational problems. It often involves combinatorics, number theory and geometry.

The field also includes data structures, computational models and proofs of lower bounds for certain algorithms.

See also and .

10691 questions
3
votes
1 answer

What's the most efficient algorithm to determine the relative ordering of an unknown set of values?

This comes from a question on Arqade. The background is, there's a mall level. Vlad the organized crime boss wants $50,000 worth of mall property destroyed. Your task is to shoot and blow stuff up until that happens. There are 12 stores in…
3
votes
1 answer

Play with pairs of numbers

Two players are playing a game. The game is played on a sequence of positive integer pairs. The players make their moves alternatively. During his move the player chooses a pair and decreases the larger integer in the pair by a positive multiple of…
3
votes
1 answer

Boxcar Recursive Method for Finding Standard Deviation

I'm trying to develop a real time algorithm for finding level areas of an electrical signal. To do so I need to find the variance for a particular rolling time interval. From John Cook's blog and the Art of Computer Programming the algorithm for…
David Rinck
  • 155
  • 3
3
votes
2 answers

The fundamental group of $K_{3,3}$ -- relationship between its generators and embedding into manifolds

So I've been reading this wonderful PDF textbook on algebraic topology: http://www.math.uchicago.edu/~may/CONCISE/ConciseRevised.pdf In particular, I'm very interested in the chapter on graphs. This corollary seems to give the construction of the…
3
votes
1 answer

How to arrange $n$ pairs of numbers so that this expression is minimized

Consider $n$ pairs of positive integers, $(x_1, y_1), (x_2, y_2), \dots, (x_n, y_n)$. Make a permutation $(a_1, b_1), (a_2, b_2), \dots, (a_n, b_n)$ of these pairs, such that for all $x_i, y_i$, a pair $a_j, b_j$ also exists and such that,…
Gerard
  • 4,004
  • 4
  • 23
  • 54
3
votes
1 answer

Asymptotic upper bound of Bisecting trees

The question is : B-3 Bisecting trees Many divide-and-conquer algorithms that operate on graphs require that the graph be bisected into two nearly equal-sized subgraphs, which are induced by a partition of the vertices. This problem…
faceclean
  • 6,585
  • 8
  • 34
  • 63
3
votes
4 answers

Co Prime Numbers less than N

I need to find all the numbers that are coprime to a given $N$ and less than $N$. Note that $N$ can be as large as $10^9.$ For example, numbers coprime to $5$ are $1,2,3,4$. I want an efficient algorithm to do it. Can anyone help?
user3001932
  • 1,028
  • 2
  • 10
  • 25
3
votes
1 answer

Modulo over rational numbers?

Consider two irreducible fractions: $r_1 = \frac{p_1}{q_1}$ $r_2 = \frac{p_2}{q_2}$ with $r_1 \ge 0$ and $r_2 \ge 0$. How the modulo $\%$ is defined over rational numbers (I think that is $r_3$ such that $r_1 = r_2 \times n + r_3$ with $n$ a…
Vincent
  • 1,323
  • 1
  • 13
  • 28
3
votes
1 answer

Move the Bishop

Given an n × m chessboard, a bishop and two numbers a and b.Initially bishop is placed on the position (i, j) on the board.There can only be actions of the following types: move the Bishop from position (x, y) on the board to position…
user3001932
  • 1,028
  • 2
  • 10
  • 25
3
votes
3 answers

Tiny Planet Algorithm?

So I've recently been looking at the Tiny Planet images. I've been googling a few things to try and find out how images are converted from normal to a tiny planet. Some phone apps, as well as photoshop do this. I think Photoshop does it by…
Reanimation
  • 165
  • 6
3
votes
2 answers

calculating the Fermat point of a triangle

Is there any algorithm by which one can calculate the fermat's point for a set of 3 points in a triangle? a fermat's point is such a point that the sum of distances of the vertices of the triangle to this point is minimum. I came across several…
pranay
  • 385
  • 4
  • 15
3
votes
2 answers

Counting Distinct Palindromic Substrings

Given a string $S$, I want to count the number of distinct palindromic substrings of $S$. I know the basic $o(n^2)$ approach to do so. But I want to find a better approach for strings that can be very large (of the order of $10^5$). So I want a…
user3001932
  • 1,028
  • 2
  • 10
  • 25
3
votes
1 answer

Program for generating the coefficients of the nth cyclotomic polynomial

Is there a program that generates the coefficients of the nth cyclotomic polynomial?
Mayank Pandey
  • 1,887
  • 12
  • 18
3
votes
2 answers

Cubic spline interpolation - how to calculate second derivative

I ask this qeustion on stackexchange sites: stackoverflow, codereview, and signal processing and no one can help and they send me here :) So I implement cubic spilne interpolation in Java base on this…
Mr Jedi
  • 145
  • 1
  • 5
3
votes
2 answers

Why is the Fisher-Yates shuffle $O(n^2)$?

I was comparing the original Fisher-Yates shuffle vs the modern Fisher-Yates shuffle. This reduces the algorithm's time complexity to O(n), compared to O(n2) for the naive implementation. Ok I cannot understand how is it that we have n2 for the…
Pacerier
  • 3,261
  • 6
  • 24
  • 29
1 2 3
99
100