441
Appendix A: The Basics of Counting
The branch of mathematics that deals with counting is called combinatorics and an understanding of it is needed
for probability and building risk models. We begin with two basic rules, which you will already know intuitively.
Many counting problems may ultimately be decomposed into problems that are solved by these rules.
A.1 The Rule of Sum
Suppose a library has 4 different books on learning French and 5 on learning Spanish. Then in order to
learn French or Spanish a student can select among these 4 + 5 = 9 books. That is a very simple example of
the following rule, called the rule of sum.
Rule of Sum
If a task can be performed in n distinct ways, while a second task can be performed in m dis-
tinct ways, and the tasks cannot be performed simultaneously, then performing either task can be
accomplished in any of n + m distinct ways.
The rule can be extended beyond two tasks as long as no pair of them can occur simultaneously. So, if
the other language books in the library consist of 10 different books on German and 3 on Portuguese, then
a student can select any one of the 5 + 4 + 10 + 3 = 22 books to learn a language.
A.2 Rule of Product
Suppose now that the CEO of a large corporation is considering a takeover of another company. The CEO
assigns 12 employees to 2 committees:
◾ Committee A (5 members) is to investigate possible favorable results (i.e., opportunities) from the
takeover.
◾ Committee B (7 members) will scrutinize possible unfavorable repercussions (i.e., risks) from the
takeover.
If the CEO decides to speak to just one committee member before making a decision, then by rule of
sum there are 12 members who can be called for opinion. However, in order to be unbiased the CEO decides
to speak with a member of committee A on Thursday and a member of committee B on Friday. There are
5 × 7 ways in which this can be done.
This is an example of the following rule of product.
Rule of Product
If a procedure can be broken down into rst and second stages, and if there are n possible out-
comes for the rst stage and m for the second, then the total procedure can be carried out, in the
designated order, in n × m ways.
Visit www.bayesianrisk.com for your free Bayesian network software and models in this chapter
Get Risk Assessment and Decision Analysis with Bayesian Networks now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.