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)

0
votes
0answers
16 views

Collections similarity using eigenvectors

Is it reasonable to assume that the similarity between two collections P and Q can be measured by a principal eigenvector of a symmetrical affinity matrix of the two collections? In detail, I am ...
1
vote
2answers
29 views

Variation of Division Algorithm

How to derive this version of the division algorithm . For integers a, b with b ≠ 0 there exist unique integers q and r that satisfy a = qb + r, where -1/2|b| < r ≤ 1/2 b. I started off with ...
1
vote
0answers
17 views

FFT procedure for evaluationg a polynomial at $N$ Fourier points

The following is the recursive FFT procedure of Algorithm for evaluationg a polynomial of length $N$ at $N$ Fourier points. Algorithm (FFT - fast Fourier transform). Input arguments. $ \ ...
0
votes
2answers
18 views

Reversing Rotation + XOR

I have this cypher which is as follows : Take 2 numbers : A=1011 and B=1010 if the ith bit of X is 1 then shift Y* i times to the left. So in the end you will get ...
5
votes
1answer
42 views

An algorithm for filling a moving truck

I was recently helping a friend move. I stood in the moving truck as other people brought boxes and furniture pieces from inside the house. My job was to arrange these items in an efficient way inside ...
-2
votes
0answers
21 views

Big O solving problem [on hold]

show that $T(n) = O(f(n))$ by providing the appropriate constants $c$ and $n$ base $0$ such that $T(n) \leq c f(n),~ n\geq n$ (base $0$)? $T(n)=n^3 + 3n - 60$, $f(n)=n^3$ $T(n)=n log_2 (n) + 4 f(n) ...
0
votes
1answer
32 views

How do I find if a series of integers is (somehow) regular

[DISCLAMIER]: please be patient and low profile: no math background here :) I have a database of transactions, i.e. a list of purchases made by different customers. What I have to figure out is ...
2
votes
0answers
38 views

Calculation of product of all coprimes of number less than itself

Is there any fast way or formula to calculate product of all coprimes of a number less than itself? How can we do it without finding all coprimes manually?
4
votes
0answers
66 views

Algorithm to find shortest path to net values across nodes

I have an undirected graph $G = (V, E)$ with nodes $V$ and edges $E$. Each node $v$ has an associated number $n_v \in \mathbf{Z}$ Let us define for any two nodes $v, w \in V$ connected by an edge $e ...
0
votes
1answer
70 views

How can I solve this recurrence problem?

Given a function $$ f(n) = f(5n/13) + f(12n/13) + n \;\;\;\;∀n \geq 0 $$ I would like to find a function $g(n)$ such that $f ∈ Ө(g(n))$.
1
vote
2answers
32 views

A graph with $V$ vertices has at most $V(V-1)/2$ Edges

I am reading about graph theory. A graph with $V$ vertices has at most $V(V-1)/2$ Edges Proof: The total of $V^2$ possible pairs of vertices include $V$ self-loops and accounts twice for each edge ...
0
votes
0answers
27 views

Efficient Test For Commuting Matrices

I know that if $A$ and $B$ are two Hermitian matrices, then $A B= B A$ if and only if their eigenspaces coincide [1]. In order to apply this test one need to compute eigenvectors of both $A$ and $B$ ...
4
votes
1answer
120 views

Expected value when die is rolled $N$ times

Suppose we have a die with $K$ faces with numbers from 1 to $K$ written on it, and integers $L$ and $F$ ($0 < L \leq K$). We roll it $N$ times. Let $a_i$ be the number of times (out of the $N$ ...
0
votes
2answers
42 views

To fast invert a real symmetric positive definite matrix that is almost similar to Toeplitz

It is well known how to solve a Toeplitz system Ax = b, of a matrix A, n x n elements, ...
0
votes
0answers
30 views

Relation between farthest pair of points and closest pair of points in plane

I am writing program for obtaining distance between shortest and farthest pair of points among the given points in plane .I am able to calculate them both the shortest one using divide and conquer ...
-3
votes
0answers
17 views

What are the properties of an algorithm? Or what are different Types of algorithms? [on hold]

Please explain what are the different types of algorithms.
-1
votes
1answer
34 views

Finding the intersections from most intervals [on hold]

I am looking for a data structure that can perform following operations: Insert and delete intervals. At any time, return the intersections [x;y] of most current intervals. For example, if ...
0
votes
0answers
29 views

Piecewise Logistic Function [Satellite Data] [on hold]

I am working with $16$-day MODIS EVI (satellite) data and I want to fit a Piece-wise Logistic Function through my $23$ EVI data values. The following formula is for the Piece-wise Logistic Function: ...
-1
votes
0answers
18 views

Average operations on a hashtable

Suppose we are given an empty hash table of size $n$, where collisions are resolved by re-hashing (open addressing). Next, $n/2$ items are randomly inserted into the table using a hash function that ...
0
votes
1answer
24 views

Show that running time of Quick Sort is $\mathcal O(n^2)$ when array contains distinct elements and is sorted in descending order

I'm trying to study running time for various algorithms. Now I have QuickSort. How exactly is the running time of an algorithm calculated, I know how quick sort works and the Asymptontic notations. I ...
0
votes
1answer
17 views

Target coordinates given estimate distance from multiple points

I have a device that emits a probe signal, let it be called X. The location of the device is unknown. I have multiple readings of the probe signal in different GPS coordinates spread over an area , ...
0
votes
0answers
13 views

How to compute whether an almost homomorphism is positive or negative when it isn't 0?

A function $f:\mathbb Z \to \mathbb Z$ is almost a homomorphism if there is a $C \in \mathbb N$ (called the additive constant) such that for all $x, y \in \mathbb Z$ $$f(x+y)-(f(x)+f(y)) \le C$$ For ...
0
votes
0answers
59 views

Is there a general solution to the water-bucket logic problem?

Having an infinite supply of water and two containers, one for 3 liters and one for 5 liters, how would you measure 4 liters? Each step in the solution can be one of three things: Fill up a container ...
-2
votes
0answers
18 views

What formula/algorithm would be used to find the significant points of a 2.5D point cloud?

Example of the results of a tool that does something similar. (Link to the tool). Edit 1: Clarification 2.5 dimensional point cloud: A uniform grid of points on the X and Y axes, where the points ...
0
votes
0answers
13 views

Function/algorithm to generate a random walk on a graph

I'm looking for a graph function or an algorithm that can generate a random fluctuating random walk that will eventually converge between the value of y = 0 and y = 1, more or less after a number of ...
0
votes
0answers
12 views

Determine Similarity Algorithm Used

For a known set the comparison values, and result scores, is it possible to determine the similarity comparison algorithm that is being used? When using a Similarity function for SQL Servers ...
2
votes
0answers
21 views

Fast Way to Compute DFT with index summation subject to a constraint

I really appreciate if anyone can help me with this problem. Problem: Let $W_n=e^{\frac{2\pi i}{N}}$ which is the $N$th root of unity. The backward Discrete Fourier Transform of a complex vector ...
3
votes
0answers
24 views

Need to calculate number of valid domain names between two other domain names

A domain name can be 2 to 32 characters in length. The first character can be the characters 'a' through 'z' The last character can be the characters 'a' through 'z' or '0' through '9' The ...
2
votes
1answer
38 views

Puzzle: Determining the structure of a bipartite graph

Consider the bipartite graph $G = (X, Y, E)$, with $|X| = |Y| = n$. We can think of $X$ and $Y$ as clusters of $n$ switches on either end of a long hallway. Each switch on one end of the hallway has ...
0
votes
1answer
59 views

Is there an O(1) operation to find the Nth digit of Pi?

I'm afraid that 10 minutes of googling isn't finding references to a paper that I thought existed. I remember seeing some years ago a reference to a paper that claims to have proven an algorithm that ...
-1
votes
1answer
43 views

Calculating distance between two squares of a board

Given an $n\times n$ board, for example a chess board 8x8, with the squares ordered in a Little-Endian Rank-File Mapping. Is there a direct way to calculate the distance between two squares using ...
2
votes
0answers
13 views

Accelerated Gradient Descent V.S Nonlinear Conjugate Gradient Descent

Let's consider smooth and convex minimization problem, i.e. $min f(x)$, where $f$ is not necessarily a quadratic function. If measured by iterations, Accelerated Gradient Descend (AGD) has ...
0
votes
1answer
18 views

How to find right child in a pyramid number?

A pyramid number: 0 1 2 3 4 5 6 7 8 9 So is there any equation like: ...
5
votes
1answer
108 views

How can I calculate the formula of this fractal-like structure?

I did the following fractal-like structure manually, and I was trying to convert it to a formula (or an algorithm including formulas) to compute some parts of the drawing, but I get lost due to the ...
0
votes
1answer
19 views

How to find maximal dimension abelian subalgebra in finite Lie Algebra?

Is there any well known algorithm how to find maximal dimension abelian subalgebra in finite dimension Lie Algebra? If there is a built-in routine in some computer algebra system, it is the most ...
0
votes
0answers
31 views

Exponentiation of Pascal's Triangle(in matrix form)

I want to find a pattern in subsequent exponentiations of the pascal triangle shown in the form below Matrix P[K+1][K+1]: $$ \begin{matrix} \binom{0}{0} & 0 & 0 & 0\cdots ...
1
vote
1answer
22 views

More efficient algorithm for matrix rearrangement (MatLab)

Say I have the following matrix: $$A = \begin{bmatrix}0.1 & 2 \\ 0.1 & 4 \\ 0.1 & 6 \\ 0.2 & 3 \\ 0.2 & 2 \\ 0.2 & 7 \\ 0.3 & 10 \\ 0.3 & 7 \\ 0.3 & 5 ...
0
votes
1answer
14 views

How to insert a knot in NURBS if it coincides with the first knot?

I want to insert a knot to the knot vector. Currently I use the algorithm from the NURBS book, but it has an assumption that U={0,...0,u_{k},u_{k+1}...,1,...1}, the first knot and the last knot repeat ...
1
vote
1answer
23 views

Solving for a Binary Matrix: A somewhat unusual method needs justification, and mabye interpretation.

Introduction: Define a "Bit Map" to be a matrix whose entries can only be $0$ or $1$. Then numbers above and beside each column and row indicates how many entries are "filled" with a one. For ...
1
vote
0answers
24 views

Coin distribution problem to optimize

There are $N$ users, with each user having a money request. There are $T$ coins, these coins are to be assigned to the user in such a way that its request is fulfilled. Assume each coin may have ...
0
votes
0answers
10 views

Prove that if $e \in \left ( S\to \overline S \right )$ when $\left ( S, \overline S \right )$ is a min-cut, then $f(e) = c(e)$

Given a min-cut $\left( S, \overline S \right )$, we define $\left ( S\to \overline S\right ) =\{\left (u\to v\right )|u \in S, v\in \overline S\}$ and $\left ( \overline S \to S \right )$ similarly. ...
0
votes
1answer
11 views

Recursive formula for minimal editing distance - check my answer

Given a word $X=x_1x_2x_3...x_i$ and $Y=y_1y_2y_3...y_j$, the minimal editing distance is defined to be the minimal number of actions needed to transform $X$ to $Y$ where the legal actions are: 1) ...
0
votes
0answers
19 views

RSA number sequence encryption

Encrypt the following number sequence $3,9,27$ with key $m=33$ and $r=7$ It's about RSA encryption. How should I encrypt this? Should I find the key $s$ (inverse key) and what then? $r \cdot s + ...
0
votes
0answers
29 views

Degree-Constrained Shortest Path Problem

The following is my problem: Given an undirected graph G(V,E) with cost c(e) associated with every edge e∈E such that c(e)>0 and a vector d=(dv : v∈V) which denotes the maximum degree on each vertex ...
0
votes
0answers
40 views

Minimum spanning tree for a weighted square grid

I have a particular grid with weighted edges connecting each vertex: From this I'm looking for an easy method to obtain a Minimum Spanning Tree. I can easily check columns or rows and remove all ...
0
votes
1answer
18 views

How do we prove a method is optimal?

This is a very simple question, infact it's so simple that I have no idea how to solve it. We have an ordered list of $n$ words. The length of the $i$'th word is $W_i$. Our goal is to write all the ...
1
vote
1answer
25 views

List all sets of points in a plane that are enclosed by circles with given radius

My problem is: Given N points in a plane and a number R, list/enumerate all subsets of points, where points in each subset are enclosed by a circle with radius of R. Two subsets $S_i$ and $S_j$ should ...
0
votes
0answers
13 views

Anomalous diffusion dynamic exponent calculation

I'm trying to calculate this $\alpha$ (dynamic exponent, I think) from an equation from this wikipedia article. The equation (anomalous diffusion power law): $r^2 \propto t^\alpha$ The problem is ...
1
vote
0answers
9 views

anomaly detection algorithm problem

I've been trying to determine how to detect point-anomalies given window-anomalies. In more detail, I know for each 30-day window whether it contains an anomaly. For example, window 1 starts at ...
2
votes
1answer
35 views

Proving optimality of simple greedy algorithm

Professor Xavier (yeah, the one from X-Men) wants to drive from Reno to Newark. His gas tank, when full, holds enough gas to drive $n$ kilometers. The professor has a map showing the gas stations ...