You drop a ball from a given height. After each bounce, the ball returns to some fixed proportion of its previous height. If the ball bounces to height 1 or less, we consider it to have stopped bouncing. Return the number of bounces it takes for the ball to stop moving.

```
bouncingBall(initialHeight, bouncingProportion)

boucingBall(4, 0.5)
After first bounce, ball bounces to height 2
After second bounce, ball bounces to height 1
Therefore answer is 2 bounces

boucingBall(30, 0.3)
After first bounce, ball bounces to height 9
After second bounce, ball bounces to height 2.7
After third bounce, ball bounces to height 0.81
Therefore answer is 3 bounces


```

Initial height is an integer in range [2,1000]

Bouncing Proportion is a decimal in range [0, 1)

Difficulty: introductory

Starter code:

def bouncing_ball(initial, proportion):
	

Solutions:
import math

def bouncing_ball(initial, proportion):
    return math.ceil(math.log(initial, 1/proportion))

def bouncing_ball(initial, proportion):
    count = 0
    while initial > 1:
        initial = initial * proportion
        count = count + 1
    return count

def bouncing_ball(i, p , n = 0):
    return n if i <= 1 else bouncing_ball(i*p, p, n+1)

def bouncing_ball(h, bounce):
    count = 0
    while h > 1:
        count += 1
        h *= bounce
    return count

bouncing_ball=lambda x,y,p=1: p if x*y<=1 else bouncing_ball(x*y,y,p+1)

def bouncing_ball(initial, p):
    if initial <= 1:
        return 0
    else:
        return 1 + bouncing_ball(initial * p, p)

bouncing_ball=b=lambda i,p:i>1and-~b(i*p,p)

def bouncing_ball(initial, proportion):
    height_now=initial         # ball height now.
    counter=0                  # counter for number of jumb initially zero
    while height_now>1:        # stay in while loop until height is smaller than than1
        height_now*=proportion
        counter+=1             # each time we iterate in while increase count of jump by 1
    return counter             # return number of jump


from math import ceil, log

def bouncing_ball(initial, proportion):
    return ceil(-log(initial - 1e-9, proportion))

from math import ceil, log

def bouncing_ball(initial, proportion):
    return ceil(log(1 / initial, proportion))