A unifying view on some problems in probability and statistics