I with some algorithms problems

  • Thread starter Jedi2master
  • Start date
  • Tags
    Algorithms
In summary, the conversation discusses various relationships between functions, including big-oh, big omega, and big theta. It also includes a second problem involving a positive real number c and the function g(n). The summary also includes the solutions to each part of the first problem and the three possible outcomes for g(n) in the second problem based on the value of c.
  • #1
Jedi2master
1
0
I'm having problems solving this assignment. I don't understand how to solve for big-oh, big omega or big theta.

0.1. In each of the following situations, indicate whether f = O(g), or f = Ω(g), or both (in which case f = Θ(g)).

f(n)---------------------g(n)
(a) n - 100------------ n - 200
(b) n^1/2 --------------n^2/3
(c) 100n + log n--------n + (log n)2
(d) n log n-------------10n log 10n
(e) log 2n-------------- log 3n
(f) 10 log n------------- log(n2)
(g) n^1.01-------------- n log^2 n
(h) n^2/log n-----------n(log n)^2
(i) n^0.1----------------(log n)^10
(j) (log n)^log n--------- n/log n
(k) sq root of n----------(log n)^3
(l) n^1/2 ---------------5^log2 n
(m) n2^n-------------------3^n
(n) 2^n------------------ 2^n+1
(o) n!----------------------2^n
(p) (log n)^log n------- 2^(log2 n)^20.2. Show that, if c is a positive real number, then g(n) = 1 + c + c2 + . . . + c^n is:
(a) Θ(1) if c < 1.
(b) Θ(n) if c = 1.
(c) Θ(c^n) if c > 1.
The dashes in the first problem are only meant to separate the two columns for visibility.
What I know is this. f = O(g) means f <= g. f = Ω(g) means g = O(f). f = Θ(g) means f = O(g) and f = Ω(g). I'm a little confused right now, I'd appreciate some help.
 
Last edited:
Physics news on Phys.org
  • #2
(a) f = O(g)(b) f = Ω(g)(c) f = Θ(g)(d) f = Θ(g)(e) f = Θ(g)(f) f = Ω(g) (g) f = Θ(g) (h) f = Θ(g)(i) f = Ω(g)(j) f = Ω(g) (k) f = Ω(g) (l) f = Ω(g) (m) f = Ω(g) (n) f = Ω(g) (o) f = Ω(g) (p) f = Ω(g) (a) g(n) = Θ(1) if c < 1.(b) g(n) = Θ(n) if c = 1.(c) g(n) = Θ(c^n) if c > 1.
 

FAQ: I with some algorithms problems

1. What is an algorithm?

An algorithm is a set of step-by-step instructions or rules that are followed to solve a problem or complete a task. It is a fundamental concept in computer science and is used in many different fields.

2. How are algorithms used in science?

Algorithms are used in science to analyze data, make predictions, and solve complex problems. They are used in a wide range of fields such as biology, physics, and chemistry to help scientists understand and interpret data.

3. What are some common types of algorithms?

Some common types of algorithms include sorting algorithms, search algorithms, and mathematical algorithms. Sorting algorithms are used to put data in a specific order, search algorithms are used to find specific data, and mathematical algorithms are used to solve equations and perform calculations.

4. How do scientists create algorithms?

Scientists create algorithms by breaking down a problem into smaller, more manageable steps. They then use logic and mathematical principles to develop a set of instructions that can be followed to solve the problem. The algorithm is then tested and refined to ensure it produces accurate results.

5. What is the importance of algorithms in scientific research?

Algorithms are crucial in scientific research as they help scientists analyze and interpret large amounts of data, make predictions, and solve complex problems. They also allow for more efficient and accurate results, saving time and resources in the research process.

Similar threads

Back
Top