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).

learn more… | top users | synonyms (1)

2
votes
0answers
96 views

What is the largest value one can get in game 2048 without new tiles appear

This is a simplified version of the famous game 2048. Given a 4x4 grids with some values chosen from {0, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048}. A value of 0 indicates that the position in ...
2
votes
0answers
54 views

Indexing ranked permutations into other ranked permutations

Consider all permutations of 0, ..., n-1 under some ranking R. Given two ranks, i and j, what is the rank of the permutation that results from applying the i'th permutation to the j'th permutation? ...
2
votes
0answers
90 views

Algorithm to find the “optimal” path in a given graph

Assume that $G=(V,E)$ is an undirected connected graph and that $H: V \to \mathbb R$ is a function that assign at each vertex $v \in V$ its height $H(v)$. Think of the pair $(G,H)$ as an energy ...
2
votes
0answers
103 views

Computing generators of the positive component of a graded ring

Let $R$ be a sub-algebra of $\mathbb{Q}[X_1^{\pm 1}, \dots, X_n^{\pm 1}]$ given by finitely many generators, and let $\lambda$ be a linear form $\lambda : \mathbb{Z}^n \to \mathbb{Z}$. This defines a ...
2
votes
0answers
127 views

Quaternion conversion

We have a normalized orthogonal co-ordinate frame travelling through the curve as in figure 1 below, from one end to other. Let us call starting end as A and ending end as B. What we know is initial ...
2
votes
0answers
53 views

Given a set of nonnegative numbers, put $\pm$ between them to minimize the magnitude of the result

Let's say I have a finite set of non-negative numbers. I have to put $+$ or $-$ between the numbers, in order to minimize the absolute sum.(i.e the sum has to be closest to 0) For example: the set: ...
2
votes
0answers
28 views

Does the method of steepest decent always move in an orthogonal direction between iterations?

I understand everything, I think, about the method but the result (or requirement) that successive steps are orthogonal to each other. SO, with the formula for this algorithm as: ...
2
votes
0answers
251 views

How to load warehouse pallets efficiently?

Assume that we would want to develop a warehouse management system, which picks up plastic boxes and stacks them on a pallet. A pallet has a maximum of $5$ vertical box stacks and the maximum height ...
2
votes
0answers
49 views

Finding whether a sum of numbers in a set generate another number

I have a set of numbers $\{a_1,\dots,a_n\}$ and another number $k$. I need to find whether sum of any combination of numbers in the set produces $k$. It can be $a_1 + a_2$ or $a_1 + a_2 + a_3 + a_7$. ...
2
votes
0answers
70 views

Risch Algorithm for trigonometric functions

I've implemented the transcendental Risch integration algorithm for logarithmic and exponential extensions ('classical Risch'). If I want to integrate functions containing trig-functions I have to ...
2
votes
0answers
42 views

Splitting a graph into two isomorphic parts

Say a graph $G$ has $2n$ vertices. I'd like to know if I can partition the vertices of $G$ into two parts $X$ and $Y$ such that $G[X]$ is isomorphic to $G[Y]$ ($G[S]$ denotes the subgraph of $G$ ...
2
votes
0answers
72 views

Tau Summatory Function

It is well known that the divisor summatory function can be calculated in $O(x^{1/2})$ via $$D(x)=\sum_{n\le x} d(n) = 2 \sum_{k=1}^{\lfloor \sqrt{x}\rfloor} \lfloor\frac{x}{k}\rfloor - \lfloor ...
2
votes
0answers
101 views

Building Minimum warehouses

A big international retailer is setting up shop in India and plans to open stores in N towns (3 ≤ N ≤ 1000), denoted by 1, 2, . . . , N. There are direct routes connecting M pairs among these towns. ...
2
votes
0answers
313 views

Count swap permutations

Given an array A = [1, 2, 3, ..., n]: ...
2
votes
0answers
298 views

How to distribute 5-digit numbers in 5x5 matrices

I have 98000 5-digit numbers, from 00001 to 98000. I need to distribute these 98000 numbers in 14000 5x5 matrices. A matrix cell must contain only a digit from 0 to 9. Each matrix must receive 7 ...
2
votes
0answers
69 views

“Alice and Bob” problem with matrices

Alice has a binary matrix $A$, and Bob has a binary matrix $B$. Both matrices are of size $n \times n$. Alice and Bob want to check if the matrices are equal except for exactly $1$ entry. Alice has to ...
2
votes
0answers
172 views

Flow reduction by removing a set of k edges

I am trying to find an algorithm which recieves as input: 1) a Flow network N(G,c,s,t) in which the capacity of an edge is either 0 or 1 (i.e. Exists or not). 2) a positive integer k The output ...
2
votes
0answers
42 views

Ordering binary matrices for reflection/rotation

I have a collection of $n\times n$ binary matrices and I would like to reduce it for symmetry ($D_4$ -- reflections and rotations). The naive method of testing each pair is very slow because the ...
2
votes
0answers
39 views

Combinations of Choices

I have a pretty hard problem to solve here, and I have no idea how to start. I have X kind of fruits and 5 colors (let's say Red, Green, Yellow, Blue and Purple). Each fruit can be available in ...
2
votes
0answers
25 views

Collapsing adjacent states in a grammar

I am trying to write a program which can induce a grammar from an example of the code(really more of a corpus than an example). I'm ignoring the decision problem, because I am doing two things that ...
2
votes
0answers
44 views

Prove that (x+1)! is not O(x!)

Discrete math question which is as follows: Prove that (x+1)! is not O(x!) using only the definition of Big-Oh notation. (Hint!: log(a * b) = (log a + log b)) I used a proof by contradiction saying ...
2
votes
0answers
84 views

Upper limit for adding N numbers in grid of N processors in parallel

We must show how N binary numbers, each consisting of N bits each, can be added in a linear grid of N+logN processors. Suppose that the binary digits can be inserted directly in each processor of the ...
2
votes
0answers
89 views

Todd-Coxeter algorithm: coincidences

I'm trying to understand the Todd-Coxeter algorithm with the help of a multiplication and relator table, but there is one thing about coincidences that is not really clear. For some small groups (for ...
2
votes
0answers
72 views

Composing permutations in factorial notation

Given two permutations $p_1$ and $p_2$ in factorial notation, is there a direct algorithm which computes their composition directly, i.e. without translating to a different notation or via computing ...
2
votes
0answers
53 views

Conjugate Gradient Method Near Exact Line Search

Unlike Newton-type methods, there is no natural step-length value $\alpha _k$ in conjugate gradient methods. Because of this, why do we need to use a near exact line search if we are to expect rapid ...
2
votes
0answers
20 views

Transforms with $O(N \log N)$ Complexity

Beside the Discrete Fourier and Walsh-Hadamard operators, are there any non-trivial, bijective operators that admit an evaluation algorithm of $O(N \log N)$ time complexity or better, whose inverses ...
2
votes
0answers
76 views

An algorithm for solving linear diophantine equations?

I am entering an interesting team based math contest called the purple comet, and quite a lot of questions on this contest involve Diophantine equations. For this contest, you are given a computer, ...
2
votes
0answers
44 views

Verify that this recurrence relation is in O(log n)

For the recurrence $T(n)=2*\lceil\frac{n+1}{2}\rceil+c$ is in $\Theta(lg n)$ My attempt at a solution (mostly just wanting to verify its correct). Lower Bound: $T(n)=2*\lceil\frac{n+1}{2}\rceil+c$ ...
2
votes
0answers
49 views

Performance estimation of shellSort

I'm trying to make a performance estimation for shell-sort algorithm. And I fail in it. My formula: equals to where dz is outer while-loop, dy is middle for-loop, and dx is inner for-loop ...
2
votes
0answers
164 views

Simple knapsack with arbitrary weights: Algorithm won't work, but my proof by induction doesn't agree.

We want to solve the simple knapsack problem: We're given a set of $n$ positive item weights, which are unique integers $\{w_1, \ldots , w_n\}$, and an integer $C > 0$, representing the capacity of ...
2
votes
0answers
62 views

Expected error due to the tablemakers' dilemma

[note: to me, this does not seem like a question for m.se, but on mathoverflow it has been retroactively closed, with very little indication of why or what might be corrected... and waiting for ...
2
votes
0answers
111 views

What are the principle behind calculation of pi

It is possible that this is a duplicate, but I cannot find anything. I have always been wondering how to calculate pi. However, just using a given formula like the infinite series formulas does not ...
2
votes
0answers
38 views

Decide whether a function has an elementary indefinite integral without determining it!

Risch, who developed the algorithm in 1968, called it a decision procedure, because it is a method for deciding whether a function has an elementary function as an indefinite integral; and also, if ...
2
votes
0answers
270 views

Triangle Packing-Problem

Theory and Question We define a normalized triangle $T$ as an ordered list of six points s.t. $p \in [0,1)$ for all $p \in T$. Let $T = [x_0, y_0, x_1, y_1, x_2, y_2]$ be a normalized triangle. We ...
2
votes
0answers
67 views

Rank Of A Matrix Under Special Conditions

Let A be a $N*N$ matrix. Now A is defined in a special manner: Each row of A is defined by two integers L and R ($0\le L,R\le {N-1}$), such that all elements from the $L^{th}$ to the $R^{th}$ are all ...
2
votes
0answers
168 views

Megaminx parity

I have an old 12-colored Megaminx that I put all new stickers on because the old ones were falling off. This Megaminx was in more of a state of disrepair than I originally thought, though, and when I ...
2
votes
0answers
32 views

Non Approximation result

Say we have a constant approximation algorithm for the following objective: $$\min_x f(x) \;\;\;\;\;\; (1)$$ Now, we want to solve the following objective: $$ \max_x (N - f(x)) \;\;\;\;\;\; (2) ...
2
votes
0answers
173 views

Finding maximum differences in an array of real numbers .

This is an algorithm design question which often appears in exams in a course that I take in the university . Suppose I have an array $A\in\mathbb{R}$ of size $n$ . I am required to find the ...
2
votes
0answers
57 views

Graph Connectivity

I am given an initial connected graph $G$ with $n$ nodes and $m$ edges. At each step I remove an edge from $G$ and ask if $G$ is connected. Can the queries be answered in $\mathcal{O}(\log n)$ time ...
2
votes
0answers
59 views

String diversity

String diversity is the number of symbols that occur in the string at least once. Diversity of s will be denoted by d(s). For example , d("aaa")=1, d("abacaba")=3. Given a string s, consisting of ...
2
votes
0answers
147 views

Using an elliptic curve to create pseudo random number

I recently started learning about encryption. I read about how elliptic curves can be used to create pseudo random numbers (and how the nsa might have abused this fact to create a backdoor in ...
2
votes
0answers
52 views

LLL and factoring polynomials in $\Bbb Z[x]$

Given a degree $2k$ reducible polynomial $f(x)=\sum_{i=0}^{2k}a_ix^i\in\Bbb Z[x]$ with $gcd(a_{2k},\dots,a_0)=1$ that is known to be of the form $f_1(x)f_2(x)$ with $deg(f_i(x))=\frac{deg(f(x)}{2}=k$ ...
2
votes
0answers
166 views

Megiddo's algorithm for lines of least weighted sum distance from a set of points

I came across the following problem: Given a set of n points (coordinate in 2d plane) within a rectangular space, find out a line ($ax+by=c$), from which the sum of the perpendicular distances of all ...
2
votes
0answers
51 views

Is there a known algorithm for approximating all the real and imaginary zeros of any well behaved equation of a single variable?

Does there currently exist a general algorithm (or set of algorithms used together) that will approximate all the zeros of any well behaved non-differential equation of a single variable which has a ...
2
votes
0answers
135 views

Lattice theory in mathematics and physics

I have undertaken a project examining lattice model and trying to construct algorithm that could work on all lattice (in physical sense, or crystal structure). I notice there is a branch in ...
2
votes
0answers
214 views

Limit definition for big O

so the def. says that $f(n) \in o(g(n))$ if for any $C > 0$ we have $C g(n) > f(n)$ for all $n\geq n_{0}$ i.e $$ \lim_{n\rightarrow \infty}\frac{f(n)}{g(n)} = 0 $$ in small o we the condition ...
2
votes
0answers
22 views

software to decide whether a 2-generator subgroup of PSL(2,R) is discrete/free

Gilman developed an algorithm with polynomial complexity that, given two elements in PSL(2,R), decides whether the group they generate is free/discrete or not. I was wondering whether anybody ever ...
2
votes
0answers
157 views

Does a matrix represent a bijection

We have a square binary matrix that represents a connection from rows to columns. Is there a way to tell if a bijection exists (other than checking for all possible bijections and iterating through ...
2
votes
0answers
31 views

Redistribution Algorithm

I've one thousand buckets of different sizes. Each bucket consists of red and blue balls of different weights. I know that $60$ percent of the total ball weight comes from the red balls and $40$ ...
2
votes
0answers
140 views

Bending of track in a racing game

I am trying to create a small racing game in which the track would be modeled using a BSpline curve for the path's center line and directional vectors to define the 'bending' of the track at each ...