Created a second OS X partition, erased the first, now can't delete old partition
If the machine still boots, go to the App store and "purchase" Yosemite (its free).  Now boot the machine holding COMMAND R and boot to internet recovery.  If you see a poorly animated spinning globe instead of an Apple logo then you are on the right track.  Now you have can reformat the whole drive and do a clean install of Yosemite.