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
1answer
9 views

Find the asymptotic solution $\Theta$ of the recurrence using the master theorem

I just took a quiz for an algorithms class that I didn't do so well on. It was on the master theorem. Unfortunately the professor refuses to supply answers or even tell me what I got wrong, so I was ...
1
vote
1answer
14 views

Reduction to a max flow problem from a sudoku like puzzle

Given an $n$ by $n$ grid of which some of the squares are black and some are white. I'm allowed to mark some of these squares and the question is to prove whether a given grid with given black squares ...
0
votes
0answers
6 views

Square root of Bezier curve via deconvolution

I calculate the product of two Bezier curves via convolution as described in Sanchez-Reyes 2003. I would also like to calculate the square root of a Bezier curve (I have not seen this published ...
0
votes
0answers
10 views

maximum frequencies of numbers in a matrix

I have a matrix A of size n*n.Consider a new matric M : M[i][j]=max of frequencies of numbers occuring in ith row and jth column(A[i][j]) counted once. I have a ...
6
votes
0answers
20 views

Decomposition of an algebraic number into a sum or product of algebraic numbers with smaller degree

An algebraic number can be identified by its minimal polynomial together with isolating intervals with rational bounds for its real and imaginary parts. The degree of an algebraic number is the degree ...
2
votes
1answer
26 views

Non-Piecewise interpolation over 3 points

I am trying to write an algorithm that interpolates between 3 values. The interpolation will be over the interval [0,1]. What I would like to do is: (Hopefully this makes sense) at x = 0, y = ...
0
votes
0answers
9 views

Derivation of SVM algorithm (Lagrangian)

I have a question about the derivation of the SVM algorithm (for example, page 3 here ). The question is about the math, so that's why I'm asking this here. Suppose I have the following optimization ...
0
votes
0answers
8 views

partitioning a set into subsets while considering preferences

i am looking for an algorithm to partition a set of P (p=~70) people into minimum G (G=~3) subsets/groups so that no group would have more than M (M=~30) maximum people/elements. Each person ...
0
votes
0answers
35 views

How to square a number that got more digits than search results “digits” on Google.

I am implementing the quadratic sieve algorithm. And I got run in unexpected problem. Take a look at those two final steps of the algorithm as described in wiki. Use linear algebra to find a ...
0
votes
0answers
17 views

Solve the recurrence $T(n) = 2T(n/2) + n/\log n$

Hi am trying to solve the recurrence $T(n) = 2T(n/2) + n/\log n$. It almost matches the master theorem except for the $n/\log n$ part?
0
votes
0answers
8 views

Matching of points in two discrete linear sequences with potentially missing points

This is a question that I've been thinking about in my research lately. I've gone down the route of a few linear-optimization techniques, but nothing particularly spectacular has come up. Anyway, ...
2
votes
1answer
52 views

Gaussian elimination algorithm performance

I am developing the quadratic sieve algorithm and I reached a new bottle neck: The matrix processing. I been reading quit a lot about this topic and I found many solutions Gaussian elimination: ...
1
vote
1answer
12 views

Algorithm for computing the inverse limit of a finite inverse system

Let $k$ be a field (finite if you'd like), let $(I,\le)$ be a finite directed poset with $|I|=n$, and let $(A_i,f_{ij})_{i\le j\in I}$ be an inverse system of finitely generated, graded, commutative ...
1
vote
0answers
16 views

Algorithm for computing an inverse image

Let $k$ be a field (finite if you'd like), and let $f:A\to B$ be a map of graded, commutative $k$-algebras. Suppose further that $A$ is finitely generated and choose a presentation ...
0
votes
1answer
27 views

Prove that $\sum_{i=0}^{k} \lg \frac{n}{2^i} = \Theta(\lg^2 n)$

Show that if $n$ is a power of $2$, say $n = 2^k$, then we have the equality $\sum_{i=0}^{k} \lg \frac{n}{2^i} = \Theta(\lg^2 n)$. The first step is to prove $O(\lg^2n)$: $$ \lg \frac{2^k}{2^0} + \lg ...
2
votes
1answer
38 views

solve $54 x + 16 y = 2400$ for integer values of x,y

How to get integer values for x and y that satisfy: $$54 x + 16 y = 2400$$ Someone told me that I can do it using Euclid-Wallis algorithm, but I don't understand it so, if there isn't any else ...
0
votes
2answers
18 views

Bubble sort complexity calculation, unsure how it went from one step to another.

I'm looking at my textbooks steps for calculating the complexity of bubble sort...and it jumps a step where I don't know what exactly they did. I see everything up to that point using summation ...
1
vote
1answer
35 views

Sum of two elements is $x$

I read the following problem in the book Introduction to Algorithms by Cormen, Leiserson, Rives, Stein and I couldn't make any progress with it. There is a set of $n$ numbers. Give an algorithm that ...
2
votes
1answer
29 views

Complexity of generating a prime larger than $N$

Is it provably difficult to generate a prime larger than a prescribed $N$? For instance, if I want a prime of $1000$ digits, is there a way to do that deterministically, i.e., without resorting to AKS ...
2
votes
5answers
35 views

Prove a function is in Big-Oh and not in Big-Omega

We are told to use the definitions of Big-Oh and Big-Omega to prove that a given function is in $O(f(n))$ or $\Omega(f(n))$. It requires being able to use $c$ and $n_0$. Use the definitions to show ...
1
vote
1answer
22 views

Need combinatorial formula

Let we have a forest $F_n(P)$ with $n$ nodes defined by set $P$ of all pairs $\{\text{father}, \text{son}\}$. For instance $P=\{\{1, 2\}, \{3, 4 \}, \{1, 3 \}\}$ defines a forest $F_5(P).$ Let ...
0
votes
0answers
37 views

Algorithm For Honest vs. Dishonest People

Consider a group of people. When two are taken and asked if the other is honest, they may each either reply that the other is honest, dishonest, or they may report that one is honest and the other is ...
0
votes
1answer
22 views

Solve logistic problem with graph - fitting boxes

Suppose you have $n$ boxes, each of which falls into one of the $k$ sizes, and you want to nest smaller ones into larger ones, such that no two boxes $A$ and $B$ are nested inside the same box, if ...
0
votes
0answers
13 views

The problem of finding a smallest spanning 2-edge-connected subgraph of a graph G is NP-hard

For a given graph G = (V, E) with weights c(e), e ∈ E, the problem of finding a smallest spanning 2-edge-connected subgraph means that one has to find a subset F ⊆ E of smallest weight c(F) ...
0
votes
0answers
16 views

Recursion $T(m) = c_0 m + \sum\limits_{i=0}^{k}T(\lceil c_i m \rceil)$,$\sum\limits_{i=1}^{k}c_i < 1$ is linear

Let $L: \mathbb N_0 \to \mathbb N_0$ satisfy the recursion $T(m) = c_0 m + \sum\limits_{i=0}^{k}T(\lceil c_i m \rceil)$ with $c_i \geq 0$ for $i=0,\ldots, k$ and $\sum\limits_{i=1}^{k}c_i < ...
0
votes
1answer
23 views

Proof of Mutually Inclusive Tree Properties

I don't know if that's the most accurate title. I'm trying to prove that one property of trees implies another without using any of the other properties. This is for homework. But I'm really just ...
0
votes
0answers
22 views

Master Theorem for common recurrence

I have the following recurrence: $$T(n) = T\bigg(\frac{n}{2}\bigg) + O(n)$$ And I am trying to find the time complexity using the master theorem. So I have: $a = 1, b = 2$ $f(n) = O(n) = c(n)$ ...
1
vote
1answer
24 views

How to show the running time of the following algorithm? [closed]

The outer loop runs n times. The inner loop runs Math.floor(n/i) times. So it would be O(n*Math.floor(n/i)). I do not know how to transform that into a proper expression involving Big Oh and n. Maybe ...
0
votes
1answer
31 views

Find the order of elimination in Josephus Problem

Josephus Problem (or Josephus permutation) is a theoretical problem related to a certain counting-out game. People are standing in a circle waiting to be executed. Counting begins at the first ...
-7
votes
0answers
22 views

How to write an algo [closed]

ecrire un algo qui calcule la moyenne de trois matiers d'un stagiaire(mat:a votre choix).et affecte une observation d'evaluation.
0
votes
0answers
14 views

Hamioltonian Circuit of Planar Graph of Order $2^n$

$G$ is a planar graph of order(= number of vertices) $2^n$. Questions: When $G$ has a Hamiltonian Circuit? Is there a polynomial or quasi polynomial time algorithm to decide whether $G$ has a ...
1
vote
1answer
43 views

Project allocation optimization with tricky constraint

I have an allocation problem that should be straightforward, except that it has very specific constraints. I want to assign approximately 300 students to 170 projects in pairs - so that each project ...
2
votes
2answers
30 views

Find $ k$ last digits of quotient

Suppose we have two integer numbers $a, b$ such that $b$ divides $a.$ Suppose that the number $a$ is very and very long and we cant to perform a division algorith. How to find last $k$ digits of ...
0
votes
1answer
42 views

Prove this greedy algorithm is optimal

So the question is: Consider the following different greedy algorithm for the Interval Scheduling algorithm: DifferentGreedySchedule - Initialize R to contain all intervals - While R is not empty - ...
1
vote
0answers
9 views

Determining next hash [closed]

Given a series of hashes, were one hash is determined from the previous hash. i.e seed 0 => seed 1 => seed 2 => seed 3 Is it possible to determine the next seed or even the hash function itself?
1
vote
0answers
17 views

Number of global min cuts in undirected graph

I'm looking at a proof of the following theorem "The number of global minimum cut is $\le \binom{n}{2}$". It says $\forall i$ from $1$ to $n-1$ Find min-cut seperating $\{1,2,\cdots,i\}$ from $i+1$. ...
0
votes
1answer
28 views

Geometric Meaning behind the algorithm (slope of the line + ray casting)

I'm trying to dissect the classic algorithm for finding if a point is inside a (simple) polygon. Please see: http://erich.realtimerendering.com/ptinpoly/ and ...
0
votes
1answer
41 views

algorithm to convert integer to 3 variables (rgb)

I try to store integer (real numbers) values into pixel data. The only way my api can store pixel data are RGB Colors. The idea behind it is, to store a large amount of vertices into the vram, rather ...
0
votes
1answer
15 views

How to divide a large rectangle into N smaller rectangles

I would like to divide a NxMpx rectangle(matrix) into X piece different size smaller rectangles. X is a variable so it dosn't have a fix value.The smaller rectangles must fill the 80-90% area of ...
0
votes
1answer
15 views

Algorithm to solve monetary obligation

i Need some help to find an algorithm for the following Problem. A Group of n persons lend each other some Money. A -> B, B -> C, C -> A, and so on. Now i want to find out how much Money each Person ...
0
votes
3answers
46 views

Evaluating Nested Summations

I'm trying to evaluate the following nested summation as a function of $n$: $$\sum_{i=1}^{n-1} \sum_{j=i+1}^n \sum_{k=1}^j 1$$ So far I have: $$\sum_{i=1}^{n-1}\sum_{j=i+1}^n i+1$$ ...
1
vote
1answer
43 views

Stable Matching Problem Worst Preference?

Suppose we have one hundred pairs of women and men, and there is a man M that is ranked the second highest on every woman's preference rankings. Would it be possible that he ends up with the woman he ...
13
votes
0answers
88 views

Is there an efficient algorithm for this vertex cycle cover problem? [migrated]

I've been trying to find an algorithm to find a maximum vertex cycle cover of a directed graph $G$ — that is, a set of disjoint cycles which contain all the vertices in $G$, with as many cycles as ...
1
vote
1answer
11 views

How exactly does a Max 2 Sat reduce to a 3 Sat?

Note: I've also asked this question on StackOverflow here I've been reading this article which tries and explains how the max 2 sat problem is essentially a 3-sat problem and is NP-hard. However, if ...
0
votes
0answers
27 views

Determining the minimal number of terms to use in a sum to approximate a number given a tolerance

In page 33-34 of Numerical Analysis by Burden & Faires an algorithm was given to compute the minimal value of $N$ for which $$|\ln{1.5}-P_N(1.5)|<10^{-5}\tag{1}$$,where ...
0
votes
1answer
23 views

ideal number gernerator

I was trying to solve a problem on Hackerearth. Here: https://www.hackerearth.com/problem/algorithm/ideal-random-number-generator/ I solved this partially:https://ideone.com/pXkHwQ (passed three ...
1
vote
1answer
47 views

How do you go about solving this recurrence?

How do you make an estimation for the substitution method, when the recursion tree did not help so much? I have a recurrence $$T(n) = 5\cdot T(n/3) + n (\log n)^2$$ And upon doing the recurrence ...
1
vote
1answer
83 views

Number of binary numbers given constraints on consecutive elements

I've been trying to solve this question for quite a while, given to us by our discrete maths professor. I've been having a hard time in general with it, so I thought I tried looking it up online but ...
0
votes
2answers
32 views

Newton's method for optimization

I have been reading about Newton's method and know that you can use it for optimization problems. However, does Newton's method only guarantee convergence to a local minimum or maximum, or can it be ...
0
votes
0answers
15 views

Weighted set cover variant- improvement over log(n)? [closed]

Suppose we are asked to produce a set cover of minimal weight, where here w(S)=size(S) (and the weight of the cover is the sum of the weights of its sets). It is well known that in general weighted ...