Tossing a coin and picking a card

Use this page to introduce the model of joint probabilities underlying contingency table data.

The diagram initially shows a simulation of tossing a coin and picking a card where the joint probabilities are known,

phead, heart  =  phead, club  =  ...  =  ptail, spade  =  1/8  =  0.125

Take a few samples to show the randomness of the sample proportions. Increase the sample size and show that the proportions are less variable.

Select Real data (unknown probabilities) from the pop-up menu at the top. This shows an example where we have sample data in which:

The proportions are estimates of the unknown population joint probabilities.


Many patients do not adhere to the medical regimes prescribed for them. Predicting which patients are likely to stop taking their prescribed medication would help treatment.

One study in the USA examined 62 patients who had been diagnosed as having glaucoma (a disease that affects vision) and who had been prescribed eye drops to take at home. Each patient was classified by whether or not they complied with the treatment prescribed (i.e. took their eye drops regularly) and by racial group.