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

images

images

19. Electing Emperors and Popes

The code election.m gives us estimates for the election probability of a leader for a group with N members, of whom nN are the dark horse candidates who receive among themselves all N notes, with at least M votes required for election. The operation of the code hinges on the row vector result, of length n; if we number the n dark horse candidates from 1 to n, then the value of result(j) will be the number of votes received by candidate j. To start, lines 01 through 05 define the basic variables of N, n, and M, ...

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