64

In Dijkstra's paper "Humble Programmer", he mentions that he gave some volunteers a problem to solve:

“I have run a little programming experiment with really experienced volunteers, but something quite unintended and quite unexpected turned up. None of my volunteers found the obvious and most elegant solution. Upon closer analysis this turned out to have a common source: their notion of repetition was so tightly connected to the idea of an associated controlled variable to be stepped up, that they were mentally blocked from seeing the obvious. Their solutions were less efficient, needlessly hard to understand, and it took them a very long time to find them.”

What was the problem Dijkstra gave to the volunteers? What were the solutions?

5
  • 3
    I'd bet on something recursive. EWD654 "In honor of Fibonacci" seems to be a good candidate
    – gnat
    Oct 11, 2011 at 21:04
  • This question could be fine as long as people don't use this as an opportunity to guess or speculate: it may be difficult to find out, but it has an answer and historical questions are on-topic here.
    – user8
    Oct 14, 2011 at 19:12
  • 9
    That quote came from EWD340 "Very Humble Programmers". I wasn't able to find an exact description of what the experiment was, but here is a link to the transcript of his full talk. cs.utexas.edu/~EWD/transcriptions/EWD03xx/EWD340.html Oct 15, 2011 at 2:43
  • 2
    Can anyone find a Dijkstra quote which is complimentary about anything? My favorite quote about him is "arrogance in computer science is measured in nano-Dijkstras" -- Alan Kay Oct 25, 2011 at 6:21
  • We must be very careful when we give advice to younger people: sometimes they follow it! ... heh :-) source : en.wikiquote.org/wiki/Edsger_W._Dijkstra Oct 26, 2011 at 23:03

1 Answer 1

10
+25

The "Dining philosophers problem" was the problem presented.

Basically there are 5 philosophers that need to eat. (imagine a plate of never ending food in front of each philosopher), between each plate is a fork (5 plates, 5 forks, 5 philosophers).

A philosopher can only eat if he is holding both the fork to the right and the fork to the left. (only two philosophers can eat at any given time).

A fork may be picked up anytime it is available and put down if it is being held. Each fork must be picked up interdependently. (one at a time).

While a philosopher is not eating, they are thinking (the need to alternate states is what drives the problem).

How do you allow each of them to eat and alternate thinking (so the others can eat) without creating a deadlocked system (where one philosopher is holding one fork and waiting for the other, preventing another philosopher from eating).

This has its roots in concurrent systems and is a typical university question presented when discussing Concurrency.

I believe that 4 or 5 "official" algorithms have been developed to solve the problem but a quick search on google for "Dining philosophers problem" will get you a vareity of results.

If you read the original version of the paper in the footnotes on page 866 it states: "Proceedings of the IFIP Congress 1965, 213-217. " Solutions of a problem in concurrent programming control."

The problem in concurrency and shared resources is the "Dining Philosophers Problem". :-)

Hope that helps.

12
  • 6
    Since this is mainly a historical question, any sources?
    – yannis
    Oct 26, 2011 at 21:48
  • 1
    Actually no, the sources you provide don't seem to reference the Dining philosophers problem as the one Dijkstra gave to the volunteers. Am I missing something? What I'm looking for is credible sources to support your The "Dining philosophers problem" was the problem presented claim, not descriptions of the problem itself (although your links are highly informative and interesting).
    – yannis
    Oct 26, 2011 at 23:10
  • 4
    @RobertFrench What we are looking for is what was the specific problem Dijkstra mentions in the quote in the question, and sources that prove it, not just any problem Dijkstra formulated. There is nothing in the quote that even suggests it was one of his own problems, it could be any problem really. Of course the Dining philosophers is one of Dijkstra's originals (with some help from CAR Hoare), noone is debating that, but that has nothing to do with the question.
    – yannis
    Oct 26, 2011 at 23:48
  • 4
    This is just plain wrong. "Solutions of a problem in concurrent programming control" is the Dining Philosophers Problem, and it is referenced in the Humble Programmer as one of Dijkstra's earlier works in the citation, but claiming that it's also the problem in the quote is unverifiable.
    – yannis
    Oct 27, 2011 at 14:58
  • 1
    This doesn't appear to have anything to do with repetition. I don't think it's the true historical answer.
    – Wildcard
    Nov 30, 2015 at 9:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.