Filling the Table
Base Case and First Rows
The DP table begins with a row for using no items. The next row shows how the first item changes every capacity. These rows make the recurrence concrete before the full table is filled, and they also explain why later cells have a trustworthy base to reuse.
Base row
With no items, every capacity has value 0. Why: there is nothing available to put in the bag, so capacity alone cannot create value. This row is the recurrence's floor: later rows can safely refer to it when an item is taken from the first available row. It also makes the empty-subset option explicit.
First item row
After the first item, each positive capacity can reach value 1. Why: the item fits as soon as capacity reaches its weight, and before any other item exists there is no richer alternative. The row shows a simple threshold pattern, but the interpretation is already the full DP interpretation: best value using only the prefix currently allowed.
Diagram note
The displayed prefix is clipped from the recomputed DP table; only the first two rows are shown here. That clipping is presentational, not a separate computation: the full table is recomputed first and the render shows the prefix that matches this lesson's scope. The DP is exact for this zero-one integer instance and pseudo-polynomial because the number of columns follows the capacity magnitude. Pixel positions are rounded for layout; every number shown is exact.