# Sampling from joint probability distribution

I am starting out in statistics and quite stuck with this question regarding decision theory and sampling from binomial distributions. I think the problem might relate to Conditional Probabilities and Joint Probability Functions, but I don't really know how to proceed and would really appreciate some help.

Consider the following example, where the underlying probabilities are unknown and must be inferred from samples. Insurance companies A and B try to recruit new clients. In one sample, 100 interested clients are visited by A and B. In total, A has offered 50 clients a plan and B has offered 20 clients a plan, out of which 15 clients also received an offer from A. A suspects that B has illegitimately acquired some information on whether A has previously offered a client an plan and uses this to compete for valuable clients. If the decisions of A and B were independent, how likely would it be that 15 clients get an offer from A and B?

EDIT: I though of calculating the probability of a client receiving an offer from A and B, which would be 50/100 * 20/100 = 10/100 and using a beta distribution to model how likely it is that out of 100 clients 15 receive offers from both. Is this a feasible method?

You mention the binomial and beta distributions in your question, but this problem is a direct application of the hypergeometric distribution. It does not relate to either of the distributions you mention. There are 100 clients, 50 of whom have received an offer from A. In the terminology of R's phyper function, we say there are $$n=50$$ white balls in the urn (clients with offer from A) and $$m=50$$ black balls in the urn (clients without an offer from A).

B draws $$k=20$$ balls from the urn at random (makes an offer to 20 random clients). What is the probability that 14 or fewer of the B's balls are white (also received an offer from A)?

> phyper(14, m=50, n=50, k=20)
[1] 0.9885825


Alternatively, what is the probability that 15 or more of B's balls are white (also received an offer from A)?

> phyper(14, m=50, n=50, k=20, lower.tail=FALSE)
[1] 0.01141749


The probability is only 0.011, meaning that the probability of having so much overlap between A's and B's offers would have been unlikely if B was choosing clients randomly. Let's consider the null and alternative hypotheses:

$$H_0$$: B chooses clients at random, independently of A

$$H_A$$: B makes an offer A's clients with greater probability than to those without an offer from A

If we use the number of overlapping clients $$X$$ as the test statistic, then the p-value for testing the null vs the alternative is $$P(X\ge 15)=0.011$$. The p-value is fairly small, so there is reasonable evidence that B is in fact targeting A's clients whether by using inside information or for some other reason.

Are all clients really equally like to get an offer?

Just a warning that this sort of textbook probability calculation has limitations in real business contexts. The null hypothesis above assumes that B chooses clients at random, and it is impossible to avoid this assumption in an elementary probability calculation. In a real business context, however, it might well be that some clients are more attractive than others and that some of the interested clients would never in fact receive an offer from either A or B because of something about their financial or personal situation. Heterogeneity between the clients would increase the probability of overlap between A and B's offers even if B was operating without knowledge of A. The limited information provided in the question does not allow such complications to be incorporated into a solution.

• Thanks a lot for the answer, I didn't know of the hypergeometric distribution and the solution sounds great! Commented Feb 27, 2022 at 11:44