Mathematical questions about Algorithms, including the Analysis of Algorithms, Combinatorial Algorithms, proofs of correctness, invariants, and semantic analyses

learn more… | top users | synonyms (1)

1
vote
1answer
21 views

can dijkstra's algorithm be applied as it is for undirected graph

I am wondering why can't Dijkstra's algorithm be applied as it is for undirected graphs. I mean instead of adding 2 directed edges to make it equivalent to a directed graph , why wouldn't it work if ...
0
votes
1answer
28 views

Subtraction game between alice and bob

Alice and Bob decide to play a number game. Both play alternately, Alice playing the first move. In each of their moves, they can subtract a maximum of k and a minimun of 1 from n ( ie.each of them ...
0
votes
1answer
22 views

Algorithms to increase or decrease the contrast of an image

While tinkering with image editing, I thought I might implement a contrast algorithm; something that would take a range of values and, based on the value that the user provides (from 0 to 255; the ...
0
votes
0answers
27 views

What would be the way to learn algorithms?

I want to know the mathematical theory associated algorithms. Story with a base of calculation, analytical geometry and linear algebra. What would be the previous topics to begin the study of ...
0
votes
2answers
38 views

Solving a recurrence relation with square root

I ran into a bad recurrence relation. Anyone would calculate T(n) or add some hint? $$T(n) = \begin{cases} n,\quad &\text{ if n=1 or n=0 }\\ \sqrt{1/2[T^2(n-1)+T^2(n-2)]+}n ,\quad ...
0
votes
1answer
34 views

Height of Recursion Tree for $T(n, k) = T(n/2, k) + T(n, k/4) + kn$

If we use a recursion tree for solving $$\begin{cases} T(*,1)=T(1,*)=a \\ T(n,k)=T(n/2,k)+T(n,k/4)+kn \end{cases}$$ What is the height of the recursion tree? Any idea or solution highly ...
1
vote
0answers
13 views

Math Algorithm Help Needed with Aggregated Percentages (Business Metaphor)

I'm trying to figure out a math algorithm, but I'm having a hard time wrapping my head around the best way. Instead of defining a complex industry-specific process, I'll use a crazy metaphor here ...
-2
votes
0answers
10 views

Exchanging numerical data to percentages

I have a large amount of data that are all positive numbers that i am plotting, however, as apposed to using numbers, which lack relative significance, I was looking to find an algorithm that would ...
0
votes
1answer
17 views

Approximate non-Lipschitz (but continuous) functions by Lipschitz functions

Is there any algorithm to approximate non-Lipschitz (but continuous) functions by Lipschitz functions ?
4
votes
0answers
39 views

Intuition behind accelerated first-order methods

$\newcommand{\prox}{\operatorname{prox}}$ $\newcommand{\argmin}{\operatorname{argmin}}$ Suppose that we want to solve the following convex optimization problem: $\min_{x \in \mathbb{R}^n} g(x) + ...
3
votes
1answer
63 views

Find maximum height of smallest flower

Little beaver planted n flowers in a row on his windowsill and started waiting for them to grow. However, after some time the beaver noticed that the flowers stopped growing.So he decided to come up ...
0
votes
0answers
38 views

Find solutions to given equation

Find all integer solutions $x$ for $0 < x < 10^9$ of the equation: $$x=b\cdot s(x)^a+c,$$ where $a$, $b$, $c$ are some predetermined constant values and function $s(x)$ determines the sum of ...
1
vote
1answer
101 views

How to search between $n$ candidates from unknown position?

It might be involved more with search algorithm but I cannot think of any of them. Here is the problem: You are in a corridor that stretches infinitely in both directions. Your room is somewhere ...
0
votes
0answers
29 views

finding quadilaterals from given sides

I have a set of Points. I triangulated the Points as delaunay triangles but i only have edges for the triangles means edge array of the whole set of Points. Now i need to find the traingles and ...
0
votes
1answer
26 views

How to check if a 2D mesh is connected

I'm trying to optimize structures by using FEM and genetic algorithms (GA), the FEM solver is a commercial one, and I'm programming the GA. Something like this. My first approach is simple, just ...
0
votes
1answer
26 views

Fast Fourier Transformation: inverse transform of the product of polynomials

I have managed to implement and understand most of the Fast Fourier Transformation. However, I have one last question. If one has two polynomials, say $A(x)$ and $B(x)$, and one computes DFT of ...
0
votes
0answers
8 views

KMP Algorithm-Longest prefix which is also a proper suffix

Im trying to learn KMP Algorithm, im watching this video on KMP algorithm http://youtu.be/SVKe7bvQ4Xk?t=5m4s There is a statement in the video for determining π[K].It says length of longest prefix of ...
0
votes
1answer
44 views

Algorithm for finding contradictions in a directed graph that represents implications

I need an algorithm that does this: For a directed graph where nodes represent boolean values and edges represent implication (implies TRUE and implies FALSE): If (arc exists between any ...
0
votes
1answer
58 views

Solving the recurrence relation $T(n)=4T\left(\frac{\sqrt{n}}{3}\right)+ \log^2n$

How we calculate the answer of following recurrence? $$T(n)=4T\left(\frac{\sqrt{n}}{3}\right)+ \log^2n.$$ Any nice solution would be highly appreciated. My solution is: $n=3^m \to ...
1
vote
2answers
46 views

Find if a number lies in this pattern

I have a sequence of numbers below... $1, 2, 4, 7, 11, 16 ...$ You get this list by starting at $1$ then add $1, 2, 3, 4, 5 ...$ Given a number $n$, how can I determine if it will show up in this ...
1
vote
1answer
38 views

Recurrence Relation - Merge Sort

We know the recurrence relation for normal merge sort. It is T(n) = 2T(n/2) + n. After solving it we can get T(n) = cnlogn. I ...
0
votes
0answers
20 views

Multi-armed bandit optimization

I've got a variation of multi-armed bandit problem, where I need not to minimize the regret, but to find a bandit with a maximum reward. Could you please tell how this problem is called or suggest ...
1
vote
0answers
20 views

Computing rotating pairs

I'm trying to develop an algorithm that my software development team can use to pair off for daily stand-up calls. Each dev should be paired with every other dev before there is a repeat. In other ...
1
vote
0answers
76 views

Comment on this Pi Formula? [on hold]

I compute Pi in my own way as follows: $$\frac{\pi}{2}=1+\frac{1}{1+\frac{1}{\frac{1}{2}+\frac{1}{\frac{1}{3}+\frac{1}{\frac{1}{4}+\frac{1}{\vdots}}}}}$$ and use ...
1
vote
2answers
46 views

Solve $T(n) = T(n-1)+\log^2(n)$

I was trying to solve $T(n) = T(n-1)+\log^2(n)$ using substitution method and variables substitution but I can't find the correct answer. My attempt: Let $m = \log(n)$ then $T(2^m) = ...
1
vote
1answer
46 views

Residue class of a huge repunit modulus a huge number

Given a number with only 1: X = 1111...1 (N times 1 in total), and another number M, I want ...
1
vote
1answer
38 views

Arrange blocks to form matrix of $N \times 3$

Given are the blocks of 3 different colors (Red,Green and Blue). Red colored block of size $1 \times 3.$ Green colored block of size $1 \times 2.$ Blue colored block of size $1 \times 1.$ ...
0
votes
1answer
60 views

Count numbers with prime digit

Given a number N I need to find the count of the numbers that have atleast one prime digit (2,3,5 or 7) in it. Now N can be upto 10^18.What is the best approach to solve this problem. Example : Let ...
0
votes
2answers
49 views

Solving polynomial to get all coefficients

Given an array of N integers where N can go upto 10^4 and each element can be upto 10^5. Now i need to find the coefficients of polynomial p that is given as : ...
1
vote
1answer
50 views

Find if arrangement is possible or not

The company has k buses and has a contract with a school which has n students. The school planned to take the students to d different places for d days (each day in one place). Each day the company ...
1
vote
2answers
102 views

What algorithm do i need to solve my problem?

unfortunately I even don't know what kind of problem I deal with. But I'll try to explain as good as I can and maybe you can tell what kind of problem this is and how to solve it. I want to find ...
1
vote
1answer
22 views

How to get a function similar to the ELO ranking system

I'm not an expert in maths. I'm looking a function similar to the ELO system in order to give the users a score. Those are the requirements for the system: The score must be between -100 and 100 ...
0
votes
2answers
93 views

Modulus of large powers

Given an array of N integers where $2 ≤ N ≤ 2×10^5$ and each element in array is less than $10^{16}$. Now I am given a variable $X$ that can also go up to $10^{16}$. We need to find if $X \mid ...
-1
votes
0answers
57 views

Who one have all the 275305224 MagicSquares of order 5? [closed]

Is there any way that make us able to access to all solutions of order 5 magic square ? For research and statistical analyze purposes ! There are two main problem on this subject too 1th the ...
2
votes
0answers
64 views

Finding optimal velocity profile using Dynamic Programming

This question has been asked on scicomp but I thought maybe it's more a mathematical problem of how Bellman's idea is to be applied here. The main problem for me is: How to introduce the time ...
-2
votes
1answer
258 views

Modulo of a large sequence of $1$s

Given two numbers $N$ and $M$, we need to find the remainder when $111 \cdots1$ ($N$ times) is divided by $M$. Here $N$ can go up to $10^{16}$ and $M$ up to $10^9$. How to solve this problem? ...
2
votes
1answer
19 views

Non probabilistic algorithm for min-cut problem?

I know about Karger's algorithm and its variations, all of them being probabilistic. Is there non-trivial (i.e. non-brutefoce) deterministic algorithm for mincut problem?
0
votes
2answers
27 views

Get neighbors for N dimensional square

I need some algorithm to get neighbours of x vertex of N dimensional square. Thanks in advance.
1
vote
0answers
59 views

Integer partitions without rotated solutions?

I'm searching for an algorithm to determine a list of all integer partitions of a number $n$ into a fixed number $m$ of summands (say $n=6$ and $m=4$), for instance to be stored into a list of ...
2
votes
0answers
33 views

Speed dating/networking challenge

I am trying to organise an event with 54 participants. I want them to participate in 9 different activities at stations around a hall. Obviously this will require 9 sessions to allow the participants ...
1
vote
4answers
57 views

How to prove correctness of this algorithm

Situation There is a long patch of grass with seeds planted along it. Each seed needs to be within 2 metres of a sprinkler in order to be watered daily. Describe an algorithm that will result in ...
0
votes
3answers
79 views

Is this approach for testing orthogonality/parallelity of vectors wrong as I think?

In a math book four methods are written for testing parallelity/orthogonality of two vectors that are(notice $\vec v$ and $\vec w$ are approximations of vectors and we have x,y and z components of ...
4
votes
1answer
36 views

How do I detect anomalies in a real-time data

I'm trying to find a few good algorithms which could solve the problem of finding anomalies in my data. One of the main problems is that I need to find it in the real time data. So I came out with ...
1
vote
0answers
34 views

Alternating Direction Method of Multipliers (ADMM) application

$\newcommand{\argmin}{\operatorname{argmin}}$ Recall, that ADMM algorithm solves the problem of the form: $\min \text{ } f(X) + g(Z)$ $\text{s.t. } AX + BZ = C$ where $X$, $Z$ and $C$ are real ...
0
votes
1answer
30 views

Evolutionary algorithm

Can someone provide me a good reference for the CMA-ES algorithm? I'm new in the world of optimization and just reading the author reference doesn't help me a lot. I know the basic idea of a genetic ...
2
votes
2answers
146 views

For recurrence T(n) = T(n − a) + T(a) + n, prove that T(n) = O(n^2 ) complexity

I have been looking over this question for hours now, and can't seem to work it out. It's a question regarding the complexity of sorting algorithms Assume that $a$ is constant and so is $T(n)$ for $n ...
1
vote
0answers
47 views

Fast checking Matrix multiplication in mod 10

I recently faced this problem in a programming contest: Given 3 square matrices N x N of size N up to 1000. All elements in 3 matrices are from 0 to 9. Check if matrix A x B equals to C, mod 10. In ...
1
vote
1answer
18 views

Proving partial greedy property for minimal knight's path between two squares on unbounded chess board

I was thinking about how to write a computer program to find the path with minimal number of moves that takes a knight from one square $(x_1,y_1)$ to another square $(x_2,y_2)$ on an unbounded chess ...
0
votes
2answers
32 views

Finding the position at n?

This dance asks every performer to follow a precise sequence of steps: • Stage 0 : First, get away from obstacles by setting up your starting point at position 0 • Stage 1 : Take one step forward ...
4
votes
5answers
90 views

How to solve the recurrence relation $T(n) = T(\lceil n/2\rceil) + T(\lfloor n/2\rfloor) + 2$

I'm trying to solve a recurrence relation for the exact function (I need the exact number of comparisons for some algorithm). This is what i need to solve: $$\begin{aligned} T(1) &= 0 \\ T(2) ...