PURPOSE: To provide an analytical description of the effect of random and systematic geometrical deviations on the target dose in radiotherapy and to derive margin rules. METHODS AND MATERIALS: The cumulative dose distribution delivered to the clinical target volume (CTV) is expressed analytically. Geometrical deviations are separated into treatment execution (random) and treatment preparation (systematic) variations. The analysis relates each possible preparation (systematic) error to the dose distribution over the CTV and allows computation of the probability distribution of, for instance, the minimum dose delivered to the CTV. RESULTS: The probability distributions of the cumulative dose over a population of patients are called dose-population histograms in short. Large execution (random) variations lead to CTV underdosage for a large number of patients, while the same level of preparation (systematic) errors leads to a much larger underdosage for some of the patients. A single point on the histogram gives a simple "margin recipe." For example, to ensure a minimum dose to the CTV of 95% for 90% of the patients, a margin between CTV and planning target volume (PTV) is required of 2.5 times the total standard deviation (SD) of preparation (systematic) errors (Sigma) plus 1.64 times the total SD of execution (random) errors (sigma') combined with the penumbra width, minus 1.64 times the SD describing the penumbra width (sigma(p)). For a sigma(p) of 3.2 mm, this recipe can be simplified to 2.5 Sigma + 0.7 sigma'. Because this margin excludes rotational errors and shape deviations, it must be considered as a lower limit for safe radiotherapy. CONCLUSION: Dose-population histograms provide insight into the effects of geometrical deviations on a population of patients. Using a dose-probability based approach, simple algorithms for choosing margins were derived.