The rule of sum in discrete mathematics is a way to count a set of objects into independent elements. The rule of sum presents an idea that if one situation can occur in \(A\) ways and another situation can occur in \(B\) ways, then there are \(A+B\) ways that one of these types of situations may occur.

For example, a restaurant serves fifteen entrees that contain meat, five entrees that contain fish and three vegetarian entrees. How many dinners are there to choose from?

The rule of sum is applied here because each entrée contains either meat or fish or is vegetarian. So we have \(15+5+3=23.\)

The rule of sum is expressed in terms of sets: