# Why is "encoding" important in time complexity?

I read many writing about the time complexity of 0-1 knapsack problem.

In conclusion, the time complexity of knapsack problem is O(nW) but it is pseudo-polynomial

because the size of W in binary encoding system is logW.

if it is unary-encoded, it is polynomial.

But my question is why we need to think like this?

the knapsack problem algorithm consumes same amount of time regardless of its encoding system.

When increasing W value from 10, 11, 12, ..., the consumed time for algorithms is also increasing according to the W value.

Why do we have to consider its encoding system and why is it important?

It seems that we have to think in the view of computer but I don't know exactly.

• Does this answer help? the size of the input is the number of bits required to represent the input Apr 23 '20 at 7:28
• You explain in your question why it's important. Apr 23 '20 at 7:32
• @YuvalFilmus Thank you for your comment. I check my question right now May 16 '20 at 4:02
• @PålGD Thank you so much! May 16 '20 at 4:02