How large do you think the design space is?
Technically, it's enormous, maybe 8^15 possible melodies.
But what about good-sounding melodies? That drastically reduces the space.
What about memorable, good-sounding melodies? Most melodies aren't catchy, so that limits the space some more.
What about culturally-appropriate, memorable, good-sounding melodies? It likely wouldn't make sense to use a Turkish opera melody in a pop song. Genres typically encompass a small space of melodies (e.g. Blues, Boogie Woogie).
What about such melodies that follow a particular rhythm, or match the vocalist's range, or that follow a desired chord progression?
After all this is considered, you're probably down to only a million combinations. But there are a billion songs out there...