The luminosity function for galaxies and the clustering of galaxies