It's been so long since I've done anything more complicated than balancing my checkbook that, not only do I not know how to do this, I don't even know what to search for to see if it's already been answered.
I have a linear environment with evenly spaced data points. I want to demonstrate how homogenous these data points are by computing a score between 0 and 1 that reflects how many of these data points meet some criteria. An example would be something like "starting at house x on a particular street, how many houses within 25 neighbors are registered Democrats?" (a totally made up example).
The score should be computed based on a given point in the set and should be weighted so that data points nearer to it count more heavily than those further away. For example, if the criteria check yields (True, True, False, False), the score should be higher than if it were (False, False, True, True).
It was pretty easy to arrive at $\sum_{n=1}^c f(d) = \frac{1}{2^d}$ where d is distance from starting point and c is the number of points to consider. It yielded exactly the type of results I wanted. However, they were too heavily weighted in favor of the nearest neighbors (the first counts for 50% of possible score), dropping rapidly to the point that 10 units away is almost insignificant.
Any suggestions how I can modify this equation so that the distribution is not so front-heavy, but still results in a value between 0 and 1? Everything I've tried so far simply results in moving the asymptote away from the desired value of 1, e.g. $\frac{1}{2^{d+c}}$, $\frac{1}{(2*c)^d}$, $\frac{\frac{1}{2^d}}{c}$. The number of data points can be a variable in the equation if that helps.