My code works, But how do I make this code run in a deterministic time? The Problem: 
Given 3 inputs Bounce, Ball drop height, and ball view height. 

How do I calculate the number of times the observer can see the ball pass. 
So my code gives correct output, but it takes a longer time as bounce approaches 1, how do I make it deterministic in nature.

def bouncingBall(h, bounce, window):
    BounceFactor = bounce
    BallDropHeight = h
    ViewerHeight = window
    BounceLeft = h
    BallSeenTimes = 1
    if bounce &gt; 1 or bounce &lt; 0 or window &gt;= h or h ==0:

        return -1
    else:
        while (BounceLeft &gt; ViewerHeight):
            BounceLeft = BounceLeft * BounceFactor
            if (BounceLeft &gt; ViewerHeight):
                BallSeenTimes = BallSeenTimes + 2
            else:
                break
        return BallSeenTimes     


I am not looking for code answers, just the direction in which I need to think.
Currently, I think If I could somehow establish a linear relationship and create a function to "guess" the passes it would be faster.
Your code is determinstic: it uses no randomness. But I assume you want the running time to be essentially independent of the input.

Assuming I've understood the problem correctly, you're dropping a ball from height h and, when dropped from height x, it bounces to height x*Bouncefactor. You want to know how many times it passes through the height you're calling window.  Your approach is, essentially, to simulate the bouncing ball and count.

Instead of doing that, you should just calculate how many times the ball bounces before it's at height less than window.  This is the least k such that h * Bouncefactor^k &lt; window, so you just need to solve this equation and then convert the number of bounces into the number of times that the ball is seen.