Period distributions in pulsating and binary stars