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
8 views

Understanding linear separability

Having read the wikipedia article and a similar question on the topic of linear separability, I still lack the understanding of this concept to explain any more than the most rudimentary euclidian ...
2
votes
1answer
83 views

How to find all systems of distinct representatives using i.e. Hopcroft–Karp algorithm?

I would like to find all systems of distinct representatives in bipartite graph. I've found Hopcroft–Karp algorithm, which finds maximal matching, which I would like to implement. But I don't know how ...
0
votes
2answers
63 views

Some diffuculties trying to compute double sums

I have the following sum $$\sum_{i = 0}^{n-2}\sum_{j=i}^{n}(i + j) + \sum_{i = 0}^{n-2}\sum_{j=i}^{n}1$$? and i have no idea how to continue from here?
0
votes
0answers
28 views

How to find this unknown variable?

Known variables: Price = 52.89 Sales = 14121.63 Unit_Orders = Sales / Price = 267 max_orders = 31734 (600 units) max_units = 600 missing_orders = max_orders - Sales = 17612.37 = (Max_units - ...
0
votes
1answer
31 views

Minimum number of steps required to visit every “special” point on a rectangular gird

I am stucked at this problem: Suppose we have the following grid configuration (or matrix) $G\in \Bbb{M}^{\{0,x,y\}}_{m\times n}$ (I.e $G$ is a matrix that have $m$ rows and $n$ colums over the ...
3
votes
3answers
38 views

Algorithm/formula for computing the probability of winning a range of games

As of this post, the Golden State Warriors have 68 wins and need to win at least 5 of their remaining 7 games to break the record for most wins in a season. This article estimates the Warriors' chance ...
0
votes
0answers
19 views

Uniqueness of spanning trees made using search algorithms?

For undirected graphs, the corresponding spanning trees can be obtained using various search algorithms like Depth-first search algorithm , Bredth-first algorithm, etc. I am not sure whether the ...
0
votes
0answers
20 views

Complexity of a randomly-traveled N*M grid

I made an algorithm that compute a random-path across a N*M grid using backtracking. It start at [N / 2][0] and shall finish at [N / 2][M - 1]. Each iteration he choose a random direction (Left, ...
2
votes
2answers
96 views

Is there a way to mathematically prove my teaching assistant is wrong?

Our design of algorithms class requires all students to enroll in an online $AI$ competition, where each team has to come up with a bot. Before the final lockdown, each team is allowed to challenge ...
5
votes
1answer
103 views

Amount of zero in a range

I'm stuck with a calculation. If a person would write down, Everytime he sees a zero and counts +1. 10 counts as 1 zero. 100 counts as 2 zeros. 1000 has 3 zeros. 1005 counts as 2 zeros. Is there ...
2
votes
1answer
42 views

Proofs Involving an Algorithm

Okay. I've been trying to work on a math proof and then I fell asleep. I feel as if it should be obvious but I'm not getting it at all. The following is the info: $$\frac{A}{B} = \frac{1}{n_{1}} + ...
0
votes
0answers
23 views

Pattern matching algorithm

Given a text $t[1 . . . n, 1 . . . n]$ and $p[1 . . . m, 1 . . . m], n = 2m,$ from alphabet $[0, Σ−1]$, we say $p$ matches $t$ at $[i, j]$ if $t[i + k − 1, j + l − 1] = p[k, l]$ for all $k, l$. ...
1
vote
0answers
13 views

Potential Function Runtime

The potential function of a Fibonacci Heap is Φ(H) = t(H) + 2m(H) CLRS states in Figure 21.2 ...
-1
votes
1answer
35 views

A task about Bipartite Graph [closed]

You are given a number N. Your task is to find the number of Bipartite graphs on N vertices. It is possible that the number can be calculated using recurrent formula. The algorithm should be O(N^3) ...
0
votes
1answer
38 views

Automatic differentiation-Reverse mode

I am trying to understand very basics material and a bit confused about steps. If we have function $z=f(x_1,x_1)=x_1x_2+sinx_1=w_1w_2+sinw_1=w_1+w_4=w_5$ we need fix the dependent variable to be ...
2
votes
2answers
38 views

How many arithematic operations(flops) are to $n×(n+1)$ matrix of system?

Source: Linear Algebra and Its Applications David C. Lay A system of n equations in n unknows correspond to $n×(n+1)$ augmented matrix. One book says the reduction(elimination) to echelon form ...
1
vote
1answer
28 views

Generate all N-bit numbers in such an order that the number of 1s increases monotonically

For a given positive integer $N$, is there an efficient algorithm to generate all $N$-bit numbers in such an order that the number of 1s in the binary representation increases monotonically?
0
votes
0answers
119 views

Binary counting problems

Recall that counting from 1 to n in binary takes $\Theta$(n) steps; i.e., the increment operation has constant amortized cost as opposed to $\Theta$(logn) in the worst-case. a) Analyze the amortized ...
0
votes
0answers
46 views

Good books on Algorithms for a math major without any programming experience?

I couldn't find this question anywhere else so it may not be apt. I am an undergraduate mathematics major and during my discrete math class I really enjoyed the study of algorithms and recursive ...
4
votes
3answers
60 views

Minimum number of steps required to visit every corner of a rectangular grid

I am stucked at this problem: Suppose we have the following grid configuration (or matrix) $G\in \Bbb{M}^{\{0,x,y\}}_{m\times n}$ (I.e $G$ is a matrix that have $m$ rows and $n$ colums over the ...
0
votes
1answer
17 views

Branching/layered optimisation - how?

Imagine you had a collection of systems each with their own constraints and objective functions to optimise (likely similar in form to each other), these then collectively aggregated into a ...
3
votes
0answers
33 views

Is math recursive or iterative?

Is the process of solving a mathematical problem (algebraic equations, limits, derivatives, integrals, EDOs, trigonometric identities proof) recursive or iterative? For example, for solving $x=1+2+3$ ...
1
vote
0answers
44 views

Is there any online Huffman code/decoder?

I need to see and work with Huffman code and see how does it compress data. Anyone has any link of online Huffman coder and decoder (compressor)?
0
votes
0answers
15 views

Exact line Search in Steepest descent

I wanted to clarify the idea of the exact line search in steepest descent method. An exact line search involves starting with a relatively large step size ($\alpha$) for movement along the search ...
0
votes
0answers
34 views

Is there any two way algorithm for compressing numbers?

I have this question that is there any way we can convert a number to another number with less character in the new number? For example, Imagine we have 811008 and if we divide this 13 times by 2, we ...
3
votes
2answers
25 views

Minimal Subset that sums up to

Let $X \subsetneq \mathbb{N}$ be a finite set, and $c \in \mathbb{N}$ we are looking for a subset $$ Y \subseteq X $$ such that $\sum_{y \in Y} y \geq c$. Assuming a subset that satisfies the ...
0
votes
0answers
13 views

3SUM problem solution on the basis of cubic function and a line?

The 3SUM problem formulation: in a given set of n real numbers find 3 elements that sum to specified value S. I am trying to understand mathematical solution of the 3SUM problem based on a polynomial ...
1
vote
1answer
23 views

Time Complexity of DFS

My understanding is that: 1) given a graph G with n vertices and m edges, DFS is O(n + m) 2) DFS can be used to produce a list of all simple paths between 2 vertices u and v This would mean that ...
0
votes
0answers
11 views

Does ray tracing have any speed ups in algorithm running time in the frequency domain?

Could ray tracing be Fourier-transformed so that all calculations are done in the frequency domain? I think ray-tracing a set of rays $S$ from the eye into the view frustum might be more efficient ...
3
votes
1answer
28 views

Re-Balancing Bins with Capacity Limit Problem

Let $\hat n = \{1, \dots, n\}$. Assume that we have a sequence of bins $$ B_1, B_2 ..., B_n $$ which all have the same capacity limit $c \in \mathbb{Q}$. Now, there is a finite set of items $I ...
2
votes
1answer
55 views

A smart algorithm to decide whether a simple graph is 2-regular

Given a simple graph $(V,E)$, is there a smart algorithm to decide if the graph is 2-regular? Is it really necessary to check that all nodes in the graph appears exactly twice? I have implemented ...
3
votes
5answers
79 views

Tricky Nested Summation

I am trying to analyze a programming algorithm that has three nested loops. The algorithm looks like this: $$\sum_{i=0}^{n} \sum_{j=i}^{n}\sum_{k=i}^{j} 1$$. I am trying to simplify it. These are the ...
1
vote
1answer
49 views

Subsequence occurring exactly twice in pattern

Given a string $S$, consisting of letters from the set $\{0, 1\}$. We need to find a string $T$ that appears in $S$ as a subsequence exactly twice. How to tackle this problem, without enumerating all ...
10
votes
3answers
206 views

What is the most efficient algorithm for factorisation when an approximate value of one factor is known

If I am given the following number: 1522605027922533360535618378132637429718068114961380688657908494580122963258952897654000350 692006139 And am told that one of ...
2
votes
1answer
57 views

From currency conversions to graph modeling

The problem I am trying to solve the following programming problem (in C++). I have tried to solve it thoughtlessly just typing code and observing what happens, but, as expected, I have reached ...
0
votes
0answers
14 views

Why does knuth mastermind algorithm favour guesses in S?

From wikipedia : Mastermind > algorithms: From the set of guesses with the maximum score select one as the next guess, choosing a member of S whenever possible. I understand that the hidden ...
1
vote
1answer
24 views

How to prove $2^{\sqrt{f(n)}} \in O\ (2^{f(n)})$ if $f:\Bbb{N}\rightarrow \Bbb{R^+}$?

How to prove $2^{\sqrt{f(n)}} \in O\ (2^{f(n)})$ if $f:\Bbb{N}\rightarrow \Bbb{R^+}$? So we want to prove $\exists c\in\Bbb{R^+}:\ [\exists B\in\Bbb{N}:[\ \forall n\in\Bbb{N}:\ n\ge B\rightarrow ...
0
votes
0answers
6 views

Non-monotone Submodular Maximization with Cardinality Constraints

Does any approximation algorithm exist for maximization non-monotone submodular functions that might have negative values or unbounded below? Fact 1: For monotone submodular functions, Nemhauser, ...
0
votes
0answers
16 views

Contour and perimeter recognition in binary image

I need to detect contour (object) and find the perimeter of a detected object. For example, I have the following image: http://i.stack.imgur.com/40TTX.png All images are binary, so they consist of ...
0
votes
2answers
34 views

How to prove $\frac15 n^2-42n-8\in Ω(n^2)$?

Here is my procedure: So we want to prove $\exists c\in\Bbb{R^+}:\ [\exists B\in\Bbb{N}:[\ \forall n\in\Bbb{N}:\ n\ge B\rightarrow \frac15 n^2-42n-8\ge cn^2]]$ Taking $B=1$. We have $\frac15 ...
0
votes
1answer
26 views

Replacing inequality with equality.

Rate of Convergence: Definition Let $\{x_n\}_{n\ge 0}$ is a sequence that converges to a number $x*$. Suppose that $\{a_n\}_{n\ge 0}$ is another sequence known to converge to $0$. We say ...
0
votes
1answer
23 views

Bipartite graph G(U,V,E) with directed edges from U to V only

I wonder if in the graph theory community or in any other subfield there is a name for a bipartite graph $G(U,V,E)$ with the property of having all edges $(i,j)\in E$ such that $i\in U$ and $j\in V$. ...
1
vote
1answer
31 views

A DE shaw interview question on calculating previous k-average

Given a number flow $a_1, a_2, ... a_N$, $N$ is a large number for example $N = 1000$, the goal is to calculate the average value of previous $n$. For example, now we are at state $k$, then if $n = ...
1
vote
0answers
32 views

Can Levenberg-Marquardt be used to find a local minimum of a function?

I've already implement an algorithm using Gradient Descent (GD) for converging to a local minimum of a function. For example the function is (using MATLAB - a=3 b=3 at this example): ...
0
votes
1answer
15 views

lower bound for an integer inequality in randomized 3SAT proof

I'm having trouble seeing why an inequality holds in a section of a proof for solving MAX-3SAT by a randomized algorithm. So given non-negative integer $k$, we define non negative integer $k'$ to be ...
1
vote
1answer
39 views

Measuring Sets Intersection

I need a fitness function saying how well Interval B fits inside Interval A. Both intervals are ordered continuous numbers going from Interval_Start to Interval_End, for example [1..100] or [1..55]. ...
0
votes
0answers
18 views

What is the difference between these two coin changing problems? (Greedy and Dynamic Programming way)

I have been reading about Dynamic Programming, and I found out about the change making problem. When there is a given set of coins with different denominations but unlimited amount of each and we want ...
2
votes
1answer
52 views

How can I get better at algorithmic thinking?

I have been practising for a an upcoming algorithmic thinking competition but have always found that when doing the past papers, I have never had enough time left to finish. I can do basically all of ...
0
votes
1answer
41 views

Problem with summations for sorting algorithm?

According to this lecture http://web.stanford.edu/class/archive/cs/cs161/cs161.1138/lectures/10/Small10.pdf, slide 26, the expected number of comparisons done by quicksort is smaller or equal to ...
0
votes
0answers
22 views

Parallel finding maximum matching in bipartite graph

I try to research the following theme - finding maximum matching in bipartite graph. Now I researched some algorithms for finding maximum matching in bipartite graph, but all of algorithms which I ...