Iíve been struggling with this issue for over a week, Iíve concluded that the approach I am using is incorrect. Here is a description:
People apply for permits and they need to know the probability that they will draw a permit. There are two types of people that apply, those that reside in state (residents) and those that reside out of state (non-residents). There is a set number of permits. There is also a limit to the number of non-residents that can draw a permit.
The variables to the problem are given as
R = Resident applicants
NR = Non-resident applicants
P = number of permits
L = Non-resident permit limit
Calculating the odds is simple in several situations, such if L > NR. The scenario I am unable to solve is when NR > L and (R+NR) > P.
For example, say we have 5 resident applicants, 3 non-resident applicants, 5 permits and a non-resident limit of 1. The non-resident limit does not mean that 1 non-resident must draw, it simply means that no more than 1 of the permits can be given to a non-resident. I am trying to determine the odds that an individual resident has of drawing a permit and the odds of an individual non-resident has of drawing a permit.
In this example, we have 8 total applicants and there will be 5 permits given out. Lets say that the 5 resident applicants are given a unique number on a chip, say 1, 2, 3, 4, 5; the 3 non-resident applicants are also given a unique number on a chip, say 6, 7, 8.
We now put the chips in the urn and randomly draw chips until the 5 permits have been given out. If we draw a non-residents chip first, then a permit is given to that non resident (we now have 4 permits left) and the non-resident quota of 1 has been reached. On the second draw, if we should again draw a non-resident chip, we set it aside, we do not allocate one of the permits for this non-resident since the non-resident quota has been met, and we draw again. We continue this process until all 5 permits have been allocated.
To clarify, there is a small possibility that no non-residents will receive a permit (such as when we draw 1,2,3,4,5 in that order). There is also a possibility that it takes 7 draws before all permits have been allocated (such as when we draw 6,7,8,1,2,3,4 in that order). Iím not interested in these probabilities, Iím only interested in the probability of applicant #1 receiving a permit and the probability of applicant #6 receiving a permit.
Iíve written a permutation generator program which calculates all permutations (8! for this example). I then apply the constraints to each permutation and count the results. This brute force approach works, but it isnít sufficient since the actual number of applicants can reach the thousands.