Algorithm Analysis - Growth of Functions

Click For Summary
SUMMARY

The discussion focuses on algorithm analysis, specifically the growth of functions in relation to two questions posed. In Question 1, the user identifies issues with variable increments, noting that the expressions j = j * 2 and i = i++ lead to infinite loops due to improper incrementing. For Question 2, the user evaluates the relationship between functions f and g, concluding that if f is O(g), then g is necessarily Ω(f), although they express uncertainty about the proof required.

PREREQUISITES
  • Understanding of algorithm complexity notation (Big O, Big Omega)
  • Familiarity with variable increment operations in programming
  • Basic knowledge of function growth rates
  • Experience with mathematical proofs in computer science
NEXT STEPS
  • Study the principles of Big O and Big Omega notation in algorithm analysis
  • Learn about variable increment techniques and their implications in loops
  • Research mathematical proof techniques relevant to algorithm complexity
  • Explore common pitfalls in algorithm design that lead to infinite loops
USEFUL FOR

Students and professionals in computer science, particularly those studying algorithms, software developers analyzing code efficiency, and educators teaching algorithm complexity concepts.

emeraldskye177
Messages
26
Reaction score
0
The problem statements, all variables and given/known data:

Question 1

upload_2017-3-22_3-1-31.png


Question 2
upload_2017-3-22_3-2-57.png


Relevant equations:
Provided in question snips.

The attempt at a solution:


Question 1: I think qux is the answer because it properly increments k by 1 in each iteration. j = j * 2 means j is always 0 so its loop never exits, and i = i++ doesn't actually increment i (as far as I know it should be i = ++i or just ++i or just i++) so i is always 0 and its loop never exits. But I'm not sure if this is the kind of answer they're looking for...

Question 2: I think (a) is no because, though c1 * g > f, the actual un-vertically-translated g could be less than f? Meaning its lower bound c2 * h < f, meaning h < f since c2 > 0. Am I correct on this?

(b) I think the answer is yes. Am I correct in saying, if f is O(g), then g is necessarily Ω(f)? But I'm not sure how to prove it as requested in the question...
 
Physics news on Phys.org
bump..
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K