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.

highlighted = computed this step

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.

dp[0,w]=0dp[0,w]=0
Base and first rowsThe full DP table is recomputed, but only the base row and first item row are displayed.Base and first item01234567cap-00000000(1,1)01111111

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.

first row value 1\text{first row value }1
Base and first rowsThe full DP table is recomputed, but only the base row and first item row are displayed.Base and first item01234567cap-00000000(1,1)01111111

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.

base cases anchor the table\text{base cases anchor the table}
Base and first rowsThe full DP table is recomputed, but only the base row and first item row are displayed.Base and first item01234567cap-00000000(1,1)01111111