Geeta repeatedly guesses a fixed number n-p. When Shankar's number is greater than n-p, Geeta starts guessing n-p+1, n-p+2, and so on. Since Shankar chooses a number uniformly at random in [1, n] the probability that his number equals or exceeds n-p is p/n. So the expected number of guesses is n/p. Thereafter, Geeta has to guess p/2 numbers on average, sequentially. Minimizing the sum n/p + p/2 yields p = .