We consider the average-case behavior of the Zero–One Knapsack problem, as well as an on-line version studied by Marchetti-Spaccamela and Vercellis. We allow the capacity of the knapsack to grow proportionally to the number of items, so that the optimum solution tends to be Θ(n). Under fairly general conditions on the distribution, we obtain a description of the expected value of the optimum offline solution which is accurate up to terms which areo(1). We then consider a simple greedy method for the on-line problem, which is calledOnLineGreedyand is allowed to use knowledge of the distribution, and we show that the solution obtained by this algorithm differs from the true optimum by an average of Θ(logn); in fact, we can determine the multiplicative constant hidden by the Θ-notation. Thus on average the cost of being forced to give answers on-line is quite small compared to the optimum solution. We also show that no on-line algorithm can improve overOnLineGreedyby more thano(logn). Our results hold, under fairly general conditions on the input distribution, for either the Zero–One Knapsack problem or its linear programming relaxation.