Skip to main content
Post Deleted by CommunityBot
Post Locked by CommunityBot
Post Migrated Away to cs.stackexchange.com by Marzio De Biasi, Jeffε, Mohammad Al-Turkistany, Kaveh
Post Closed as "Not suitable for this site" by Marzio De Biasi, Jeffε, Mohammad Al-Turkistany, Kaveh
added 15 characters in body; edited title
Source Link
Marzio De Biasi
  • 23.2k
  • 2
  • 58
  • 128

Do I understand psudopseudo polynomial time correctly?

The running time of knapsack is O(n*W)$O(n*W)$, but we always specify that this is only psudopseudo-polynomial. I was wondering if somebody could tell me if I understand the notion of psudopseudo-polynomial time correctly.

My current understanding is that psudopseudo polynomial time means polynomial in the magnitude of the input, and polynomial time is polynomial in the number of bits it takes to represent the input. Thus, looking through each element of an array is O(n)$O(n)$ in the magnitude of its length (psudopseudo-polynomial), but it is exponential in the number of bits in the length of the array. In the same way, binary search is O(log_2 n)$O(log_2 n)$ in the magnitude of the length of n$n$, but is linear in the number of bits in n$n$ making it "psudo"pseudo-logarithmic".

If I am correct, why do we never specify that binary search is linear in the number of bits, but we always specify that knapsack is exponential in the number of bits?

Do I understand psudo polynomial time correctly?

The running time of knapsack is O(n*W), but we always specify that this is only psudo-polynomial. I was wondering if somebody could tell me if I understand the notion of psudo-polynomial time correctly.

My current understanding is that psudo polynomial time means polynomial in the magnitude of the input, and polynomial time is polynomial in the number of bits it takes to represent the input. Thus, looking through each element of an array is O(n) in the magnitude of its length (psudo-polynomial), but it is exponential in the number of bits in the length of the array. In the same way, binary search is O(log_2 n) in the magnitude of the length of n, but is linear in the number of bits in n making it "psudo-logarithmic".

If I am correct, why do we never specify that binary search is linear in the number of bits, but we always specify that knapsack is exponential in the number of bits?

Do I understand pseudo polynomial time correctly?

The running time of knapsack is $O(n*W)$, but we always specify that this is only pseudo-polynomial. I was wondering if somebody could tell me if I understand the notion of pseudo-polynomial time correctly.

My current understanding is that pseudo polynomial time means polynomial in the magnitude of the input, and polynomial time is polynomial in the number of bits it takes to represent the input. Thus, looking through each element of an array is $O(n)$ in the magnitude of its length (pseudo-polynomial), but it is exponential in the number of bits in the length of the array. In the same way, binary search is $O(log_2 n)$ in the magnitude of the length of $n$, but is linear in the number of bits in $n$ making it "pseudo-logarithmic".

If I am correct, why do we never specify that binary search is linear in the number of bits, but we always specify that knapsack is exponential in the number of bits?

Tweeted twitter.com/#!/StackCSTheory/status/353287618877865985
Source Link
Maksim
  • 150
  • 4

Do I understand psudo polynomial time correctly?

The running time of knapsack is O(n*W), but we always specify that this is only psudo-polynomial. I was wondering if somebody could tell me if I understand the notion of psudo-polynomial time correctly.

My current understanding is that psudo polynomial time means polynomial in the magnitude of the input, and polynomial time is polynomial in the number of bits it takes to represent the input. Thus, looking through each element of an array is O(n) in the magnitude of its length (psudo-polynomial), but it is exponential in the number of bits in the length of the array. In the same way, binary search is O(log_2 n) in the magnitude of the length of n, but is linear in the number of bits in n making it "psudo-logarithmic".

If I am correct, why do we never specify that binary search is linear in the number of bits, but we always specify that knapsack is exponential in the number of bits?