The period distribution of eclipsing and spectroscopic binary systems. I