Sum over every last item
transcript
Count orders of three ledgers. No conflicts at all. How many orders?
The table counts orders by their last ledger. The bug reads one cell only. That gives two of the six orders. Summing every last ledger gives six.
An order may end with any ledger. Each ending has its own cell. So add all the cells.
The state is the set of used ledgers. And the last ledger of the order. That is two to the n times n states.
Thirteen ledgers have six billion orders. The table has only a hundred and six thousand states. That is why it is fast.
Test one ledger: one order. Test three with no conflicts: six. Test a pair that conflicts.
Write a slow twin that lists every order. It rejects an order with a conflicting pair. Compare both for every n up to seven.
Any item can finish. Add every last cell. Full breakdown in the lecture.