A gun. Either one is bad, but a gunshot will draw attention and if the gunman doesn't kill you with the first shot, your odds are way better that he won't take another. A knife is silent; when somebody is in close enough to use one on you, you're gonna get cut a lot before you can even respond, and nobody is coming to run your attacker off. All of that is dismissing what happens if I fight back, because although I carry both a fixed blade knife and a handgun myself most of the time (and a fairly sizeable folding knife on me all the time) it's foolish to boast about "Well, I'd..." in hypotheticals.
Let the hottest female you've ever seen beat you up? Or beat up the ugliest female you've ever seen?