As the number of relevant documents is unknown, some assumptions have to be made. Usually it is assumed that the probability p is constant (e.g. equal to 0.5), and that q can be estimated by the values from Inverse Document Frequency vector, created as in the Vector Space Model [ 8].
With the assumption that 50% of the documents containing a term are relevant, the number of relevant document containing the term and the number of irrelevant document containing the term will be equal and their sum will be zero in the denominator. To avoid infinity values when R-r = 0 or n-r=0, 0.5 can be added to each component as follows: