For those who want to see Dijkstra's mathematics of programs in action: 1) basic (great for kids, math novices, whatever): https://www.amazon.com/gp/product/0470684534/ref=dbs_a_def_r... (ignore the two star review, this book would get 5 stars from me) 2) advanced (free, complete with videos): http://www.cs.toronto.edu/~hehner/aPToP/ 3) advanced: https://www.amazon.com/gp/product/0470848820/ref=dbs_a_def_r... 4) adva…
A Parable by Dijkstra (1973)
91–100 of 107 posts
Re: A Parable by Dijkstra (1973)
#92This solution is wrong. Rolling stock needs maintenance, and if you keep units permanently paired you can easily run out of units. In fact there is no easy solution given realistic business constraints. You can either put toilets in every car, which has a cost because it reduces available seating. In the best case you’ll lose money because of the lost seats. In the worst case overcrowding will make the toilets ineffe…
It's a parable which means it is fiction that that ignores details to make a point. As such it does it's job quite well unless you yet to read more into it than the author intended.
Re: A Parable by Dijkstra (1973)
#93Since we're talking about Dijkstra, thought I'd bring up the letter he wrote to the University of Texas when they replaced Haskell with Java in their introductory programming course: https://chrisdone.com/posts/dijkstra-haskell-java https://www.cs.utexas.edu/users/EWD/OtherDocs/To%20the%20Bud...
I absolutely adore Djikstra's stubborn and always eloquent insistence on rigor and purity in CS education, his unabashed refusal to see even one tendril of its mathematical connections be sacrificed for mere code production efficiency. If this case isn't going to be made at the university level, then where?
Re: A Parable by Dijkstra (1973)
#94I see the point. In fact I'd go so far as to call myself "delighted". But I thought I was a true mathematician.
'Scuse me while I go have a little existential crisis.
Re: A Parable by Dijkstra (1973)
#95The director got fired for causing actual losses and the shunting yard workers got huge bonuses and promotions for saving the company, right? Right?!
Re: A Parable by Dijkstra (1973)
#96This seems like it has potential for being the core of an interesting interview question. Maybe something along the lines of "You are hired as the Chief Shunter (lol) of a new rail company and the CEO, to cut costs, has stated that only half of all cars will have toilets. What instructions will you give the shunters? What complications could arise? What is the optimal solution and how would it impact UX?" etc. etc.
Re: A Parable by Dijkstra (1973)
#97I guess the ultimate solution assumes that all the turntables are long enough to deal with at least two-car consists? Seems strange that the company would cheap out on a little bit of porcelain in each car and then overprovision its turntables in such an extravagant way.
Re: A Parable by Dijkstra (1973)
#98When the shunting person persuaded everyone to imagine the two-car units as if they were symmetrical, the passengers still complained. Toilets can break, and when they did the doubly unlucky passenger would be forced to walk four car lengths to get to the nearest toilet. Also, those helpful arrows would be guiding the passenger the wrong direction for two of those car lengths. So we have comments that go out of sync…
> the least lucky passenger would have to walk six car lengths I just want to elaborate on this to show which assumptions you are making. There are two ways to make a paired unit: --+ and -+-. In your scenario I think you assume the first. The end of the train is thus ...+----+, since you mention the second last car's orientation being reversed. The +'s represent toilets. Then, what you are saying is to consider a pa…
Why are there three characters to represent a pair?
Do you mean something like this:
car with toilet: [+-]
car without toilet: [--]
my pair: [+-][--]
your pair: [-+][--]
?
> This is then the "extra few feet" that he talks of.
Using my notation (sorry to flip it):
[-+][--][-+][--]
That's four cars. If someone is sitting at the right end of car #2, they have an arrow pointing them to car #1 for the toilet. If that toilet is broken, then they must walk back through car #2 all the way to the end of car #3.
But I may be misunderstanding your initial notation.
Re: A Parable by Dijkstra (1973)
#99Earlier quoted context omitted.
> the least lucky passenger would have to walk six car lengths I just want to elaborate on this to show which assumptions you are making. There are two ways to make a paired unit: --+ and -+-. In your scenario I think you assume the first. The end of the train is thus ...+----+, since you mention the second last car's orientation being reversed. The +'s represent toilets. Then, what you are saying is to consider a pa…
Indeed. Dijkstra specifies two cars joined with the toilet in the middle: " When each car with a toilet was coupled, from now until eternity, at its toileted end with a car without a toilet, from then onwards the shunting yard, instead of dealing with N directed cars of two types, could deal with N/2 identical units that, to all intents and purposes, could be regarded as symmetrical. "
On the physical "train" side of the analogy, we've got a believable scheme to save money by only having a toilet in every other car. Given the constraints, it is indeed clever to make these two-car atomic units and reimagine them as symmetrical. All the fixes in the story taken together could pale in comparison to the cost of putting a toilets all the cars.
But when we cross the digital divide we get a completely different set of constraints. Even if dealing with 100 million train cars it may be cheaper to just fork the entire train yard and add a toilet object to each car.
Re: A Parable by Dijkstra (1973)
#100The final paragraph is my favorite. I have a PhD in mathematics but I've since realized I'm not a mathematician, I'm more of a logician/philosopher. I find the parable very interesting, but I can totally believe a lot of real mathematicians don't. Too many mathematicians, if you crack open a random page of their work, you'll see lots of opaque integrals and calculations. None of that ever appealed to me. Even when I…
Rather a 'true mathematician' (who by definition ignores all practical considerations) would find it unsatisfactory because the problem of finding a way of allowing toilet-less carriages is solved by not allowing toilet-less carriages.
Frankly I think they should have just put the toilet in the middle of the toilet-carrying carriages, but maybe I'm weird.