Define a recursive function geometric(p) that flips with probability p until it succeeds and returns the number of failed trials before that.

Updated: