Skip to main content

Questions tagged [analysis-of-algorithms]

Questions concerning estimations of the amount of time and space used by an algorithm. Approximate recurrence relations are considered. For exact recurrences use [tag:recurrence-relations] or [tag:functional-equations].

0 votes
1 answer
49 views

Goal Prove that $f(n) = a_pn^p + a_{p-1}n^{p-1} + ... + a_1n + a_0$ is $\Theta(n^p)$ Issue I am having trouble proving $f(n)$ is $\Omega(n^p)$. I know I need a $c_0$ and $k$ such that $f(n) \ge c_0n^p$...
Kungfunk's user avatar
0 votes
0 answers
136 views

I know that this has been posted at least once, but the accepted solution doesn't use the substitution method laid out in Introduction to Algorithms by Thomas Cormen. What I've tried so far is this: $...
jojusuar's user avatar
4 votes
1 answer
146 views

Lets take the function $f(x) = x + (x^2-x)\frac{1+\sin{7x}}{2}$. This function oscillates between $x$ and $x^2$. So it is $O(x^2)$ and $\Omega(x)$ and these are the tightest upper and lower bounds. ...
Leon Kim's user avatar
  • 704
0 votes
0 answers
37 views

Assume every function is eventually nonnegative. In other words, we are interested in growth rates for measuring time complexity and such. $f = O(g)$ is equivalent to $\limsup \frac{f}{g} < \infty$,...
Leon Kim's user avatar
  • 704
2 votes
1 answer
114 views

Robert C. Martin in his book "Clean Code" presents an algorithm for finding prime numbers present in Knuth's book. After some cleanup the algorithm looks like the following (in C#): ...
Spook's user avatar
  • 1,008
1 vote
1 answer
121 views

How to solve a recurrence relation of this form? $$ a_n = \sum_{i=0}^{n-1} a_{i}a_{n-1-i}(1-\frac{i}{n}), a_0=1 $$ Other information: Because of the symmetric structure inside the summation, it can ...
Jerry Xie's user avatar
1 vote
1 answer
124 views

I'm working on the following problem: You have a multiset of $3N$ nonnegative real numbers $S$. You must partition this set into $N$ triples. The goal is to maximize the sum of the products of each ...
zjxs's user avatar
  • 35
0 votes
0 answers
32 views

I'm working on a problem where I need to store $n$ files of sizes $f_1, f_2, \ldots, f_n$ on a hard disk. The disk is divided into segments, each of size ( K ). The problem has the following ...
user20194358's user avatar
-1 votes
1 answer
95 views

My teacher showed us this recurrence for merge sort, and solved it using guess and check. I don't understand the steps he is taking to simplify and factor the equation. T(n) = 2T(n/2) + n we guess ...
Barry Allen's user avatar
-1 votes
1 answer
131 views

I know that, $$a+b=\Theta(\max\{a, b\}).$$ I need to understand the dominating term in this expression, $$\mathcal{O}(m^{\frac{2}{3}}n^{\frac{2}{3}}+m+n).$$ We know that,$$m^{\frac{2}{3}}n^{\frac{2}{...
user avatar
1 vote
1 answer
82 views

I'm currently studying several classic graph algorithms for shortest paths (Dijkstra, Bellman-Ford, etc.) and came to the following problem: Problem We have $G:=(V,E,\omega)$, a weighted, connected, ...
Michel H's user avatar
  • 392
1 vote
0 answers
66 views

From Rosen's Discrete Math textbook, I feel the part of the proof where they say $$\log_b n = \frac{\log_2 n}{\log_2 b} < \frac{n}{\log_2 b}$$ where $b$ is any positive number not equal to $2$ is ...
Bob Marley's user avatar
0 votes
1 answer
87 views

I know that the question of a closed form for the number of partitions of $n$, often written $p(n)$, is an open one (perhaps answered by the paper referred to in this question's answer, although I'm ...
julianiacoponi's user avatar
0 votes
2 answers
96 views

$\text{Consider the following algorithm:}$ ...
Hussain-Alqatari's user avatar
0 votes
0 answers
40 views

I want to calculate $\sqrt{a}, a \in \mathbb{R^+}$ with the following algorithm: $y_n = \frac{a}{x_n}$, $x_{n+1} = \frac{y_n+x_n}{2}, n=0,1,\dots,$, with a start value $x_0 \geq \sqrt{a}$. Now there ...
J3ck_Budl7y's user avatar

15 30 50 per page
1
2 3 4 5
11