Understanding Polynomial Time Complexity

Click For Summary

Discussion Overview

The discussion revolves around the concepts of exponential and polynomial time complexity in algorithms. Participants seek to clarify the definitions and implications of these terms, particularly in the context of computer science and algorithm analysis.

Discussion Character

  • Conceptual clarification
  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant asks for clarification on what an exponential time algorithm means.
  • Another participant suggests that understanding the context of the question would be helpful, indicating it may not be a programming problem.
  • A participant states that exponential time refers to algorithms that take exponential time to complete, contrasting it with polynomial time algorithms.
  • It is noted that exponential time can be expressed as \Theta(a^n) for some constant a, while polynomial time can be expressed as \Theta(P(n)) for some polynomial P.
  • A participant provides an example of polynomial time using nested for loops, explaining that the running time can be expressed as n^2, illustrating the concept of polynomial time.

Areas of Agreement / Disagreement

Participants express varying levels of understanding regarding the definitions of exponential and polynomial time, with some providing examples and others seeking clarification. The discussion does not reach a consensus on the definitions, as participants are still exploring the concepts.

Contextual Notes

Some participants may have different levels of familiarity with algorithmic notation such as \Theta, O, or \Omega, which could affect their understanding of the discussion.

teng125
Messages
416
Reaction score
0
can sombody pls explain to me what does exponential time algorithm means??

thanx
 
Physics news on Phys.org
it is just some very basic computer question which is algorithm.It is not a programming problem.
It means an algorithm which take exponential time to complete and another type is it takes polynomial time to compete an algorithm.

Therefore,i do not understand what it means by exponential time and polynomial time
 
If an algorithm takes exponential time, that usually means that it can be done in
[tex]\Theta (a^n)[/tex] time for some constant a.
If an algorithm takes polynomial time, that usually means it can be done in
[tex]\Theta (P(n))[/tex] time for some polynomial P.
Are you familiar with [tex]\Theta[/tex], O, or [tex]\Omega[/tex] notation?
 
Just to show a quick example of polynomial time. Say you have two nested for loops,
for (i=1; i<n; i++) {
for (j=1; j<n; j++) {}
}

we can see that j goes to n as i = 1, then j goes to n as i = 2...you see a pattern? j goes to n, n times. Thus our running running time is
n * n ...which also happens to be n^2...this is what is meant by polynomial time..a run time that can be expressed in polynomial form..[tex]a_nx^n + a_{n-1}x^{n-1} + \cdots + a_0[/tex]
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
1
Views
1K
  • · Replies 16 ·
Replies
16
Views
5K
  • · Replies 17 ·
Replies
17
Views
5K