To maximize profit, the company should produce the quantity where marginal cost equals marginal benefit (revenue). Looking at the table, at quantity 4, the marginal cost is $4 and the marginal benefit (revenue) is $6. At this point, the company is still gaining more revenue than the cost, so it should produce 4 widgets. Therefore, the answer is B: 4.