O'Reilly logo

Digital Dice by Paul J. Nahin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Solutionimage

image

12. How Many Runners in a Marathon?

The code estimate.m simulates this problem. It is probably the most MATLABy of all the codes in this book, with its use of several specialized (but all quite easy to understand), highly useful vector commands. All of these commands could be coded in detail—as I did in Problem 3 with the bubble-sort algorithm, rather than just using MATLAB’s sort command—but that would be tedious. If your favorite language doesn’t have similar commands, I’ll let the tedium be yours! And in estimate.m, since the code is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required