This example is worked out here.
How do we determine the number of instances we need in the general case? The procedure above can be followed for each class that is in more than one association. Where two of these classes are associated, their sizes are adjusted with respect to each other, and then the numbers of instances of classes associated with them are adjusted.
Figure 3 shows five associated classes. A, C, and E each have one association, B has three associations, and D has two associations:
Figure 3: Multiply Associated Classes
There are two classes with more than one association: B and D. Above, we found the number of instances for with B. To find the instances for with D, calculate LCM(D) = LCM(5,3) = 15. Then
Together, the groups associated with B and D are:
B: 4A, 6B, 9C, 10D
D: 9B, 15D, 10E
To reconcile B and D,
The result is:
B: 12A, 18B, 27C, 30D
D: 18B, 30D, 20E
or, combined,
12A, 18B, 27C, 30D, 20E