Skip to Main Content
Programming Pearls, 2nd Edition
book

Programming Pearls, 2nd Edition

by Jon Bentley
September 1999
Intermediate to advanced content levelIntermediate to advanced
256 pages
7h 38m
English
Addison-Wesley Professional
Content preview from Programming Pearls, 2nd Edition

Column 12: A Sample Problem

Small computer programs are often educational and entertaining. This column tells the story of a tiny program that, in addition to those qualities, proved useful to a company.

12.1 The Problem

It was the early 1980’s, and the company had just purchased their first personal computers. After I got their primary system up and running, I encouraged people to keep an eye open for tasks around the office that could be done by a program. The firm’s business was public opinion polling, and an alert employee suggested automating the task of drawing a random sample from a printed list of precincts. Because doing the job by hand required a boring hour with a table of random numbers, she proposed the following program.

The input ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The Practice of Programming

The Practice of Programming

Brian W. Kernighan, Rob Pike
The Programmer's Brain

The Programmer's Brain

Felienne Hermans
Programming Interviews Exposed, 4th Edition

Programming Interviews Exposed, 4th Edition

John Mongan, Noah Suojanen Kindler, Eric Giguere
Programming Rust, 2nd Edition

Programming Rust, 2nd Edition

Jim Blandy, Jason Orendorff, Leonora F. S. Tindall

Publisher Resources

ISBN: 9780134498058Purchase book