An exam paper puts a small table in front of you. Twelve tape drives, three processes, how many drives each one holds now and the most it will ever need. Which of the four orders listed is a safe sequence? You have about a minute, and the whole answer is a few numbers added and compared. A student who has only memorised the words "safe state" loses the mark; one who knows the little routine behind them collects it in thirty seconds. This chapter teaches the routine, and then everything the exams build on top of it.
The routine has a name, the Banker's algorithm, and the name tells you the whole idea. Picture the manager of a village cooperative bank a week before Eid. Three traders hold credit lines: each has a limit, the most he may ever draw, and each has already drawn part of it. The vault holds only so much cash. A trader draws more whenever he needs to, and he repays everything only when his business is complete. A careless manager approves each withdrawal as it comes, and one evening finds the vault empty, with every trader waiting for the last lakh he needs to finish, and nobody able to repay anybody.
A careful manager asks one question before he approves a withdrawal: if I say yes, is there still some order in which every trader can draw up to his full limit, finish and repay, so that the repayments fund the next trader? If there is, he approves. If not, he asks the trader to wait, even though the cash is sitting in the vault.
Dijkstra gave exactly this manager to the operating system: the traders became processes, the cash became units of a resource (tape drives, printers), and the manager became a few lines of arithmetic.