Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been sent here from StackOverflow with my mathematical / algorithm question.

I am currently working with an organisation developing a web system, one area attempting to resolve in-house training clashes.

An example (as best as I can describe is):

What the company is attempting to do is prevent major clashes (>10 people affected) when planning training course times.

  • 100 people are attending training course A.
  • 75 people are attending training course B.
  • 25 people are attending training course C.
  • 5 people are attending training course D.

If 75 people attending B are all attending course A, and B were to run at the same time, there would be a total of 75 clashes.

If all 25 people from course C are attending course A and B, running any of these courses at the same time would result in at minimum of 25 clashes.

If 3 people were attending A and D, and they were to run at the same time only 3 would have an issue and therefore not be a major problem.

The system they are attempting to develop does not necessarily need to resolve the clash itself, just highlight if a certain number of clashes are likely to occur when arranging a new time.

I hope that explains the situation - I am a programmer by profession so this sort of thing is new to me, any points in the right direction would be fantastic!

share|cite|improve this question
Related:… – leonbloy Dec 2 '11 at 16:20
So you don't know in advance who's signed up for which class ? How many "slots" do you have to run classes ? – Suresh Venkat Dec 2 '11 at 17:50
The company should hire a mathematician as a consultant. Mathematicians work hard for many years to gain the skills needed to answer questions like these; companies should pay for access to those skills. – Gerry Myerson Dec 3 '11 at 9:12
@SureshVenkat - You don't know who's signed up in advanced for which class, they are chosen off a list then potential time forecasts are made to attempt not to clash as many as possible. In terms of slots, some have room for 20, others have 50, others more. As Gerry says, it is a complex area and I appreciate for the complex areas of the solution would require professional consulting - but as the web guy attempting to resolve it to the best of my abilities any help is appreciated :) – lethalMango Dec 4 '11 at 22:12

If you intend to estimate the expected number of clashes (not necessarily the unique or best measure, but perhaps the more easy to compute) you need a probabilistic model: in particular, you need to know the size of the total population ($N$) and if there is some dependency among courses attendance (i.e. if given that a particular person attends course A then it's more or less probable that he attends course B). Assumming the most simple scenario -no dependencies-, a simple computation (see this related question) shows that if $N_A$ people from a total population of $N$ attends course A, and $N_B$ attends course B, then the expected number of classhes is:

$$E(N_{AB}) = \frac{N_A N_B} {N}$$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.